FreeCalypso > hg > fc-tourmaline
comparison src/g23m-aci/aci/aci_bat_csc.c @ 1:fa8dc04885d8
src/g23m-*: import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Oct 2020 06:25:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:4e78acac3d88 | 1:fa8dc04885d8 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-F&D (8411) | |
4 | Modul : ACI_BAT | |
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 BAT wrapper modul is ... | |
18 | | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #include "aci_all.h" /* includes prim.h, which includes p_bat.h */ | |
23 #include "aci_cmh.h" /* prototypes of sAT_,qAT_,tAT_ */ | |
24 #include "aci_cmd.h" | |
25 #include "aci_lst.h" | |
26 #include "ati_int.h" | |
27 #include "aci_bat_cmh.h" /* prototypes of sBAT_,qBAT_,tBAT_ */ | |
28 #include "aci_bat.h" | |
29 | |
30 | |
31 /* | |
32 +--------------------------------------------------------------------+ | |
33 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
34 | STATE : code ROUTINE : sBAT_PercentBAND | | |
35 +--------------------------------------------------------------------+ | |
36 | |
37 PURPOSE : | |
38 */ | |
39 GLOBAL T_ACI_BAT_RSLT sBAT_PercentBAND(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
40 T_BAT_cmd_send *cmd) | |
41 { | |
42 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
43 T_BAT_cmd_set_percent_band *band = cmd->params.ptr_set_percent_band; | |
44 | |
45 TRACE_FUNCTION ("sBAT_PercentBAND()"); | |
46 | |
47 /* Pass the value directly as given by the BAT application */ | |
48 if (band->band NEQ BAT_P_BAND_BAND_NOT_PRESENT) | |
49 { | |
50 ret = (T_ACI_BAT_RSLT)sAT_PercentBAND((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
51 (T_ACI_BAND_MODE)band->mode, (U8)band->band); | |
52 } | |
53 | |
54 return ret; | |
55 } | |
56 | |
57 /* | |
58 +--------------------------------------------------------------------+ | |
59 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
60 | STATE : code ROUTINE : tBAT_PercentBAND | | |
61 +--------------------------------------------------------------------+ | |
62 | |
63 PURPOSE : | |
64 */ | |
65 GLOBAL T_ACI_BAT_RSLT tBAT_PercentBAND(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
66 T_BAT_cmd_send *cmd) | |
67 { | |
68 TRACE_FUNCTION ("tBAT_PercentBAND()"); | |
69 return (ACI_BAT_FAIL); | |
70 } | |
71 | |
72 /* | |
73 +--------------------------------------------------------------------+ | |
74 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
75 | STATE : code ROUTINE : qBAT_PercentBAND | | |
76 +--------------------------------------------------------------------+ | |
77 | |
78 PURPOSE : | |
79 */ | |
80 GLOBAL T_ACI_BAT_RSLT qBAT_PercentBAND(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
81 T_BAT_cmd_send *cmd) | |
82 { | |
83 T_ACI_BAT_RSLT ret; | |
84 T_BAT_cmd_response resp; | |
85 T_BAT_res_que_percent_band band; | |
86 | |
87 TRACE_FUNCTION ("qBAT_PercentBAND()"); | |
88 | |
89 resp.ctrl_response = BAT_RES_QUE_PERCENT_BAND; | |
90 resp.response.ptr_que_percent_band = &band; | |
91 /* Band initial value should be assigned to 0 */ | |
92 resp.response.ptr_que_percent_band->band = BAT_P_BAND_BAND_NOT_PRESENT; | |
93 | |
94 ret = (T_ACI_BAT_RSLT)qAT_PercentBAND((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
95 (T_ACI_BAND_MODE*)&band.mode, (U8*)&band.band); | |
96 | |
97 aci_bat_send(src_infos_psi, &resp); | |
98 return (ret); | |
99 } | |
100 | |
101 /* | |
102 +--------------------------------------------------------------------+ | |
103 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
104 | STATE : code ROUTINE : qBAT_PercentCPI | | |
105 +--------------------------------------------------------------------+ | |
106 | |
107 PURPOSE : | |
108 */ | |
109 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCPI(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
110 T_BAT_cmd_send *cmd) | |
111 { | |
112 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
113 T_BAT_cmd_response resp; | |
114 /* T_BAT_res_que_percent_cpi cpi; */ | |
115 | |
116 TRACE_FUNCTION ("qBAT_PercentCPI()"); | |
117 | |
118 /* resp.ctrl_response = BAT_RES_QUE_PERCENT_CPI; */ | |
119 /* hmm, do not know which ACI function to call ! */ | |
120 aci_bat_send(src_infos_psi, &resp); | |
121 return (ret); | |
122 } | |
123 | |
124 /* | |
125 +--------------------------------------------------------------------+ | |
126 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
127 | STATE : code ROUTINE : qBAT_PercentCNAP | | |
128 +--------------------------------------------------------------------+ | |
129 | |
130 PURPOSE : | |
131 */ | |
132 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCNAP(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
133 T_BAT_cmd_send *cmd) | |
134 { | |
135 T_ACI_BAT_RSLT ret; | |
136 T_BAT_cmd_response resp; | |
137 T_BAT_res_que_percent_cnap cnap; | |
138 | |
139 TRACE_FUNCTION ("qBAT_PercentCNAP()"); | |
140 | |
141 resp.ctrl_response = BAT_RES_QUE_PERCENT_CNAP; | |
142 resp.response.ptr_que_percent_cnap = &cnap; | |
143 | |
144 ret = (T_ACI_BAT_RSLT)qAT_PercentCNAP((T_ACI_CMD_SRC)src_infos_psi->srcId); | |
145 aci_bat_send(src_infos_psi, &resp); | |
146 return (ret); | |
147 } | |
148 | |
149 /* | |
150 +--------------------------------------------------------------------+ | |
151 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
152 | STATE : code ROUTINE : sBAT_PercentALS | | |
153 +--------------------------------------------------------------------+ | |
154 | |
155 PURPOSE : | |
156 */ | |
157 GLOBAL T_ACI_BAT_RSLT sBAT_PercentALS(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
158 T_BAT_cmd_send *cmd) | |
159 { | |
160 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
161 T_ACI_ALS_MOD ALSmode; | |
162 | |
163 TRACE_FUNCTION ("sBAT_PercentALS()"); | |
164 | |
165 #ifndef _SIMULATION_ | |
166 /* mapping for SAP BAT %ALS values according to 8415.052.doc */ | |
167 switch( cmd->params.ptr_set_percent_als->mode ) | |
168 { | |
169 case BAT_P_ALS_MOD_SPEECH: | |
170 ALSmode = ALS_MOD_SPEECH; | |
171 break; | |
172 | |
173 case BAT_P_ALS_MOD_AUX_SPEECH: | |
174 ALSmode = ALS_MOD_AUX_SPEECH; | |
175 break; | |
176 | |
177 default: | |
178 cmdCmeError(CME_ERR_OpNotSupp); | |
179 return (ACI_BAT_FAIL); | |
180 } | |
181 #else /* if SIMULATION */ | |
182 ALSmode = cmd->params.ptr_set_percent_als->mode; | |
183 #endif /* SIMULATION */ | |
184 ret = (T_ACI_BAT_RSLT)sAT_PercentALS((T_ACI_CMD_SRC)src_infos_psi->srcId, ALSmode); | |
185 return (ret); | |
186 } | |
187 | |
188 /* | |
189 +--------------------------------------------------------------------+ | |
190 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
191 | STATE : code ROUTINE : tBAT_PercentALS | | |
192 +--------------------------------------------------------------------+ | |
193 | |
194 PURPOSE : | |
195 */ | |
196 GLOBAL T_ACI_BAT_RSLT tBAT_PercentALS (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
197 T_BAT_cmd_send *cmd) | |
198 { | |
199 TRACE_FUNCTION ("tBAT_PercentALS()"); | |
200 return (ACI_BAT_FAIL); | |
201 } | |
202 | |
203 /* | |
204 +--------------------------------------------------------------------+ | |
205 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
206 | STATE : code ROUTINE : qBAT_PercentALS | | |
207 +--------------------------------------------------------------------+ | |
208 | |
209 PURPOSE : | |
210 */ | |
211 GLOBAL T_ACI_BAT_RSLT qBAT_PercentALS(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
212 T_BAT_cmd_send *cmd) | |
213 { | |
214 T_ACI_BAT_RSLT ret; | |
215 T_BAT_cmd_response resp; | |
216 T_BAT_res_que_percent_als als; | |
217 T_ACI_ALS_MOD als_aci_mode; | |
218 | |
219 TRACE_FUNCTION ("qBAT_PercentALS()"); | |
220 | |
221 resp.ctrl_response = BAT_RES_QUE_PERCENT_ALS; | |
222 resp.response.ptr_que_percent_als = &als; | |
223 | |
224 ret = (T_ACI_BAT_RSLT)qAT_PercentALS((T_ACI_CMD_SRC)src_infos_psi->srcId,&als_aci_mode); | |
225 switch(als_aci_mode) | |
226 { | |
227 case ALS_MOD_SPEECH: | |
228 als.mode = BAT_P_ALS_MOD_SPEECH; | |
229 break; | |
230 | |
231 case ALS_MOD_AUX_SPEECH: | |
232 als.mode = BAT_P_ALS_MOD_AUX_SPEECH; | |
233 break; | |
234 | |
235 default: | |
236 cmdCmeError(CME_ERR_OpNotSupp); | |
237 return (ACI_BAT_FAIL); | |
238 } | |
239 aci_bat_send(src_infos_psi, &resp); | |
240 return (ret); | |
241 } | |
242 | |
243 /* | |
244 +--------------------------------------------------------------------+ | |
245 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
246 | STATE : code ROUTINE : sBAT_PercentPPP | | |
247 +--------------------------------------------------------------------+ | |
248 | |
249 PURPOSE : | |
250 */ | |
251 #if defined(FF_WAP) || defined(FF_PPP) || defined(FF_SAT_E) | |
252 | |
253 GLOBAL T_ACI_BAT_RSLT sBAT_PercentPPP(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
254 T_BAT_cmd_send *cmd) | |
255 { | |
256 T_ACI_BAT_RSLT ret; | |
257 | |
258 TRACE_FUNCTION ("sBAT_PercentPPP()"); | |
259 | |
260 ret = (T_ACI_BAT_RSLT)sAT_PercentPPP((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
261 (T_ACI_PPP_PROT)cmd->params.ptr_set_percent_ppp->authprot, | |
262 (CHAR *)cmd->params.ptr_set_percent_ppp->user, | |
263 (CHAR *)cmd->params.ptr_set_percent_ppp->password, | |
264 (T_ACI_PPP_CON)cmd->params.ptr_set_percent_ppp->conn_type); | |
265 | |
266 return (ret); | |
267 } | |
268 | |
269 /* | |
270 +--------------------------------------------------------------------+ | |
271 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
272 | STATE : code ROUTINE : qBAT_PercentPPP | | |
273 +--------------------------------------------------------------------+ | |
274 | |
275 PURPOSE : | |
276 */ | |
277 | |
278 GLOBAL T_ACI_BAT_RSLT qBAT_PercentPPP(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
279 T_BAT_cmd_send *cmd) | |
280 { | |
281 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
282 T_BAT_cmd_response resp; | |
283 T_BAT_res_que_percent_ppp ppp; | |
284 | |
285 TRACE_FUNCTION ("qBAT_PercentPPP()"); | |
286 | |
287 resp.ctrl_response = BAT_RES_QUE_PERCENT_PPP; | |
288 resp.response.ptr_que_percent_ppp = &ppp; | |
289 | |
290 ret = (T_ACI_BAT_RSLT) qAT_PercentPPP(src_infos_psi->srcId, (ULONG*)&ppp.ipaddr, (ULONG*)&ppp.dns1,(ULONG*)&ppp.dns2); | |
291 aci_bat_send(src_infos_psi, &resp); | |
292 return (ret); | |
293 } | |
294 #endif /* defined(FF_WAP) || defined(FF_PPP) || defined(FF_SAT_E) */ | |
295 |