FreeCalypso > hg > freecalypso-citrine
comparison g23m-aci/aci/ati_ss.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-F&D (8411) | |
4 | Modul : ATI | |
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 : AT Command Interpreter: Supplementary Service related commands. | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 #ifndef ATI_SS_C | |
22 #define ATI_SS_C | |
23 | |
24 #include "config.h" | |
25 #include "fixedconf.h" | |
26 #include "condat-features.h" | |
27 #include "aci_conf.h" | |
28 | |
29 #undef DUMMY_ATI_STRINGS | |
30 | |
31 #include "aci_all.h" | |
32 | |
33 #include "aci_lst.h" | |
34 #include "aci_cmh.h" | |
35 #include "ati_cmd.h" | |
36 #include "aci_io.h" | |
37 #include "aci_cmd.h" | |
38 #include "l4_tim.h" | |
39 | |
40 #include "aci_mem.h" | |
41 #include "aci_prs.h" | |
42 | |
43 #include "ati_int.h" | |
44 | |
45 #ifdef FF_ATI_BAT | |
46 | |
47 #include "typedefs.h" | |
48 #include "gdd.h" | |
49 #include "bat.h" | |
50 | |
51 #include "ati_bat.h" | |
52 | |
53 #endif /*FF_ATI_BAT*/ | |
54 | |
55 typedef struct | |
56 { | |
57 char *name; | |
58 T_ACI_FAC fac; | |
59 } net_fac; | |
60 | |
61 const net_fac fac[] = | |
62 { | |
63 {"SC", FAC_Sc}, | |
64 {"AO", FAC_Ao}, | |
65 {"OI", FAC_Oi}, | |
66 {"OX", FAC_Ox}, | |
67 {"AI", FAC_Ai}, | |
68 {"IR", FAC_Ir}, | |
69 {"AB", FAC_Ab}, | |
70 {"AG", FAC_Ag}, | |
71 {"AC", FAC_Ac}, | |
72 {"FD", FAC_Fd}, | |
73 {"PN", FAC_Pn}, /* Network personalisation of the ME */ | |
74 {"PU", FAC_Pu}, /* Network subset personalisation of the ME */ | |
75 {"PP", FAC_Pp}, /* Service provider personalisation of the ME */ | |
76 {"PC", FAC_Pc}, /* Corporate personalisation of the ME */ | |
77 {"PS", FAC_Ps}, /* SIM personalisation */ | |
78 {"PF", FAC_Pf}, /* Personalisation on first inserted SIM */ | |
79 {"AL", FAC_Al}, /* ALS settings locked by CHV2 */ | |
80 {"P2", FAC_P2}, | |
81 #ifdef SIM_PERS | |
82 {"BP", FAC_Bl}, /* Blocked Network personalisation of the ME */ | |
83 {"FC", FAC_Fc}, | |
84 {"FM", FAC_Fcm}, | |
85 {"MU", FAC_Mu}, | |
86 {"MM", FAC_Mum}, | |
87 #endif | |
88 #ifdef FF_PHONE_LOCK | |
89 {"PL", FAC_Pl}, | |
90 {"LA", FAC_Apl}, | |
91 #endif | |
92 {0, FAC_NotPresent} | |
93 | |
94 }; | |
95 | |
96 #ifdef SIM_PERS | |
97 | |
98 typedef struct | |
99 { | |
100 char *name; | |
101 T_SUP_INFO_TYPE sup_info; | |
102 } net_mepd_sup_info; | |
103 | |
104 const net_mepd_sup_info mepd_sup_info[] = | |
105 { | |
106 {"MAX", FCMAX}, | |
107 {"ALE", FCATTEMPTSLEFT}, | |
108 {"RFM", FCRESETFAILMAX}, | |
109 {"RFA", FCRESETFAILATTEMPTSLEFT}, | |
110 {"RSM", FCRESETSUCCESSMAX}, | |
111 {"RSA", FCRESETSUCCESSATTEMPTSLEFT}, | |
112 {"TMF", TIMERFLAG}, | |
113 {"ETF", ETSIFLAG}, | |
114 {"AIF", AIRTELINDFLAG}, | |
115 {0, CMEPD_SUP_INFO_NotPresent} | |
116 }; | |
117 | |
118 #endif | |
119 GLOBAL char dialBuf[MAX_DIAL_LEN]; | |
120 GLOBAL char subBuf[MAX_SUBADDR_LEN]; | |
121 | |
122 /* | |
123 +--------------------------------------------------------------------+ | |
124 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
125 | STATE : code ROUTINE : setatPlusCTFR | | |
126 +--------------------------------------------------------------------+ | |
127 | |
128 PURPOSE : +CTFR command (Call TRansfer, Call Deflection) | |
129 */ | |
130 GLOBAL T_ATI_RSLT setatPlusCTFR (char * cl, UBYTE srcId) | |
131 { | |
132 T_ACI_RETURN ret = AT_FAIL; | |
133 T_ACI_TOA type; | |
134 T_ACI_TOA *p_type; | |
135 T_ACI_TOS satype; | |
136 T_ACI_TOS *p_satype; | |
137 CHAR *subadr = subBuf; | |
138 SHORT toa_oct = 0; | |
139 SHORT tos_oct = 0; | |
140 CHAR numBuf[MAX_B_SUBSCR_NUM_LEN]; | |
141 | |
142 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
143 | |
144 src_params->curAtCmd = AT_CMD_CTFR; | |
145 | |
146 /* init */ | |
147 p_type = &type; | |
148 p_satype = &satype; | |
149 memset( numBuf, 0, sizeof(numBuf)); | |
150 memset( subadr, 0, MAX_SUBADDR_LEN); | |
151 | |
152 cl = parse(cl,"srsr",(LONG)MAX_B_SUBSCR_NUM_LEN, numBuf, &toa_oct, | |
153 (LONG)MAX_SUBADDR_LEN, subadr, &tos_oct); | |
154 | |
155 /* Process number parameter (mandatory) */ | |
156 if(!cl OR numBuf[0] EQ '\0') | |
157 { | |
158 /* Number is mandatory. No number parameter => error */ | |
159 cmdCmeError (CME_ERR_OpNotAllow); | |
160 return (ATI_FAIL); | |
161 } | |
162 | |
163 /* Process Type Of Address (optional) */ | |
164 if(toa_oct EQ 0) | |
165 { | |
166 /* Type Of Address not present */ | |
167 p_type = NULL; | |
168 } | |
169 else | |
170 { | |
171 /* Type Of Address present */ | |
172 type = toa_demerge (toa_oct); | |
173 if (type.ton < 0 OR type.npi < 0) | |
174 { | |
175 cmdCmeError (CME_ERR_OpNotAllow); | |
176 return (ATI_FAIL); | |
177 } | |
178 } | |
179 | |
180 /* Process subadr (optional) */ | |
181 if( subadr[0] EQ 0 ) | |
182 { | |
183 /* subadr not present */ | |
184 subadr = NULL; | |
185 } | |
186 | |
187 /* Process Type Of Subaddress (optional) */ | |
188 if(tos_oct EQ 0) | |
189 { | |
190 /* Type Of Subaddress not present */ | |
191 p_satype = NULL; | |
192 } | |
193 else | |
194 { | |
195 satype = tos_demerge (tos_oct); | |
196 if (satype.tos < 0 OR satype.oe < 0) | |
197 { | |
198 cmdCmeError (CME_ERR_OpNotAllow); | |
199 return (ATI_FAIL); | |
200 } | |
201 } | |
202 | |
203 #ifdef FF_ATI_BAT | |
204 { | |
205 T_BAT_cmd_send cmd; | |
206 T_BAT_cmd_set_plus_ctfr my_bat_set_plus_ctfr; | |
207 | |
208 TRACE_FUNCTION("setatPlusCTFR() calls bat_send() <=== as APPLICATION"); | |
209 | |
210 memset(&my_bat_set_plus_ctfr, 0, sizeof(my_bat_set_plus_ctfr)); | |
211 cmd.ctrl_params = BAT_CMD_SET_PLUS_CTFR; | |
212 cmd.params.ptr_set_plus_ctfr = &my_bat_set_plus_ctfr; | |
213 | |
214 my_bat_set_plus_ctfr.c_number = strlen(numBuf); | |
215 memcpy(my_bat_set_plus_ctfr.number, numBuf, my_bat_set_plus_ctfr.c_number); | |
216 my_bat_set_plus_ctfr.type = (S16)p_type; | |
217 my_bat_set_plus_ctfr.v_subaddr = 0; /*??? */ | |
218 my_bat_set_plus_ctfr.c_subaddr = strlen(subadr); | |
219 memcpy(my_bat_set_plus_ctfr.subaddr, subadr, my_bat_set_plus_ctfr.c_subaddr); | |
220 my_bat_set_plus_ctfr.satype = (S16)p_satype; | |
221 | |
222 bat_send(ati_bat_get_client(srcId), &cmd); | |
223 | |
224 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
225 } | |
226 #else /* OLD FUNCTION BODY */ | |
227 | |
228 TRACE_FUNCTION("setatPlusCTFR()"); | |
229 | |
230 ret = sAT_PlusCTFR ((T_ACI_CMD_SRC)srcId, numBuf, p_type, subadr, p_satype); | |
231 | |
232 if (ret NEQ AT_EXCT) | |
233 { | |
234 cmdCmeError(CME_ERR_Unknown); | |
235 } | |
236 return (map_aci_2_ati_rslt(ret)); | |
237 | |
238 #endif /* no FF_ATI_BAT*/ | |
239 } | |
240 | |
241 /* | |
242 +--------------------------------------------------------------------+ | |
243 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
244 | STATE : code ROUTINE : atiSShandleCSSN | | |
245 +--------------------------------------------------------------------+ | |
246 | |
247 PURPOSE : Handles the +CSSN and %CSSN set commands.*/ | |
248 | |
249 GLOBAL T_ATI_RSLT atiSShandleCSSN (char* cl, UBYTE srcId) | |
250 { | |
251 int cssiMode = ati_user_output_cfg[srcId].CSSI_stat, cssuMode = ati_user_output_cfg[srcId].CSSU_stat; | |
252 | |
253 TRACE_FUNCTION("atiSShandleCSSN()"); | |
254 | |
255 if (*cl EQ 0 OR *cl EQ ';') | |
256 { | |
257 cmdCmeError(CME_ERR_OpNotAllow); | |
258 return (ATI_FAIL); | |
259 } | |
260 cl = parse(cl,"dd",&cssiMode,&cssuMode); | |
261 /* A value of 2 for cssiMode is now accepted. This value will only be set by %CSSN */ | |
262 if(!cl OR cssiMode > 2 OR cssiMode < 0 OR | |
263 cssuMode > 1 OR cssuMode < 0 ) | |
264 { | |
265 cmdCmeError(CME_ERR_OpNotAllow); | |
266 return (ATI_FAIL); | |
267 } | |
268 ati_user_output_cfg[srcId].CSSI_stat=(UBYTE)cssiMode; | |
269 ati_user_output_cfg[srcId].CSSU_stat=(UBYTE)cssuMode; | |
270 | |
271 if (*cl NEQ '\0' AND *cl NEQ ';') | |
272 { | |
273 cmdCmeError(CME_ERR_OpNotAllow); | |
274 return (ATI_FAIL); | |
275 } | |
276 return (ATI_CMPL); | |
277 | |
278 } | |
279 | |
280 | |
281 /* | |
282 +--------------------------------------------------------------------+ | |
283 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
284 | STATE : code ROUTINE : atPlusCSSN | | |
285 +--------------------------------------------------------------------+ | |
286 | |
287 PURPOSE : +CSSN command (supplementary service notifications) | |
288 */ | |
289 GLOBAL T_ATI_RSLT setatPlusCSSN (char* cl, UBYTE srcId) | |
290 { | |
291 TRACE_FUNCTION("setatPLusCSSN()"); | |
292 | |
293 /*Check that the range of the first parameter "CSSI mode" is valid (0 or 1).Further parameters are | |
294 checked in the function atiSShandleCSSN()*/ | |
295 if ((*cl EQ '0') OR (*cl EQ '1') OR (*cl EQ ',')) | |
296 return atiSShandleCSSN(cl,srcId); | |
297 else | |
298 { | |
299 cmdCmeError(CME_ERR_OpNotAllow); | |
300 return (ATI_FAIL); | |
301 } | |
302 } | |
303 | |
304 | |
305 /* | |
306 +--------------------------------------------------------------------+ | |
307 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
308 | STATE : code ROUTINE : atPercentCSSN | | |
309 +--------------------------------------------------------------------+ | |
310 | |
311 PURPOSE : %CSSN command (supplementary service notifications extension) | |
312 */ | |
313 GLOBAL T_ATI_RSLT setatPercentCSSN (char* cl, UBYTE srcId) | |
314 { | |
315 TRACE_FUNCTION("setatPercentCSSN()"); | |
316 | |
317 return atiSShandleCSSN(cl,srcId); | |
318 } | |
319 | |
320 | |
321 | |
322 GLOBAL T_ATI_RSLT queatPlusCSSN (char* cl, UBYTE srcId) | |
323 { | |
324 TRACE_FUNCTION("queatPLusCSSN()"); | |
325 | |
326 resp_disp(srcId, cl,"bb",&ati_user_output_cfg[srcId].CSSI_stat,&ati_user_output_cfg[srcId].CSSU_stat); | |
327 return (ATI_CMPL); | |
328 } | |
329 | |
330 /* | |
331 +--------------------------------------------------------------------+ | |
332 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
333 | STATE : code ROUTINE : queatPercentCSSN | | |
334 +--------------------------------------------------------------------+ | |
335 | |
336 PURPOSE : Handles the %CSSN query command.*/ | |
337 | |
338 | |
339 GLOBAL T_ATI_RSLT queatPercentCSSN (char* cl, UBYTE srcId) | |
340 { | |
341 TRACE_FUNCTION("queatPercentCSSN()"); | |
342 | |
343 resp_disp(srcId, cl,"bb",&ati_user_output_cfg[srcId].CSSI_stat,&ati_user_output_cfg[srcId].CSSU_stat); | |
344 return (ATI_CMPL); | |
345 } | |
346 | |
347 | |
348 | |
349 /* | |
350 +--------------------------------------------------------------------+ | |
351 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
352 | STATE : code ROUTINE : atPlusCCFC | | |
353 +--------------------------------------------------------------------+ | |
354 | |
355 PURPOSE : +CCFC call forwarding | |
356 */ | |
357 | |
358 GLOBAL T_ATI_RSLT setatPlusCCFC(char *cl, UBYTE srcId) | |
359 { | |
360 T_ACI_RETURN ret = AT_FAIL; | |
361 T_ACI_CCFC_RSN reason=CCFC_RSN_NotPresent; | |
362 T_ACI_CCFC_MOD mode=CCFC_MOD_NotPresent; | |
363 T_ACI_TOA type; | |
364 T_ACI_TOA *p_type; | |
365 T_ACI_TOS satype; | |
366 T_ACI_TOS *p_satype; | |
367 T_ACI_CLASS class_type=CLASS_NotPresent; | |
368 CHAR *subadr = subBuf; | |
369 SHORT time=-1; | |
370 SHORT toa_oct=0; | |
371 SHORT tos_oct=0; | |
372 CHAR numBuf[MAX_B_SUBSCR_NUM_LEN]; | |
373 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
374 | |
375 /* init */ | |
376 memset( numBuf, 0, sizeof(numBuf)); | |
377 memset( subadr, 0, MAX_SUBADDR_LEN); | |
378 | |
379 TRACE_FUNCTION("setatPLusCCFC()"); | |
380 | |
381 p_type=&type; | |
382 p_satype=&satype; | |
383 | |
384 cl = parse(cl,"ddsrdsrr",&reason,&mode, | |
385 (LONG)MAX_B_SUBSCR_NUM_LEN,numBuf,&toa_oct,&class_type, | |
386 (LONG)MAX_SUBADDR_LEN,subadr,&tos_oct,&time); | |
387 | |
388 if(!cl) | |
389 { | |
390 cmdCmeError(CME_ERR_OpNotAllow); | |
391 return (ATI_FAIL); | |
392 } | |
393 if (mode EQ 2) /*query mode*/ | |
394 { | |
395 #ifdef FF_ATI_BAT | |
396 { | |
397 T_BAT_cmd_send cmd; | |
398 T_BAT_cmd_set_plus_ccfc my_bat_set_plus_ccfc = {0}; | |
399 | |
400 TRACE_FUNCTION("setatPlusCCFC() {Query mode=2} calls bat_send() <=== as APPLICATION"); | |
401 | |
402 cmd.ctrl_params = BAT_CMD_SET_PLUS_CCFC; | |
403 cmd.params.ptr_set_plus_ccfc = &my_bat_set_plus_ccfc; | |
404 | |
405 my_bat_set_plus_ccfc.reason = (T_BAT_plus_ccfc_reason)reason; | |
406 my_bat_set_plus_ccfc.mode = (T_BAT_plus_ccfc_mode)mode; | |
407 my_bat_set_plus_ccfc.bearer_class = (T_BAT_plus_ccfc_bearer_class)class_type; | |
408 src_params->curAtCmd = AT_CMD_CCFC; | |
409 | |
410 bat_send(ati_bat_get_client(srcId), &cmd); | |
411 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
412 } | |
413 #else /* no FF_ATI_BAT */ | |
414 ret = qAT_PlusCCFC((T_ACI_CMD_SRC)srcId,reason,class_type); | |
415 switch (ret) | |
416 { | |
417 case AT_EXCT: | |
418 { | |
419 src_params->curAtCmd = AT_CMD_CCFC; | |
420 return (ATI_EXCT); | |
421 } | |
422 case AT_BUSY: | |
423 { | |
424 TRACE_EVENT("setatPLusCCFC(): qAT_PlusCCFC returns BUSY"); | |
425 return (ATI_BUSY); | |
426 } | |
427 case AT_FAIL: | |
428 { | |
429 TRACE_EVENT("setatPLusCCFC(): qAT_PlusCCFC returns FAIL"); | |
430 cmdCmeError(CME_ERR_Unknown); /* Extended error returned by qAT_PlusCCFC */ | |
431 return (ATI_FAIL); | |
432 } | |
433 default: | |
434 { | |
435 cmdCmeError(CME_ERR_Unknown); | |
436 return (ATI_FAIL); | |
437 } | |
438 } | |
439 #endif /* no FF_ATI_BAT */ | |
440 } | |
441 else /*set mode*/ | |
442 { | |
443 if( subadr[0] EQ 0 ) | |
444 { | |
445 /* subadr has been omitted in command */ | |
446 subadr = NULL; | |
447 } | |
448 | |
449 if(toa_oct EQ 0) | |
450 p_type=NULL; | |
451 else | |
452 { | |
453 type=toa_demerge(toa_oct); | |
454 if (type.ton < 0 OR type.npi < 0) | |
455 { | |
456 cmdCmeError(CME_ERR_OpNotAllow); | |
457 return (ATI_FAIL); | |
458 } | |
459 } | |
460 if(tos_oct EQ 0) | |
461 p_satype=NULL; | |
462 else | |
463 { | |
464 satype=tos_demerge(tos_oct); | |
465 if(satype.tos < 0 OR satype.oe < 0) | |
466 { | |
467 cmdCmeError(CME_ERR_OpNotAllow); | |
468 return (ATI_FAIL); | |
469 } | |
470 } | |
471 #ifdef FF_ATI_BAT | |
472 { | |
473 T_BAT_cmd_send cmd; | |
474 T_BAT_cmd_set_plus_ccfc my_bat_set_plus_ccfc = {0}; | |
475 | |
476 TRACE_FUNCTION("setatPlusCCFC() calls bat_send() <=== as APPLICATION"); | |
477 | |
478 cmd.ctrl_params = BAT_CMD_SET_PLUS_CCFC; | |
479 cmd.params.ptr_set_plus_ccfc = &my_bat_set_plus_ccfc; | |
480 | |
481 my_bat_set_plus_ccfc.reason = (T_BAT_plus_ccfc_reason)reason; | |
482 my_bat_set_plus_ccfc.mode = (T_BAT_plus_ccfc_mode)mode; | |
483 | |
484 /* check for number string and store for BAT send */ | |
485 if (my_bat_set_plus_ccfc.c_number = strlen(numBuf)) | |
486 { | |
487 my_bat_set_plus_ccfc.v_number = TRUE; | |
488 memcpy(my_bat_set_plus_ccfc.number, numBuf, my_bat_set_plus_ccfc.c_number); | |
489 } | |
490 | |
491 my_bat_set_plus_ccfc.type = (S16)toa_oct; | |
492 | |
493 /* check for subaddr string and store for BAT send */ | |
494 if (subadr NEQ NULL AND | |
495 (my_bat_set_plus_ccfc.c_subaddr = strlen(subadr))) | |
496 { | |
497 my_bat_set_plus_ccfc.v_subaddr = TRUE; | |
498 memcpy(my_bat_set_plus_ccfc.subaddr, subadr, my_bat_set_plus_ccfc.c_subaddr); | |
499 } | |
500 | |
501 my_bat_set_plus_ccfc.satype = (S16)tos_oct; | |
502 my_bat_set_plus_ccfc.bearer_class = (T_BAT_plus_ccfc_bearer_class)class_type; | |
503 my_bat_set_plus_ccfc.time = (T_BAT_plus_ccfc_time)time; | |
504 | |
505 src_params->curAtCmd = AT_CMD_CCFC; | |
506 | |
507 bat_send(ati_bat_get_client(srcId), &cmd); | |
508 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
509 } | |
510 #else /* no FF_ATI_BAT */ | |
511 if( numBuf[0] EQ '\0' ) | |
512 { | |
513 /* number has been omitted in command */ | |
514 ret = sAT_PlusCCFC((T_ACI_CMD_SRC)srcId,reason,mode,NULL,p_type,class_type,subadr,p_satype,time); | |
515 } | |
516 else | |
517 { | |
518 ret = sAT_PlusCCFC((T_ACI_CMD_SRC)srcId,reason,mode,numBuf,p_type,class_type,subadr,p_satype,time); | |
519 } | |
520 if (ret EQ AT_EXCT) | |
521 { | |
522 src_params->curAtCmd = AT_CMD_CCFC; | |
523 } | |
524 else | |
525 { | |
526 cmdCmeError(CME_ERR_Unknown); | |
527 } | |
528 #endif /* no FF_ATI_BAT */ | |
529 } | |
530 return (map_aci_2_ati_rslt(ret)); | |
531 } | |
532 | |
533 /* | |
534 +--------------------------------------------------------------------+ | |
535 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
536 | STATE : code ROUTINE : atPlusCLCK | | |
537 +--------------------------------------------------------------------+ | |
538 | |
539 PURPOSE : +CLCK command (Select facility lock settings) | |
540 */ | |
541 | |
542 GLOBAL T_ATI_RSLT setatPlusCLCK(char *cl, UBYTE srcId) | |
543 { | |
544 T_ACI_RETURN ret = AT_FAIL; | |
545 T_ACI_FAC fac_num = FAC_NotPresent; | |
546 T_ACI_CLCK_MOD mod = CLCK_MOD_NotPresent; | |
547 T_ACI_CLASS class_type = CLASS_NotPresent; | |
548 char passwd[MAX_PWD_LENGTH] = {0}; | |
549 char fac_str[3] = {0,0,0}; | |
550 USHORT i; | |
551 | |
552 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
553 | |
554 src_params->curAtCmd = AT_CMD_CLCK; | |
555 TRACE_FUNCTION("setatPLusCLCK() "); | |
556 | |
557 cl = parse(cl, "sdnd", (LONG)3, fac_str, &mod, (LONG)MAX_PWD_LENGTH, passwd, &class_type); | |
558 | |
559 if (!cl OR *fac_str EQ 0) | |
560 { | |
561 cmdCmeError(CME_ERR_OpNotAllow); | |
562 return (ATI_FAIL); | |
563 } | |
564 strcpy(fac_str, strupper(fac_str)); | |
565 for (i=0;fac[i].name NEQ 0; i++) | |
566 { | |
567 if (strcmp(fac[i].name, fac_str) EQ 0 ) | |
568 { | |
569 fac_num = fac[i].fac; /*translates facility string in facility number */ | |
570 break; | |
571 } | |
572 } | |
573 if (fac_num EQ FAC_NotPresent) /* facility non existent*/ | |
574 { | |
575 cmdCmeError(CME_ERR_OpNotAllow); | |
576 return (ATI_FAIL); | |
577 } | |
578 | |
579 #ifdef FF_ATI_BAT | |
580 { | |
581 T_BAT_cmd_send cmd; | |
582 T_BAT_cmd_set_plus_clck my_bat_set_plus_clck; | |
583 | |
584 TRACE_FUNCTION("setatPLusCLCK() calls bat_send() <=== as APPLICATION"); | |
585 | |
586 memset(&my_bat_set_plus_clck, 0, sizeof(my_bat_set_plus_clck)); | |
587 cmd.ctrl_params = BAT_CMD_SET_PLUS_CLCK; | |
588 cmd.params.ptr_set_plus_clck = &my_bat_set_plus_clck; | |
589 | |
590 my_bat_set_plus_clck.fac = fac_num; | |
591 my_bat_set_plus_clck.mode = mod; | |
592 if(mod NEQ CLCK_MODE_QUERY) /*query mode*/ | |
593 { | |
594 my_bat_set_plus_clck.v_passwd = 1; | |
595 my_bat_set_plus_clck.c_passwd = strlen(passwd); | |
596 memcpy(my_bat_set_plus_clck.passwd, passwd, my_bat_set_plus_clck.c_passwd); | |
597 } | |
598 | |
599 my_bat_set_plus_clck.bearer_class = class_type; | |
600 | |
601 bat_send(ati_bat_get_client(srcId), &cmd); | |
602 | |
603 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
604 } | |
605 #else /* OLD FUNCTION BODY */ | |
606 { | |
607 T_ACI_CLSSTAT clsStat; | |
608 SHORT pos; | |
609 | |
610 TRACE_FUNCTION("setatPLusCLCK()"); | |
611 | |
612 if (mod EQ CLCK_MOD_NotPresent) /* mode non existent*/ | |
613 { | |
614 cmdCmeError(CME_ERR_OpNotAllow); | |
615 return(ATI_FAIL); | |
616 } | |
617 if (mod EQ CLCK_MODE_QUERY) /*query mode*/ | |
618 { | |
619 ret = qAT_PlusCLCK((T_ACI_CMD_SRC)srcId, fac_num, class_type, &clsStat); | |
620 | |
621 if(ret EQ AT_CMPL) | |
622 { | |
623 pos = sprintf(g_sa,"+CLCK: "); | |
624 | |
625 if (clsStat.status NEQ STATUS_NotPresent) | |
626 { | |
627 pos += sprintf(g_sa+pos,"%d,",clsStat.status); | |
628 } | |
629 else | |
630 { | |
631 pos += sprintf(g_sa+pos,","); | |
632 } | |
633 if (clsStat.class_type NEQ CLASS_NotPresent) | |
634 { | |
635 pos += sprintf(g_sa+pos,"%d,",clsStat.class_type); | |
636 } | |
637 ci_remTrailCom(g_sa, pos); | |
638 io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); | |
639 return (ATI_CMPL); | |
640 } | |
641 } | |
642 else /*set mode*/ | |
643 { | |
644 ret = sAT_PlusCLCK((T_ACI_CMD_SRC)srcId, fac_num, mod, passwd, class_type); | |
645 } | |
646 | |
647 switch(ret) | |
648 { | |
649 case(AT_EXCT): | |
650 break; | |
651 | |
652 case(AT_BUSY): | |
653 cmdCmeError(CME_ERR_Unknown); | |
654 TRACE_EVENT("ME is busy"); | |
655 break; | |
656 | |
657 case(AT_FAIL): | |
658 cmdCmeError(CME_ERR_Unknown); | |
659 break; | |
660 } | |
661 return (map_aci_2_ati_rslt(ret)); | |
662 } | |
663 #endif /* no FF_ATI_BAT*/ | |
664 } | |
665 | |
666 /* | |
667 +--------------------------------------------------------------------+ | |
668 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
669 | STATE : code ROUTINE : atPlusCPWD | | |
670 +--------------------------------------------------------------------+ | |
671 | |
672 PURPOSE : +CPWD command (changes password) | |
673 */ | |
674 | |
675 GLOBAL T_ATI_RSLT setatPlusCPWD(char *cl, UBYTE srcId) | |
676 { | |
677 T_ACI_RETURN ret = AT_FAIL; | |
678 T_ACI_FAC fac_num = FAC_NotPresent; | |
679 CHAR oldpwd[MAX_PWD_LENGTH]={0}; | |
680 CHAR newpwd[MAX_PWD_LENGTH]={0}; | |
681 CHAR fac_str[3]={0}; | |
682 USHORT i; | |
683 | |
684 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
685 | |
686 src_params->curAtCmd = AT_CMD_CPWD; | |
687 | |
688 cl = parse(cl, "snn", (LONG)3, fac_str, (LONG)MAX_PWD_LENGTH, oldpwd, (LONG)MAX_PWD_LENGTH, newpwd); | |
689 strcpy(fac_str, (char *)strupper(fac_str)); | |
690 if(!cl OR *fac_str EQ 0 OR *oldpwd EQ 0 OR *newpwd EQ 0) | |
691 { | |
692 cmdCmeError(CME_ERR_OpNotAllow); | |
693 return (ATI_FAIL); | |
694 } | |
695 for (i = 0; fac[i].name NEQ 0; i++) | |
696 { | |
697 if (strcmp(fac[i].name,fac_str) EQ 0 ) | |
698 { | |
699 fac_num=fac[i].fac; /*translates facility string in facility number */ | |
700 break; | |
701 } | |
702 } | |
703 if (fac[i].name EQ 0) /* facility non existent*/ | |
704 { | |
705 cmdCmeError(CME_ERR_OpNotAllow); | |
706 return (ATI_FAIL); | |
707 } | |
708 #ifdef FF_ATI_BAT | |
709 { | |
710 T_BAT_cmd_send cmd; | |
711 T_BAT_cmd_set_plus_cpwd my_bat_set_plus_cpwd; | |
712 | |
713 TRACE_FUNCTION("setatPLusCPWD() calls bat_send() <=== as APPLICATION"); | |
714 | |
715 memset(&my_bat_set_plus_cpwd, 0, sizeof(my_bat_set_plus_cpwd)); | |
716 cmd.ctrl_params = BAT_CMD_SET_PLUS_CPWD; | |
717 cmd.params.ptr_set_plus_cpwd = &my_bat_set_plus_cpwd; | |
718 | |
719 my_bat_set_plus_cpwd.fac = fac_num; | |
720 my_bat_set_plus_cpwd.c_oldpwd = strlen(oldpwd); | |
721 memcpy(my_bat_set_plus_cpwd.oldpwd, oldpwd, my_bat_set_plus_cpwd.c_oldpwd); | |
722 my_bat_set_plus_cpwd.c_newpwd = strlen(newpwd); | |
723 memcpy(my_bat_set_plus_cpwd.newpwd, newpwd, my_bat_set_plus_cpwd.c_newpwd); | |
724 | |
725 bat_send(ati_bat_get_client(srcId), &cmd); | |
726 | |
727 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
728 } | |
729 #else /* OLD FUNCTION BODY */ | |
730 | |
731 TRACE_FUNCTION("setatPLusCPWD()"); | |
732 | |
733 ret = sAT_PlusCPWD((T_ACI_CMD_SRC)srcId, fac_num, oldpwd, newpwd); | |
734 if (ret EQ AT_CMPL) | |
735 { | |
736 return (ATI_CMPL); | |
737 } | |
738 else if (ret EQ AT_EXCT) | |
739 { | |
740 src_params->curAtCmd = AT_CMD_CPWD; | |
741 } | |
742 else | |
743 { | |
744 cmdCmeError(CME_ERR_Unknown); | |
745 } | |
746 return (map_aci_2_ati_rslt(ret)); | |
747 | |
748 #endif /* no FF_ATI_BAT*/ | |
749 } | |
750 | |
751 /* | |
752 +--------------------------------------------------------------------+ | |
753 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
754 | STATE : code ROUTINE : atPlusCUSD | | |
755 +--------------------------------------------------------------------+ | |
756 | |
757 PURPOSE : +CUSD Unstructured supplementary data | |
758 */ | |
759 GLOBAL T_ATI_RSLT setatPlusCUSD(char *cl, UBYTE srcId) | |
760 { | |
761 T_ACI_RETURN ret = AT_FAIL; | |
762 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
763 CHAR ussd [MAX_USSD_LEN] = {0x00}; | |
764 USHORT lenUssd = 0; | |
765 | |
766 #ifndef FF_ATI_BAT | |
767 T_ACI_USSD_DATA cvtdUssd; | |
768 T_ACI_USSD_DATA* p_cvtdUssd = NULL; | |
769 USHORT lenCvtdUssd = 0; | |
770 #endif | |
771 | |
772 SHORT dcs = ACI_NumParmNotPresent, | |
773 stat = ACI_NumParmNotPresent; | |
774 BOOL status_changed = FALSE; | |
775 | |
776 TRACE_FUNCTION("setatPlusCUSD()"); | |
777 | |
778 cl = parse(cl,"rzr", | |
779 &stat, | |
780 (LONG)MAX_USSD_LEN, | |
781 strlen(cl), | |
782 cl, | |
783 &lenUssd, | |
784 ussd, | |
785 &dcs); | |
786 | |
787 if(cl EQ NULL OR | |
788 stat > 2) | |
789 { | |
790 cmdCmeError(CME_ERR_OpNotAllow); | |
791 return (ATI_FAIL); | |
792 } | |
793 | |
794 if(stat EQ 2) | |
795 { | |
796 /* CANCEL ONGOING USSD OPERATION */ | |
797 ret = sAT_end_ussd((T_ACI_CMD_SRC)srcId); | |
798 } | |
799 else | |
800 { | |
801 if (dcs EQ 17 AND ati_user_output_cfg[srcId].cscsChset NEQ CSCS_CHSET_Ucs2) | |
802 { | |
803 cmdCmeError(CME_ERR_OpNotAllow); /* it makes no sense if TE<->MS is GSM7 but we talk to the Network | |
804 in UCS2 since afterwards we need to convert it back to GSM7 and | |
805 we will loose some characters */ | |
806 return (ATI_FAIL); | |
807 } | |
808 | |
809 if (stat NEQ ACI_NumParmNotPresent ) | |
810 { | |
811 /* SET CUSD Presentation Flag only for values stat 0 and 1 */ | |
812 ati_user_output_cfg[srcId].CUSD_stat = (UBYTE)stat; | |
813 status_changed = TRUE; | |
814 } | |
815 | |
816 if (dcs EQ ACI_NumParmNotPresent ) | |
817 { | |
818 /* GSM 03.38 [25] Cell Broadcast Data Coding Scheme in integer format (default 0) */ | |
819 dcs = 0; | |
820 } | |
821 | |
822 srcId_cb = srcId; | |
823 | |
824 #ifdef FF_ATI_BAT | |
825 | |
826 { | |
827 T_BAT_cmd_send cmd; | |
828 T_BAT_cmd_set_plus_cusd cusd; | |
829 | |
830 cmd.ctrl_params=BAT_CMD_SET_PLUS_CUSD; | |
831 cmd.params.ptr_set_plus_cusd=&cusd; | |
832 | |
833 /* | |
834 * This is the only possible value for 'n', as the other is | |
835 * dealt with further up this function. | |
836 */ | |
837 cusd.n=BAT_CUSD_N_NOT_PRESENT; | |
838 | |
839 /* | |
840 * Simplest thing to do is copy in as much data as the BAT | |
841 * structure can handle. If there is too much we won't | |
842 * overwrite memory. | |
843 */ | |
844 memcpy(cusd.str,ussd,BAT_MAX_USSD_LEN); | |
845 | |
846 /* | |
847 * Set the length. If there is too much data it will | |
848 * effectively be truncated. | |
849 */ | |
850 cusd.c_str=(U8)((lenUssd>BAT_MAX_USSD_LEN) ? BAT_MAX_USSD_LEN:lenUssd); | |
851 cusd.v_str=TRUE; | |
852 | |
853 cusd.dcs=(S16)dcs; | |
854 | |
855 bat_send(ati_bat_get_client(srcId), &cmd); | |
856 | |
857 src_params->curAtCmd=AT_CMD_CUSD; | |
858 | |
859 return(ATI_EXCT); | |
860 } | |
861 | |
862 #else /* no FF_ATI_BAT */ | |
863 | |
864 utl_ussdDtaFromTe ((UBYTE*)ussd, | |
865 lenUssd, | |
866 (UBYTE*)cvtdUssd.data, | |
867 &lenCvtdUssd, | |
868 #ifdef REL99 | |
869 sizeof(cvtdUssd.data), | |
870 #endif /* REL99 */ | |
871 (UBYTE)dcs); | |
872 | |
873 cvtdUssd.len = (UBYTE)lenCvtdUssd; | |
874 | |
875 if (cvtdUssd.len NEQ 0) | |
876 { | |
877 p_cvtdUssd=&cvtdUssd; | |
878 } | |
879 | |
880 if( p_cvtdUssd NEQ NULL ) | |
881 { | |
882 ret = sAT_PlusCUSD((T_ACI_CMD_SRC)srcId, p_cvtdUssd, dcs); | |
883 } | |
884 else | |
885 { | |
886 if (lenUssd NEQ 0) | |
887 { | |
888 cmdCmeError(CME_ERR_Unknown); | |
889 return (ATI_FAIL); | |
890 } | |
891 } | |
892 #endif /* no FF_ATI_BAT */ | |
893 | |
894 } | |
895 | |
896 if (ret EQ AT_CMPL) | |
897 { | |
898 return (ATI_CMPL); | |
899 } | |
900 else if (ret EQ AT_EXCT) | |
901 { | |
902 src_params->curAtCmd = AT_CMD_CUSD; | |
903 return (ATI_EXCT); | |
904 } | |
905 else if(status_changed) | |
906 { | |
907 return (ATI_CMPL); | |
908 } | |
909 | |
910 cmdCmeError(CME_ERR_Unknown); | |
911 return (ATI_FAIL); | |
912 } | |
913 | |
914 GLOBAL T_ATI_RSLT queatPlusCUSD(char *cl, UBYTE srcId) | |
915 { | |
916 TRACE_FUNCTION("queatPlusCUSD()"); | |
917 | |
918 resp_disp(srcId, cl,"b",&ati_user_output_cfg[srcId].CUSD_stat); | |
919 return (ATI_CMPL); | |
920 } | |
921 | |
922 #ifdef TI_PS_FF_AT_P_CMD_CSCN | |
923 /* | |
924 +--------------------------------------------------------------------+ | |
925 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
926 | STATE : code ROUTINE : atPercentCSCN | | |
927 +--------------------------------------------------------------------+ | |
928 | |
929 PURPOSE : %CSCN - network service change notifications | |
930 */ | |
931 GLOBAL T_ATI_RSLT setatPercentCSCN (char *cl, UBYTE srcId) | |
932 { | |
933 T_ACI_SS_CSCN_MOD_STATE ss_switch = SS_CSCN_MOD_STATE_INVALID; | |
934 T_ACI_SS_CSCN_MOD_DIRECTION ss_direction = SS_CSCN_MOD_DIR_INVALID; | |
935 T_ACI_CC_CSCN_MOD_STATE cc_switch = CC_CSCN_MOD_STATE_INVALID; | |
936 T_ACI_CC_CSCN_MOD_DIRECTION cc_direction = CC_CSCN_MOD_DIR_INVALID; | |
937 | |
938 TRACE_FUNCTION("setatPercentCSCN()"); | |
939 | |
940 if((cl EQ NULL) OR (*cl EQ '\0')) /* No parameter passed ?? */ | |
941 { | |
942 cmdCmeError(CME_ERR_OpNotAllow); | |
943 return (ATI_FAIL); | |
944 } | |
945 | |
946 cl = parse(cl,"dddd", &ss_switch, &ss_direction, &cc_switch, &cc_direction); | |
947 | |
948 /* valid parameter ?? */ | |
949 if( (ss_switch >= SS_CSCN_MOD_STATE_MAX) OR | |
950 (ss_direction >= SS_CSCN_MOD_DIR_MAX) OR | |
951 (cc_switch >= CC_CSCN_MOD_STATE_MAX) OR | |
952 (cc_direction >= CC_CSCN_MOD_DIR_MAX) ) | |
953 { | |
954 cmdCmeError(CME_ERR_OpNotAllow); | |
955 return (ATI_FAIL); | |
956 } | |
957 | |
958 if (sAT_PercentCSCN( (T_ACI_CMD_SRC)srcId, ss_switch, ss_direction, cc_switch, cc_direction ) NEQ AT_CMPL) | |
959 return (ATI_FAIL); | |
960 | |
961 return (ATI_CMPL); | |
962 } | |
963 | |
964 /* ------------------------------------------------------------------------- */ | |
965 GLOBAL T_ATI_RSLT queatPercentCSCN (char* cl, UBYTE srcId) | |
966 /* ------------------------------------------------------------------------- */ | |
967 { | |
968 T_ACI_SS_CSCN_MOD_STATE ss_switch; | |
969 T_ACI_SS_CSCN_MOD_DIRECTION ss_direction; | |
970 T_ACI_CC_CSCN_MOD_STATE cc_switch; | |
971 T_ACI_CC_CSCN_MOD_DIRECTION cc_direction; | |
972 | |
973 TRACE_FUNCTION("queatPercentCSCN()"); | |
974 | |
975 if (qAT_PercentCSCN( (T_ACI_CMD_SRC)srcId, &ss_switch, &ss_direction, &cc_switch, &cc_direction ) NEQ AT_CMPL) | |
976 return (ATI_FAIL); | |
977 | |
978 if( ss_switch EQ SS_CSCN_MOD_STATE_INVALID ) ss_switch = SS_CSCN_MOD_STATE_OFF; | |
979 if( ss_direction EQ SS_CSCN_MOD_DIR_INVALID ) ss_direction = SS_CSCN_MOD_DIR_IN; | |
980 if( cc_switch EQ CC_CSCN_MOD_STATE_INVALID ) cc_switch = CC_CSCN_MOD_STATE_OFF; | |
981 if( cc_direction EQ CC_CSCN_MOD_DIR_INVALID ) cc_direction = CC_CSCN_MOD_DIR_IN; | |
982 | |
983 resp_disp(srcId, cl, "ssss", &ss_switch, &ss_direction, &cc_switch, &cc_direction); | |
984 return (ATI_CMPL); | |
985 } | |
986 #endif /* TI_PS_FF_AT_P_CMD_CSCN */ | |
987 | |
988 #ifdef TI_PS_FF_AT_P_CMD_CUSDR | |
989 /* | |
990 +--------------------------------------------------------------------+ | |
991 | PROJECT : GSM-F&D (8411) MODULE : ACI_CMD | | |
992 | STATE : code ROUTINE : setatPercentCUSDR | | |
993 +--------------------------------------------------------------------+ | |
994 | |
995 PURPOSE : %CUSDR - Extended response for n/w initiated USSD. | |
996 */ | |
997 GLOBAL T_ATI_RSLT setatPercentCUSDR(char* cl, UBYTE srcId) | |
998 { | |
999 T_ACI_CUSDR_RES response; | |
1000 T_ACI_RETURN ret = AT_FAIL; | |
1001 | |
1002 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
1003 | |
1004 TRACE_FUNCTION("setatPercentCUSDR()"); | |
1005 | |
1006 cl = parse(cl,"d",&response); | |
1007 | |
1008 if(!cl) | |
1009 { | |
1010 cmdCmeError(CME_ERR_OpNotAllow); | |
1011 return (ATI_FAIL); | |
1012 } | |
1013 | |
1014 ret = sAT_PercentCUSDR((T_ACI_CMD_SRC)srcId, response); | |
1015 | |
1016 return (map_aci_2_ati_rslt(ret)); | |
1017 | |
1018 } | |
1019 #endif /* TI_PS_FF_AT_P_CMD_CUSDR */ | |
1020 | |
1021 | |
1022 #ifdef SIM_PERS | |
1023 | |
1024 /* ----------Added on 11/03/2005--------------------*/ | |
1025 /*-------------For %MEPD AT comand----------------- */ | |
1026 /* ------------------------------------------------------------------------- */ | |
1027 /* | |
1028 +------------------------------------------------------------------------------ | |
1029 | Function : setatPercentMEPD | |
1030 +------------------------------------------------------------------------------ | |
1031 | Description : For %MEPD= AT comand | |
1032 | | |
1033 | Parameters :char* cl | |
1034 | UBYTE srcId | |
1035 | | |
1036 | Return : ATI_FAIL - at command failed | |
1037 | ATI_FAIL_NO_OUTPUT - at command failed with no output | |
1038 | ATI_BUSY - ATI busy | |
1039 | ATI_EXCT - ATI is executing the command | |
1040 | ATI_CMPL - at command successfully executed | |
1041 | ATI_CMPL_NO_OUTPUT - at command successfully executed with no output | |
1042 | | |
1043 +------------------------------------------------------------------------------ | |
1044 */ | |
1045 GLOBAL T_ATI_RSLT setatPercentMEPD (char* cl, UBYTE srcId) | |
1046 { | |
1047 T_ACI_RETURN ret = AT_FAIL; | |
1048 char sup_info_str[4] = {0,0,0,0}; | |
1049 T_SUP_INFO_TYPE sup_info_num = CMEPD_SUP_INFO_NotPresent; | |
1050 T_SUP_INFO sup_info; /*return Value of MEPD CFG Data */ | |
1051 USHORT i; | |
1052 T_ATI_SRC_PARAMS *src_params = find_element (ati_src_list, srcId, search_ati_src_id); | |
1053 | |
1054 src_params->curAtCmd = AT_CMD_MEPD; | |
1055 TRACE_FUNCTION("setatPercentMEPD()"); | |
1056 | |
1057 /*input functionality*/ | |
1058 cl = parse (cl,"s",(LONG)4, sup_info_str); | |
1059 | |
1060 if ( !cl OR (sup_info_str[0] EQ 0)) | |
1061 { | |
1062 cmdCmeError (CME_ERR_OpNotAllow); | |
1063 return (ATI_FAIL); | |
1064 } | |
1065 | |
1066 strcpy(sup_info_str, strupper(sup_info_str)); | |
1067 for (i=0;mepd_sup_info[i].name NEQ 0; i++) | |
1068 { | |
1069 if (strcmp(mepd_sup_info[i].name, sup_info_str) EQ 0 ) | |
1070 { | |
1071 sup_info_num = mepd_sup_info[i].sup_info; /*translates facility string in facility number */ | |
1072 break; | |
1073 } | |
1074 } | |
1075 if (sup_info_num EQ CMEPD_SUP_INFO_NotPresent) /* facility non existent*/ | |
1076 { | |
1077 cmdCmeError(CME_ERR_OpNotAllow); | |
1078 return (ATI_FAIL); | |
1079 } | |
1080 | |
1081 sup_info.infoType=sup_info_num; | |
1082 | |
1083 #ifdef FF_ATI_BAT | |
1084 { | |
1085 T_BAT_cmd_send cmd; | |
1086 T_BAT_cmd_set_percent_mepd mepd; | |
1087 | |
1088 memset(&mepd, 0, sizeof(mepd)); | |
1089 cmd.ctrl_params = BAT_CMD_SET_PERCENT_MEPD; | |
1090 cmd.params.ptr_set_percent_mepd = &mepd; | |
1091 mepd.sup_info_type = (T_BAT_percent_mepd_sup_info)sup_info_num; | |
1092 | |
1093 bat_send(ati_bat_get_client(srcId), &cmd); | |
1094 | |
1095 return ATI_EXCT; /* executing, because response is passed by callback function */ | |
1096 } | |
1097 #else | |
1098 ret = qAT_PercentMEPD((T_ACI_CMD_SRC)srcId, &sup_info); | |
1099 if (ret EQ AT_CMPL) | |
1100 { | |
1101 resp_disp(srcId,cl,"b", &sup_info.datavalue); | |
1102 return (ATI_CMPL); | |
1103 } | |
1104 else | |
1105 { | |
1106 cmdCmeError(CME_ERR_OpNotAllow); | |
1107 return (ATI_FAIL); | |
1108 } | |
1109 #endif /* FF_ATI_BAT */ | |
1110 } | |
1111 | |
1112 #endif /* SIM_PERS */ | |
1113 #endif /* ATI_SS_C */ |