comparison src/g23m-aci/aci/aci_bat_mm.c @ 162:53929b40109c

src/g23m-aci: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2016 02:02:43 +0000
parents
children
comparison
equal deleted inserted replaced
161:4557e2a9c18e 162:53929b40109c
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_bat_cmh.h" /* prototypes of sBAT_,qBAT_,tBAT_ */
25
26 #ifdef FF_ATI_BAT
27 #include "typedefs.h"
28 #include "gdd.h"
29 #include "bat.h"
30 #include "aci_bat.h"
31 #endif /* FF_ATI_BAT */
32
33 /*
34 +--------------------------------------------------------------------+
35 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
36 | STATE : code ROUTINE : sBAT_PlusCOPS |
37 +--------------------------------------------------------------------+
38
39 PURPOSE :
40 */
41 #undef min
42 #define min(a,b) ((a) < (b) ? (a) : (b)) /* from gpf\inc\vcms */
43
44 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi,
45 T_BAT_cmd_send *cmd)
46 {
47 T_ACI_BAT_RSLT ret;
48
49 U8 c_oper = cmd->params.ptr_set_plus_cops->c_oper;
50 CHAR op[MAX_ALPHA_OPER_LEN] = {0};
51
52 TRACE_FUNCTION ("sBAT_PlusCOPS()");
53
54 c_oper = min(c_oper, MAX_ALPHA_OPER_LEN);
55
56 if (cmd->params.ptr_set_plus_cops->v_oper EQ TRUE)
57 memcpy(op, cmd->params.ptr_set_plus_cops->oper, c_oper);
58
59 ret =(T_ACI_BAT_RSLT) sAT_PlusCOPS ((T_ACI_CMD_SRC)src_infos_psi->srcId,
60 (T_ACI_COPS_MOD)cmd->params.ptr_set_plus_cops->mode,
61 (T_ACI_COPS_FRMT)cmd->params.ptr_set_plus_cops->format, op);
62 return(ret);
63 }
64
65 /*
66 +--------------------------------------------------------------------+
67 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
68 | STATE : code ROUTINE : qBAT_PlusCOPS |
69 +--------------------------------------------------------------------+
70
71 PURPOSE :
72 */
73 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi,
74 T_BAT_cmd_send *cmd)
75 {
76 T_ACI_BAT_RSLT ret;
77
78 CHAR op[MAX_ALPHA_OPER_LEN] = {0};
79
80 T_ACI_COPS_MOD mode = COPS_MOD_NotPresent;
81 T_ACI_COPS_FRMT format = COPS_FRMT_NotPresent;
82 T_BAT_cmd_response resp;
83 T_BAT_res_que_plus_cops cops;
84
85 TRACE_FUNCTION ("qBAT_PlusCOPS()");
86
87 resp.ctrl_response = BAT_RES_QUE_PLUS_COPS;
88 resp.response.ptr_que_plus_cops = &cops;
89
90 ret =(T_ACI_BAT_RSLT) qAT_PlusCOPS((T_ACI_CMD_SRC)src_infos_psi->srcId, &mode, &format, op);
91
92 cops.mode = (T_BAT_plus_cops_mode)mode;
93 cops.format = (T_BAT_plus_cops_format)format;
94 cops.c_oper = strlen(op);
95 cops.v_oper = cops.c_oper ? TRUE : FALSE;
96
97 if (cops.v_oper)
98 {
99 memcpy(cops.oper, op, cops.c_oper);
100 }
101 aci_bat_send(src_infos_psi, &resp);
102 return(ret);
103 }
104
105 /*
106 +--------------------------------------------------------------------+
107 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
108 | STATE : code ROUTINE : tBAT_PlusCOPS |
109 +--------------------------------------------------------------------+
110
111 PURPOSE :
112 */
113 GLOBAL T_ACI_BAT_RSLT tBAT_PlusCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi,
114 T_BAT_cmd_send *cmd)
115 {
116 T_ACI_BAT_RSLT ret;
117 T_ACI_COPS_LST operLst;
118 T_BAT_cmd_response resp;
119 T_BAT_res_tst_plus_cops *pTPC;
120
121 SHORT startIdx = 0, lastIdx = 0;
122 BOOL END_OF_LIST = FALSE;
123
124 TRACE_FUNCTION ("tBAT_PlusCOPS()");
125
126 memset(&resp, 0x00, sizeof(T_BAT_cmd_response));
127 pTPC = resp.response.ptr_tst_plus_cops;
128 resp.ctrl_response = BAT_RES_TST_PERCENT_COPS;
129
130 do
131 {
132 int i;
133
134 startIdx += lastIdx;
135 ret =(T_ACI_BAT_RSLT) tAT_PlusCOPS((T_ACI_CMD_SRC)src_infos_psi->srcId, startIdx, &lastIdx, &operLst[0]);
136 if (ret NEQ ACI_BAT_CMPL)
137 return (ret);
138
139 for (i = 0; i < lastIdx; i++)
140 {
141 if ((operLst[i].status EQ COPS_STAT_NotPresent) AND (*operLst[i].numOper EQ 0))
142 {
143 END_OF_LIST = TRUE;
144 break;
145 }
146 /* Fill BAT resp structs */
147 pTPC->status = (T_BAT_plus_cops_status)operLst[i].status;
148 pTPC->c_short_oper = strlen(operLst[i].shortOper);
149 pTPC->c_long_oper = strlen(operLst[i].longOper);
150 pTPC->c_num_oper = strlen(operLst[i].numOper);
151
152 /* Check if there is long operator name, set valid flag and store it. */
153 if(pTPC->c_long_oper)
154 {
155 pTPC->v_long_oper = TRUE;
156 strncpy((CHAR*)pTPC->long_oper, operLst[i].longOper, pTPC->c_long_oper);
157 }
158
159 /* Check if there is short operator name, set valid flag and store it. */
160 if(pTPC->c_short_oper)
161 {
162 pTPC->v_short_oper = TRUE;
163 strncpy((CHAR*)pTPC->short_oper, operLst[i].shortOper, pTPC->c_short_oper);
164 }
165
166 /* Check if there is num operator name, set valid flag and store it. */
167 if(pTPC->c_num_oper)
168 {
169 pTPC->v_num_oper = TRUE;
170 strncpy((CHAR*)pTPC->num_oper, operLst[i].numOper, pTPC->c_num_oper);
171 }
172
173 aci_bat_send(src_infos_psi, &resp);
174 }
175 return (ACI_BAT_CMPL);
176 } while(!END_OF_LIST);
177 }
178
179 /*
180 +--------------------------------------------------------------------+
181 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
182 | STATE : code ROUTINE : sBAT_PercentCOPS |
183 +--------------------------------------------------------------------+
184
185 PURPOSE :
186 */
187 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi,
188 T_BAT_cmd_send *cmd)
189 {
190 T_ACI_BAT_RSLT ret;
191
192 U8 c_oper = cmd->params.ptr_set_percent_cops->c_oper;
193 CHAR op[MAX_ALPHA_OPER_LEN] = {0};
194
195 TRACE_FUNCTION ("sBAT_PercentCOPS()");
196
197 c_oper = min(c_oper, MAX_ALPHA_OPER_LEN);
198
199 if (cmd->params.ptr_set_percent_cops->v_oper EQ TRUE)
200 memcpy(op, cmd->params.ptr_set_percent_cops->oper, c_oper);
201
202 ret =(T_ACI_BAT_RSLT) sAT_PercentCOPS ((T_ACI_CMD_SRC)src_infos_psi->srcId,
203 (T_ACI_COPS_MOD)cmd->params.ptr_set_percent_cops->mode,
204 (T_ACI_COPS_FRMT)cmd->params.ptr_set_percent_cops->format, op);
205 return(ret);
206 }
207
208 /*
209 +--------------------------------------------------------------------+
210 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
211 | STATE : code ROUTINE : tBAT_PercentCOPS |
212 +--------------------------------------------------------------------+
213
214 PURPOSE :
215 */
216 GLOBAL T_ACI_BAT_RSLT tBAT_PercentCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi,
217 T_BAT_cmd_send *cmd)
218 {
219 T_ACI_BAT_RSLT ret;
220 T_ACI_COPS_LST operLst;
221 T_BAT_cmd_response resp;
222 T_BAT_res_tst_percent_cops cops;
223
224 SHORT startIdx = 0, lastIdx = 0;
225 BOOL END_OF_LIST = FALSE;
226
227 TRACE_FUNCTION ("tBAT_PercentCOPS()");
228
229 resp.ctrl_response = BAT_RES_TST_PERCENT_COPS;
230 resp.response.ptr_tst_percent_cops = &cops;
231
232 do
233 {
234 int i;
235
236 startIdx += lastIdx;
237 ret =(T_ACI_BAT_RSLT) tAT_PlusCOPS((T_ACI_CMD_SRC)src_infos_psi->srcId, startIdx, &lastIdx, &operLst[0]);
238 if (ret NEQ ACI_BAT_CMPL)
239 return (ret);
240
241 for (i = 0; i < lastIdx; i++)
242 {
243 if ((operLst[i].status EQ COPS_STAT_NotPresent) AND (*operLst[i].numOper EQ 0))
244 {
245 END_OF_LIST = TRUE;
246 break;
247 }
248 /* Fill BAT resp structs */
249 cops.status = (T_BAT_percent_cops_status)operLst[i].status;
250 cops.c_short_oper = strlen(operLst[i].shortOper);
251 cops.c_long_oper = strlen(operLst[i].longOper);
252 cops.c_num_oper = strlen(operLst[i].numOper);
253
254 /* Check if there is long operator name, set valid flag and store it. */
255 if(cops.c_long_oper)
256 {
257 cops.v_long_oper = TRUE;
258 strncpy((CHAR*)cops.long_oper, operLst[i].longOper, cops.c_long_oper);
259 }
260
261 /* Check if there is short operator name, set valid flag and store it. */
262 if(cops.c_short_oper)
263 {
264 cops.v_short_oper = TRUE;
265 strncpy((CHAR*)cops.short_oper, operLst[i].shortOper, cops.c_short_oper);
266 }
267
268 /* Check if there is num operator name, set valid flag and store it. */
269 if(cops.c_num_oper)
270 {
271 cops.v_num_oper = TRUE;
272 strncpy((CHAR*)cops.num_oper, operLst[i].numOper, cops.c_num_oper);
273 }
274
275 aci_bat_send(src_infos_psi, &resp);
276 }
277 return (ACI_BAT_CMPL);
278 } while(!END_OF_LIST);
279 }
280
281 /*
282 +--------------------------------------------------------------------+
283 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
284 | STATE : code ROUTINE : qBAT_PercentCOPS |
285 +--------------------------------------------------------------------+
286
287 PURPOSE :
288 */
289 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi,
290 T_BAT_cmd_send *cmd)
291 {
292 T_ACI_BAT_RSLT ret;
293
294 CHAR op[MAX_ALPHA_OPER_LEN] = {0};
295
296 T_ACI_COPS_MOD mode = COPS_MOD_NotPresent;
297 T_ACI_COPS_FRMT format = COPS_FRMT_NotPresent;
298 T_ACI_COPS_SVST svrStatus = COPS_SVST_NotPresent;
299 T_BAT_cmd_response resp;
300 T_BAT_res_que_percent_cops cops;
301
302 TRACE_FUNCTION ("qBAT_PercentCOPS()");
303
304 resp.ctrl_response = BAT_RES_QUE_PERCENT_COPS;
305 resp.response.ptr_que_percent_cops = &cops;
306
307 ret =(T_ACI_BAT_RSLT) qAT_PercentCOPS((T_ACI_CMD_SRC)src_infos_psi->srcId, &mode, &format, &svrStatus, op);
308
309 cops.mode = (T_BAT_percent_cops_mode)mode;
310 cops.format = (T_BAT_percent_cops_format)format;
311 cops.service = (T_BAT_percent_cops_service)svrStatus;
312 cops.c_oper = strlen(op);
313 cops.v_oper = cops.c_oper ? TRUE : FALSE;
314
315 if (cops.v_oper)
316 {
317 memcpy(cops.oper, op, cops.c_oper);
318 }
319 aci_bat_send(src_infos_psi, &resp);
320 return(ret);
321 }
322
323 /*
324 +--------------------------------------------------------------------+
325 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
326 | STATE : code ROUTINE : qBAT_PercentCREG |
327 +--------------------------------------------------------------------+
328
329 PURPOSE :
330 */
331 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCREG(T_ACI_DTI_PRC_PSI *src_infos_psi,
332 T_BAT_cmd_send *cmd)
333 {
334 T_ACI_BAT_RSLT ret;
335 T_BAT_cmd_response resp;
336 T_BAT_res_que_percent_creg creg;
337
338 TRACE_FUNCTION ("qBAT_PercentCREG()");
339
340 resp.ctrl_response = BAT_RES_QUE_PERCENT_CREG;
341 resp.response.ptr_que_percent_creg = &creg;
342
343 ret =(T_ACI_BAT_RSLT) qAT_PercentCREG((T_ACI_CMD_SRC)src_infos_psi->srcId,
344 (T_ACI_CREG_STAT*)&creg.stat,
345 (USHORT*)&creg.lac,
346 (USHORT*)&creg.ci,
347 (T_ACI_P_CREG_GPRS_IND*)&creg.gprs_ind,
348 (U8*)&creg.rt);
349
350 aci_bat_send(src_infos_psi, &resp);
351 return(ret);
352 }
353
354 #ifdef TI_PS_FF_AT_CMD_WS46
355 /*
356 +--------------------------------------------------------------------+
357 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
358 | STATE : code ROUTINE : sBAT_PlusWS46 |
359 +--------------------------------------------------------------------+
360
361 PURPOSE :
362 */
363 GLOBAL T_ACI_BAT_RSLT sBAT_PlusWS46(T_ACI_DTI_PRC_PSI *src_infos_psi,
364 T_BAT_cmd_send *cmd)
365 {
366 T_ACI_BAT_RSLT ret;
367 T_BAT_plus_ws46_n mode = cmd->params.ptr_set_plus_ws46->n;
368
369 TRACE_FUNCTION ("sBAT_PlusWS46()");
370
371 ret =(T_ACI_BAT_RSLT) sAT_PlusWS46((T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_WS46_MOD)mode);
372 return(ret);
373 }
374
375 /*
376 +--------------------------------------------------------------------+
377 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
378 | STATE : code ROUTINE : qBAT_PlusWS46 |
379 +--------------------------------------------------------------------+
380
381 PURPOSE :
382 */
383 GLOBAL T_ACI_BAT_RSLT qBAT_PlusWS46(T_ACI_DTI_PRC_PSI *src_infos_psi,
384 T_BAT_cmd_send *cmd)
385 {
386 T_ACI_BAT_RSLT ret;
387 T_BAT_cmd_response resp;
388 T_BAT_res_que_plus_ws46 ws46;
389
390 TRACE_FUNCTION ("qBAT_PlusWS46()");
391
392 resp.ctrl_response = BAT_RES_QUE_PLUS_WS46;
393 resp.response.ptr_que_plus_ws46 = &ws46;
394
395 ret = (T_ACI_BAT_RSLT) qAT_PlusWS46((T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_WS46_MOD *)&ws46.n);
396
397 aci_bat_send(src_infos_psi, &resp);
398 return(ret);
399 }
400 #endif /* TI_PS_FF_AT_CMD_WS46 */
401 /*
402 +--------------------------------------------------------------------+
403 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
404 | STATE : code ROUTINE : sBAT_PercentCHPL |
405 +--------------------------------------------------------------------+
406
407 PURPOSE :
408 */
409 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCHPL(T_ACI_DTI_PRC_PSI *src_infos_psi,
410 T_BAT_cmd_send *cmd)
411 {
412 T_ACI_BAT_RSLT ret;
413 T_ACI_OPER_NTRY oper;
414 UBYTE len;
415
416 TRACE_FUNCTION ("sBAT_PercentCHPL()");
417
418 /*
419 * Call the corresponding ACI function. T_ACI_BAT_RSLT is
420 * assumed to be equivalent to T_ACI_RESULT.
421 */
422 ret=(T_ACI_BAT_RSLT)sAT_PercentCHPL((T_ACI_CMD_SRC) src_infos_psi->srcId,&oper);
423
424 /*
425 * If the command completes, we must send a response.
426 */
427 if (ret==ACI_BAT_CMPL)
428 {
429 T_BAT_cmd_response resp;
430 T_BAT_res_set_percent_chpl chpl_data;
431
432 resp.ctrl_response=BAT_RES_SET_PERCENT_CHPL;
433 resp.response.ptr_set_percent_chpl=&chpl_data;
434
435 chpl_data.type=BAT_P_CHPL_TYPE_FROM_IMS;
436
437 switch (cmd->params.ptr_set_percent_chpl->oprfrmt)
438 {
439 case BAT_P_CHPL_OPRFRMT_LONG:
440 len=strlen(oper.longName);
441
442 if (len<=BAT_MAX_CHPL_OPER_LEN)
443 {
444 memcpy(chpl_data.oper,oper.longName,len);
445 chpl_data.c_oper=(U8)len;
446 }
447 else
448 {
449 return(ACI_BAT_FAIL);
450 }
451 break;
452
453 case BAT_P_CHPL_OPRFRMT_SHORT:
454 len=strlen(oper.shrtName);
455
456 if (len<=BAT_MAX_CHPL_OPER_LEN)
457 {
458 memcpy(chpl_data.oper,oper.shrtName,len);
459 chpl_data.c_oper=(U8)len;
460 }
461 else
462 {
463 return(ACI_BAT_FAIL);
464 }
465 break;
466
467 case BAT_P_CHPL_OPRFRMT_NUMERIC:
468 /*
469 * Representation of the numeric format as in the ATI.
470 */
471 if ((oper.mnc & 0x00F)==0xF)
472 sprintf((char *)chpl_data.oper, "%03x,%02x",oper.mcc, oper.mnc >> 4);
473 else
474 sprintf((char *)chpl_data.oper, "%03x,%03x",oper.mcc, oper.mnc);
475
476 chpl_data.c_oper=(U8)strlen((char *)chpl_data.oper);
477 break;
478
479 default:
480 return(ACI_BAT_FAIL);
481 }
482
483 aci_bat_send(src_infos_psi,&resp);
484 }
485
486 return(ret);
487 }
488
489 /*
490 +--------------------------------------------------------------------+
491 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
492 | STATE : code ROUTINE : sBAT_PlusCTZU |
493 +--------------------------------------------------------------------+
494
495 PURPOSE :
496 */
497 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCTZU(T_ACI_DTI_PRC_PSI *src_infos_psi,
498 T_BAT_cmd_send *cmd)
499 {
500 T_ACI_BAT_RSLT ret;
501
502 TRACE_FUNCTION ("sBAT_PlusCTZU()");
503
504 ret =(T_ACI_BAT_RSLT) sAT_PlusCTZU ((T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_CTZU_MODE)cmd->params.ptr_set_plus_ctzu->onoff);
505 return(ret);
506 }
507
508 /*
509 +--------------------------------------------------------------------+
510 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
511 | STATE : code ROUTINE : qBAT_PlusCTZU |
512 +--------------------------------------------------------------------+
513
514 PURPOSE :
515 */
516 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCTZU(T_ACI_DTI_PRC_PSI *src_infos_psi,
517 T_BAT_cmd_send *cmd)
518 {
519 T_ACI_BAT_RSLT ret;
520
521 T_BAT_cmd_response resp;
522 T_BAT_res_que_plus_ctzu ctzu;
523
524 TRACE_FUNCTION ("qBAT_PlusCTZU()");
525
526 resp.ctrl_response = BAT_RES_QUE_PLUS_CTZU;
527 resp.response.ptr_que_plus_ctzu = &ctzu;
528 ret =(T_ACI_BAT_RSLT) qAT_PlusCTZU((T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_CTZU_MODE*)&ctzu.onoff);
529
530 aci_bat_send(src_infos_psi, &resp);
531 return(ret);
532 }
533
534 /*
535 +--------------------------------------------------------------------+
536 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
537 | STATE : code ROUTINE : sBAT_PercentCWUP |
538 +--------------------------------------------------------------------+
539
540 PURPOSE :
541 */
542 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCWUP(T_ACI_DTI_PRC_PSI *src_infos_psi,
543 T_BAT_cmd_send *cmd)
544 {
545 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
546
547 TRACE_FUNCTION ("sBAT_PercentCWUP()");
548
549 ret =(T_ACI_BAT_RSLT) sAT_PercentCWUP ((T_ACI_CMD_SRC)src_infos_psi->srcId,(T_ACI_CWUP_TYPE)cmd->params.ptr_set_percent_cwup->type);
550 return(ret);
551 }
552
553 /*
554 +--------------------------------------------------------------------+
555 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
556 | STATE : code ROUTINE : sBAT_PercentCTZV |
557 +--------------------------------------------------------------------+
558
559 PURPOSE : %CTZV command mode (time and date report)
560 */
561 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCTZV (T_ACI_DTI_PRC_PSI *src_infos_psi,
562 T_BAT_cmd_send *cmd)
563 {
564 T_ACI_BAT_RSLT ret;
565
566 TRACE_FUNCTION ("sBAT_PercentCTZV()");
567
568 ret =(T_ACI_BAT_RSLT) sAT_PercentCTZV ((T_ACI_CMD_SRC)src_infos_psi->srcId,
569 (T_ACI_PCTZV_MODE)cmd->params.ptr_set_percent_ctzv->mode);
570 return(ret);
571 }
572
573 /*
574 +--------------------------------------------------------------------+
575 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
576 | STATE : code ROUTINE : sBAT_PercentCNIV |
577 +--------------------------------------------------------------------+
578
579 PURPOSE : %CNIV set command mode (Network name report)
580 */
581 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCNIV (T_ACI_DTI_PRC_PSI *src_infos_psi,
582 T_BAT_cmd_send *cmd)
583 {
584 T_ACI_BAT_RSLT ret;
585
586 TRACE_FUNCTION ("sBAT_PercentCNIV()");
587
588 ret =(T_ACI_BAT_RSLT) sAT_PercentCNIV ((T_ACI_CMD_SRC)src_infos_psi->srcId,
589 (T_ACI_CNIV_MODE)cmd->params.ptr_set_percent_cniv->mode);
590 return(ret);
591 }
592
593 /*
594 +--------------------------------------------------------------------+
595 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
596 | STATE : code ROUTINE : qBAT_PercentCNIV |
597 +--------------------------------------------------------------------+
598
599 PURPOSE : %CNIV query command mode
600 */
601 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCNIV (T_ACI_DTI_PRC_PSI *src_infos_psi,
602 T_BAT_cmd_send *cmd)
603 {
604 T_ACI_BAT_RSLT ret;
605
606 T_BAT_cmd_response resp;
607 T_BAT_res_que_percent_cniv cniv;
608
609 TRACE_FUNCTION ("qBAT_PercentCNIV()");
610
611 resp.ctrl_response = BAT_RES_QUE_PERCENT_CNIV;
612 resp.response.ptr_que_percent_cniv = &cniv;
613
614 ret =(T_ACI_BAT_RSLT) qAT_PercentCNIV ((T_ACI_CMD_SRC)src_infos_psi->srcId,
615 (T_ACI_CNIV_MODE*)&cniv.mode);
616
617 aci_bat_send(src_infos_psi, &resp);
618 return(ret);
619 }
620
621 /*
622 +--------------------------------------------------------------------+
623 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
624 | STATE : code ROUTINE : sBAT_PlusCIND |
625 +--------------------------------------------------------------------+
626
627 PURPOSE :
628 */
629 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCIND(T_ACI_DTI_PRC_PSI *src_infos_psi,
630 T_BAT_cmd_send *cmd)
631 {
632 T_ACI_BAT_RSLT ret;
633
634 TRACE_FUNCTION ("sBAT_PlusCIND()");
635
636 ret =(T_ACI_BAT_RSLT) sAT_PlusCIND((T_ACI_CMD_SRC)src_infos_psi->srcId,
637 (T_ACI_CIND_SIGNAL_TYPE)cmd->params.ptr_set_plus_cind->signal_ctrl,
638 (T_ACI_CIND_SMSFULL_TYPE)cmd->params.ptr_set_plus_cind->smsfull_ctrl);
639 return(ret);
640 }
641
642 /*
643 +--------------------------------------------------------------------+
644 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
645 | STATE : code ROUTINE : qBAT_PlusCIND |
646 +--------------------------------------------------------------------+
647
648 PURPOSE :
649 */
650 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCIND(T_ACI_DTI_PRC_PSI *src_infos_psi,
651 T_BAT_cmd_send *cmd)
652 {
653 T_ACI_BAT_RSLT ret;
654
655 T_BAT_cmd_response resp;
656 T_BAT_res_que_plus_cind cind;
657
658 TRACE_FUNCTION ("qBAT_PlusCIND()");
659
660 resp.ctrl_response = BAT_RES_QUE_PLUS_CIND;
661 resp.response.ptr_que_plus_cind = &cind;
662
663 ret = (T_ACI_BAT_RSLT)qAT_PlusCIND((T_ACI_CMD_SRC)src_infos_psi->srcId,
664 (T_ACI_CIND_SIGNAL_TYPE*)&cind.signal,
665 (T_ACI_CIND_SMSFULL_TYPE*)&cind.smsfull);
666
667 aci_bat_send(src_infos_psi, &resp);
668 return(ret);
669 }
670
671 /*
672 +--------------------------------------------------------------------+
673 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
674 | STATE : code ROUTINE : sBAT_PlusCMER |
675 +--------------------------------------------------------------------+
676
677 PURPOSE :
678 */
679 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMER(T_ACI_DTI_PRC_PSI *src_infos_psi,
680 T_BAT_cmd_send *cmd)
681 {
682 T_ACI_BAT_RSLT ret;
683
684 T_ACI_CMER_MODE_TYPE sCmerModeSettings = CMER_MODE_INVALID;
685 T_ACI_CMER_IND_TYPE sCmerIndicationSettings = CMER_INDICATOR_INVALID;
686 T_ACI_CMER_BFR_TYPE sCmerBfrSettings = CMER_BFR_INVALID;
687
688 TRACE_FUNCTION ("sBAT_PlusCMER()");
689
690 switch (cmd->params.ptr_set_plus_cmer->ind_option)
691 {
692 case BAT_CMER_IND_OPTION_LOWER:
693 ret =(T_ACI_BAT_RSLT) sAT_PlusCMER((T_ACI_CMD_SRC)src_infos_psi->srcId,
694 sCmerModeSettings,
695 sCmerIndicationSettings,
696 sCmerBfrSettings);
697 break;
698
699 case BAT_CMER_IND_OPTION_GREATER_EQUAL:
700 ret = (T_ACI_BAT_RSLT)sAT_PlusCMER((T_ACI_CMD_SRC)src_infos_psi->srcId,
701 sCmerModeSettings,
702 sCmerIndicationSettings,
703 sCmerBfrSettings);
704 break;
705
706 case BAT_CMER_IND_OPTION_NOT_PRESENT:
707 default:
708 return ACI_BAT_FAIL;
709 }
710 return(ret);
711 }
712
713 /*
714 +--------------------------------------------------------------------+
715 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
716 | STATE : code ROUTINE : qBAT_PlusCMER |
717 +--------------------------------------------------------------------+
718
719 PURPOSE :
720 */
721 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCMER(T_ACI_DTI_PRC_PSI *src_infos_psi,
722 T_BAT_cmd_send *cmd)
723 {
724 T_ACI_BAT_RSLT ret;
725 T_BAT_cmd_response resp;
726 T_BAT_res_que_plus_cmer cmer;
727
728 T_ACI_CMER_MODE_TYPE sCmerModeSettings;
729 T_ACI_CMER_IND_TYPE sCmerIndicationSettings;
730 T_ACI_CMER_BFR_TYPE sCmerBfrSettings;
731
732 TRACE_FUNCTION ("qBAT_PlusCMER()");
733
734 resp.ctrl_response = BAT_RES_QUE_PLUS_CMER;
735 resp.response.ptr_que_plus_cmer = &cmer;
736
737 ret =(T_ACI_BAT_RSLT) qAT_PlusCMER((T_ACI_CMD_SRC)src_infos_psi->srcId,
738 &sCmerModeSettings,
739 &sCmerIndicationSettings,
740 &sCmerBfrSettings);
741
742 switch (cmd->params.ptr_que_plus_cmer->bat_dummy)
743 {
744 default:
745 break;
746 }
747 aci_bat_send(src_infos_psi, &resp);
748 return(ret);
749 }
750