comparison g23m-aci/aci/cmh_phbr.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_PHBR
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : This module defines the functions which are responsible
18 | for the responses of the protocol stack adapter for
19 | the phonebook management.
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef CMH_PHBR_C
24 #define CMH_PHBR_C
25 #endif
26
27 #include "config.h"
28 #include "fixedconf.h"
29 #include "condat-features.h"
30 #include "aci_conf.h"
31
32 #include "aci_all.h"
33
34 /*==== INCLUDES ===================================================*/
35 #include "aci_cmh.h"
36 #include "ati_cmd.h"
37 #include "aci_cmd.h"
38 #include "aci.h"
39
40 #ifdef FAX_AND_DATA
41 #include "aci_fd.h"
42 #endif /* of #ifdef FAX_AND_DATA */
43
44 #include "psa.h"
45 #include "psa_cc.h"
46 #include "psa_sim.h"
47
48 #include "cmh.h"
49 #include "phb.h"
50
51 #include "aci_lst.h"
52 #include "conc_sms.h"
53
54 /*==== CONSTANTS ==================================================*/
55
56
57 /*==== TYPES ======================================================*/
58
59
60 /*==== EXPORT =====================================================*/
61
62
63 /*==== VARIABLES ==================================================*/
64
65
66 /*==== FUNCTIONS ==================================================*/
67
68 /*
69 +-------------------------------------------------------------------+
70 | PROJECT : GSM-PS (6147) MODULE : CMH_PHBR |
71 | ROUTINE : cmhPHB_StatIndication |
72 +-------------------------------------------------------------------+
73
74 PURPOSE :
75
76 */
77
78 GLOBAL SHORT cmhPHB_StatIndication ( T_PHB_STAT psaStatus, SHORT cmeError, BOOL indicate )
79 {
80 UBYTE idx; /* used for counting */
81 T_PHB_CMD_PRM * pPHBCmdPrm;
82
83 TRACE_FUNCTION ("cmhPHB_StatIndication()");
84
85 switch ( psaStatus )
86 {
87 case ( PHB_READY ):
88 {
89 simShrdPrm.pb_stat = PB_STAT_Ready;
90
91 if (indicate)
92 {
93 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_Ready);
94 }
95 for (idx = 0; idx < CMD_SRC_MAX; idx++)
96 {
97 pPHBCmdPrm = &cmhPrm[idx].phbCmdPrm;
98 if (pPHBCmdPrm->curCmd EQ AT_CMD_CPBW)
99 {
100 pPHBCmdPrm->curCmd = AT_CMD_NONE;
101 R_AT (RAT_OK, (T_ACI_CMD_SRC)idx) (AT_CMD_CPBW);
102 break;
103 }
104 }
105 break;
106 }
107 case ( PHB_WRITE_FAIL ):
108 {
109 simShrdPrm.pb_stat = PB_STAT_Ready;
110
111 if (indicate)
112 {
113 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_Ready);
114 }
115 for (idx = 0; idx < CMD_SRC_MAX; idx++)
116 {
117 pPHBCmdPrm = &cmhPrm[idx].phbCmdPrm;
118 if (pPHBCmdPrm->curCmd EQ AT_CMD_CPBW)
119 {
120 pPHBCmdPrm->curCmd = AT_CMD_NONE;
121 R_AT( RAT_CME, (T_ACI_CMD_SRC)idx)( AT_CMD_CPBW, cmeError );
122 break;
123 }
124 }
125 break;
126 }
127 case ( PHB_BUSY ):
128 {
129 #ifdef TI_PS_FFS_PHB
130 simShrdPrm.pb_stat = PB_STAT_Busy;
131 if (indicate)
132 {
133 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_NotReady);
134 }
135 break;
136 #endif
137 }
138 /*lint -fallthrough */
139 case ( PHB_UNKNOWN ):
140 {
141 simShrdPrm.pb_stat = PB_STAT_Blocked;
142
143 if (indicate)
144 {
145 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_NotReady);
146 }
147 break;
148 }
149 default:
150 {
151 TRACE_EVENT("FATAL ERROR in cmhPHB_StatIndication");
152 simShrdPrm.pb_stat = PB_STAT_Blocked;
153 return -1;
154 }
155 }
156
157 #if defined _CONC_TESTING_ AND defined TI_PS_FF_CONC_SMS
158 if (simShrdPrm.pb_stat EQ PB_STAT_Ready)
159 {
160 concSMS_delAllIncompleteMsg();
161 }
162 #endif
163
164 for( idx = 0; idx < CMD_SRC_MAX; idx++ )
165 {
166 R_AT( RAT_PHB_STATUS, (T_ACI_CMD_SRC)idx )( simShrdPrm.pb_stat );
167 }
168
169 return 0;
170 }
171
172 /*==== EOF ========================================================*/
173