FreeCalypso > hg > fc-magnetite
comparison src/aci2/aci/cmh_phbr.c @ 3:93999a60b835
src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 26 Sep 2016 00:29:36 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:c41a534f33c6 | 3:93999a60b835 |
---|---|
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 "aci_all.h" | |
28 | |
29 /*==== INCLUDES ===================================================*/ | |
30 #include "aci_cmh.h" | |
31 #include "ati_cmd.h" | |
32 #include "aci_cmd.h" | |
33 #include "aci.h" | |
34 | |
35 #ifdef FAX_AND_DATA | |
36 #include "aci_fd.h" | |
37 #endif /* of #ifdef FAX_AND_DATA */ | |
38 | |
39 #include "psa.h" | |
40 #include "psa_cc.h" | |
41 #include "psa_sim.h" | |
42 | |
43 #include "cmh.h" | |
44 #include "phb.h" | |
45 | |
46 #include "aci_lst.h" | |
47 #include "conc_sms.h" | |
48 | |
49 /*==== CONSTANTS ==================================================*/ | |
50 | |
51 | |
52 /*==== TYPES ======================================================*/ | |
53 | |
54 | |
55 /*==== EXPORT =====================================================*/ | |
56 | |
57 | |
58 /*==== VARIABLES ==================================================*/ | |
59 | |
60 | |
61 /*==== FUNCTIONS ==================================================*/ | |
62 | |
63 /* | |
64 +-------------------------------------------------------------------+ | |
65 | PROJECT : GSM-PS (6147) MODULE : CMH_PHBR | | |
66 | ROUTINE : cmhPHB_StatIndication | | |
67 +-------------------------------------------------------------------+ | |
68 | |
69 PURPOSE : | |
70 | |
71 */ | |
72 | |
73 GLOBAL SHORT cmhPHB_StatIndication ( UBYTE psaStatus, SHORT cmeError, BOOL indicate ) | |
74 { | |
75 UBYTE idx; /* used for counting */ | |
76 T_PHB_CMD_PRM * pPHBCmdPrm; | |
77 | |
78 TRACE_FUNCTION ("cmhPHB_StatIndication()"); | |
79 | |
80 switch ( psaStatus ) | |
81 { | |
82 case ( PHB_READY ): | |
83 { | |
84 simShrdPrm.pb_stat = PB_STAT_Ready; | |
85 | |
86 if (indicate) | |
87 { | |
88 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_Ready); | |
89 } | |
90 for (idx = 0; idx < CMD_SRC_MAX; idx++) | |
91 { | |
92 pPHBCmdPrm = &cmhPrm[idx].phbCmdPrm; | |
93 if (pPHBCmdPrm->curCmd EQ AT_CMD_CPBW) | |
94 { | |
95 pPHBCmdPrm->curCmd = AT_CMD_NONE; | |
96 R_AT (RAT_OK, idx) (AT_CMD_CPBW); | |
97 break; | |
98 } | |
99 } | |
100 break; | |
101 } | |
102 case ( PHB_WRITE_FAIL ): | |
103 { | |
104 simShrdPrm.pb_stat = PB_STAT_Ready; | |
105 | |
106 if (indicate) | |
107 { | |
108 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_Ready); | |
109 } | |
110 for (idx = 0; idx < CMD_SRC_MAX; idx++) | |
111 { | |
112 pPHBCmdPrm = &cmhPrm[idx].phbCmdPrm; | |
113 if (pPHBCmdPrm->curCmd EQ AT_CMD_CPBW) | |
114 { | |
115 pPHBCmdPrm->curCmd = AT_CMD_NONE; | |
116 R_AT( RAT_CME, idx)( AT_CMD_CPBW, cmeError ); | |
117 break; | |
118 } | |
119 } | |
120 break; | |
121 } | |
122 case ( PHB_BUSY ): | |
123 { | |
124 #ifdef TI_PS_FFS_PHB | |
125 simShrdPrm.pb_stat = PB_STAT_Busy; | |
126 break; | |
127 #endif | |
128 } | |
129 case ( PHB_UNKNOWN ): | |
130 { | |
131 simShrdPrm.pb_stat = PB_STAT_Blocked; | |
132 | |
133 if (indicate) | |
134 { | |
135 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_NotReady); | |
136 } | |
137 break; | |
138 } | |
139 default: | |
140 { | |
141 TRACE_EVENT("FATAL ERROR in cmhPHB_StatIndication"); | |
142 simShrdPrm.pb_stat = PB_STAT_Blocked; | |
143 return -1; | |
144 } | |
145 } | |
146 | |
147 #ifdef _CONC_TESTING_ | |
148 if (simShrdPrm.pb_stat EQ PB_STAT_Ready) | |
149 { | |
150 concSMS_delAllIncompleteMsg(); | |
151 } | |
152 #endif | |
153 | |
154 for( idx = 0; idx < CMD_SRC_MAX; idx++ ) | |
155 { | |
156 R_AT( RAT_PHB_STATUS, idx )( simShrdPrm.pb_stat ); | |
157 } | |
158 | |
159 return 0; | |
160 } | |
161 | |
162 /*==== EOF ========================================================*/ | |
163 |