FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-aci/aci/cmh_phbr.c @ 775:eedbf248bac0
gsm-fw/g23m-aci subtree: initial import from LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 12 Oct 2014 01:45:14 +0000 |
parents | |
children | ac09e56b4e3b |
comparison
equal
deleted
inserted
replaced
774:40a721fd9854 | 775:eedbf248bac0 |
---|---|
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 ( T_PHB_STAT 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, (T_ACI_CMD_SRC)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, (T_ACI_CMD_SRC)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 if (indicate) | |
127 { | |
128 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_NotReady); | |
129 } | |
130 break; | |
131 #endif | |
132 } | |
133 /*lint -fallthrough */ | |
134 case ( PHB_UNKNOWN ): | |
135 { | |
136 simShrdPrm.pb_stat = PB_STAT_Blocked; | |
137 | |
138 if (indicate) | |
139 { | |
140 percentCSTAT_indication(STATE_MSG_PBOOK, ENTITY_STATUS_NotReady); | |
141 } | |
142 break; | |
143 } | |
144 default: | |
145 { | |
146 TRACE_EVENT("FATAL ERROR in cmhPHB_StatIndication"); | |
147 simShrdPrm.pb_stat = PB_STAT_Blocked; | |
148 return -1; | |
149 } | |
150 } | |
151 | |
152 #if defined _CONC_TESTING_ AND defined TI_PS_FF_CONC_SMS | |
153 if (simShrdPrm.pb_stat EQ PB_STAT_Ready) | |
154 { | |
155 concSMS_delAllIncompleteMsg(); | |
156 } | |
157 #endif | |
158 | |
159 for( idx = 0; idx < CMD_SRC_MAX; idx++ ) | |
160 { | |
161 R_AT( RAT_PHB_STATUS, (T_ACI_CMD_SRC)idx )( simShrdPrm.pb_stat ); | |
162 } | |
163 | |
164 return 0; | |
165 } | |
166 | |
167 /*==== EOF ========================================================*/ | |
168 |