FreeCalypso > hg > leo2moko-debug
comparison g23m/condat/ms/src/aci/aci_bat_mm.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
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 = sAT_PlusCOPS (src_infos_psi->srcId, | |
60 cmd->params.ptr_set_plus_cops->mode, | |
61 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 = qAT_PlusCOPS(src_infos_psi->srcId, &mode, &format, op); | |
91 | |
92 cops.mode = mode; | |
93 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 = {0}; | |
119 T_BAT_res_tst_plus_cops *pTPC = resp.response.ptr_tst_plus_cops; | |
120 | |
121 SHORT startIdx = 0, lastIdx = 0; | |
122 BOOL END_OF_LIST = FALSE; | |
123 | |
124 TRACE_FUNCTION ("tBAT_PlusCOPS()"); | |
125 | |
126 resp.ctrl_response = BAT_RES_TST_PERCENT_COPS; | |
127 | |
128 do | |
129 { | |
130 int i; | |
131 | |
132 startIdx += lastIdx; | |
133 ret = tAT_PlusCOPS(src_infos_psi->srcId, startIdx, &lastIdx, &operLst[0]); | |
134 if (ret NEQ ACI_BAT_CMPL) | |
135 return (ret); | |
136 | |
137 for (i = 0; i < lastIdx; i++) | |
138 { | |
139 if ((operLst[i].status EQ COPS_STAT_NotPresent) AND (*operLst[i].numOper EQ 0)) | |
140 { | |
141 END_OF_LIST = TRUE; | |
142 break; | |
143 } | |
144 /* Fill BAT resp structs */ | |
145 pTPC->status = operLst[i].status; | |
146 pTPC->c_short_oper = strlen(operLst[i].shortOper); | |
147 pTPC->c_long_oper = strlen(operLst[i].longOper); | |
148 pTPC->c_num_oper = strlen(operLst[i].numOper); | |
149 | |
150 /* Check if there is long operator name, set valid flag and store it. */ | |
151 if(pTPC->c_long_oper) | |
152 { | |
153 pTPC->v_long_oper = TRUE; | |
154 strncpy((CHAR*)pTPC->long_oper, operLst[i].longOper, pTPC->c_long_oper); | |
155 } | |
156 | |
157 /* Check if there is short operator name, set valid flag and store it. */ | |
158 if(pTPC->c_short_oper) | |
159 { | |
160 pTPC->v_short_oper = TRUE; | |
161 strncpy((CHAR*)pTPC->short_oper, operLst[i].shortOper, pTPC->c_short_oper); | |
162 } | |
163 | |
164 /* Check if there is num operator name, set valid flag and store it. */ | |
165 if(pTPC->c_num_oper) | |
166 { | |
167 pTPC->v_num_oper = TRUE; | |
168 strncpy((CHAR*)pTPC->num_oper, operLst[i].numOper, pTPC->c_num_oper); | |
169 } | |
170 | |
171 aci_bat_send(src_infos_psi, &resp); | |
172 } | |
173 return (ACI_BAT_CMPL); | |
174 } while(!END_OF_LIST); | |
175 } | |
176 | |
177 /* | |
178 +--------------------------------------------------------------------+ | |
179 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
180 | STATE : code ROUTINE : sBAT_PercentCOPS | | |
181 +--------------------------------------------------------------------+ | |
182 | |
183 PURPOSE : | |
184 */ | |
185 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
186 T_BAT_cmd_send *cmd) | |
187 { | |
188 T_ACI_BAT_RSLT ret; | |
189 | |
190 U8 c_oper = cmd->params.ptr_set_percent_cops->c_oper; | |
191 CHAR op[MAX_ALPHA_OPER_LEN] = {0}; | |
192 | |
193 TRACE_FUNCTION ("sBAT_PercentCOPS()"); | |
194 | |
195 c_oper = min(c_oper, MAX_ALPHA_OPER_LEN); | |
196 | |
197 if (cmd->params.ptr_set_percent_cops->v_oper EQ TRUE) | |
198 memcpy(op, cmd->params.ptr_set_percent_cops->oper, c_oper); | |
199 | |
200 ret = sAT_PercentCOPS (src_infos_psi->srcId, | |
201 cmd->params.ptr_set_percent_cops->mode, | |
202 cmd->params.ptr_set_percent_cops->format, op); | |
203 return(ret); | |
204 } | |
205 | |
206 /* | |
207 +--------------------------------------------------------------------+ | |
208 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
209 | STATE : code ROUTINE : tBAT_PercentCOPS | | |
210 +--------------------------------------------------------------------+ | |
211 | |
212 PURPOSE : | |
213 */ | |
214 GLOBAL T_ACI_BAT_RSLT tBAT_PercentCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
215 T_BAT_cmd_send *cmd) | |
216 { | |
217 T_ACI_BAT_RSLT ret; | |
218 T_ACI_COPS_LST operLst; | |
219 T_BAT_cmd_response resp = {0}; | |
220 T_BAT_res_tst_percent_cops *pTPC = resp.response.ptr_tst_percent_cops; | |
221 | |
222 SHORT startIdx = 0, lastIdx = 0; | |
223 BOOL END_OF_LIST = FALSE; | |
224 | |
225 TRACE_FUNCTION ("tBAT_PercentCOPS()"); | |
226 | |
227 resp.ctrl_response = BAT_RES_TST_PERCENT_COPS; | |
228 | |
229 do | |
230 { | |
231 int i; | |
232 | |
233 startIdx += lastIdx; | |
234 ret = tAT_PlusCOPS(src_infos_psi->srcId, startIdx, &lastIdx, &operLst[0]); | |
235 if (ret NEQ ACI_BAT_CMPL) | |
236 return (ret); | |
237 | |
238 for (i = 0; i < lastIdx; i++) | |
239 { | |
240 if ((operLst[i].status EQ COPS_STAT_NotPresent) AND (*operLst[i].numOper EQ 0)) | |
241 { | |
242 END_OF_LIST = TRUE; | |
243 break; | |
244 } | |
245 /* Fill BAT resp structs */ | |
246 pTPC->status = operLst[i].status; | |
247 pTPC->c_short_oper = strlen(operLst[i].shortOper); | |
248 pTPC->c_long_oper = strlen(operLst[i].longOper); | |
249 pTPC->c_num_oper = strlen(operLst[i].numOper); | |
250 | |
251 /* Check if there is long operator name, set valid flag and store it. */ | |
252 if(pTPC->c_long_oper) | |
253 { | |
254 pTPC->v_long_oper = TRUE; | |
255 strncpy((CHAR*)pTPC->long_oper, operLst[i].longOper, pTPC->c_long_oper); | |
256 } | |
257 | |
258 /* Check if there is short operator name, set valid flag and store it. */ | |
259 if(pTPC->c_short_oper) | |
260 { | |
261 pTPC->v_short_oper = TRUE; | |
262 strncpy((CHAR*)pTPC->short_oper, operLst[i].shortOper, pTPC->c_short_oper); | |
263 } | |
264 | |
265 /* Check if there is num operator name, set valid flag and store it. */ | |
266 if(pTPC->c_num_oper) | |
267 { | |
268 pTPC->v_num_oper = TRUE; | |
269 strncpy((CHAR*)pTPC->num_oper, operLst[i].numOper, pTPC->c_num_oper); | |
270 } | |
271 | |
272 aci_bat_send(src_infos_psi, &resp); | |
273 } | |
274 return (ACI_BAT_CMPL); | |
275 } while(!END_OF_LIST); | |
276 } | |
277 | |
278 /* | |
279 +--------------------------------------------------------------------+ | |
280 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
281 | STATE : code ROUTINE : qBAT_PercentCOPS | | |
282 +--------------------------------------------------------------------+ | |
283 | |
284 PURPOSE : | |
285 */ | |
286 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCOPS(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
287 T_BAT_cmd_send *cmd) | |
288 { | |
289 T_ACI_BAT_RSLT ret; | |
290 | |
291 CHAR op[MAX_ALPHA_OPER_LEN] = {0}; | |
292 | |
293 T_ACI_COPS_MOD mode = COPS_MOD_NotPresent; | |
294 T_ACI_COPS_FRMT format = COPS_FRMT_NotPresent; | |
295 T_ACI_COPS_SVST svrStatus = COPS_SVST_NotPresent; | |
296 T_BAT_cmd_response resp; | |
297 T_BAT_res_que_percent_cops cops; | |
298 | |
299 TRACE_FUNCTION ("qBAT_PercentCOPS()"); | |
300 | |
301 resp.ctrl_response = BAT_RES_QUE_PERCENT_COPS; | |
302 resp.response.ptr_que_percent_cops = &cops; | |
303 | |
304 ret = qAT_PercentCOPS(src_infos_psi->srcId, &mode, &format, &svrStatus, op); | |
305 | |
306 cops.mode = mode; | |
307 cops.format = format; | |
308 cops.service = svrStatus; | |
309 cops.c_oper = strlen(op); | |
310 cops.v_oper = cops.c_oper ? TRUE : FALSE; | |
311 | |
312 if (cops.v_oper) | |
313 { | |
314 memcpy(cops.oper, op, cops.c_oper); | |
315 } | |
316 aci_bat_send(src_infos_psi, &resp); | |
317 return(ret); | |
318 } | |
319 | |
320 /* | |
321 +--------------------------------------------------------------------+ | |
322 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
323 | STATE : code ROUTINE : qBAT_PercentCREG | | |
324 +--------------------------------------------------------------------+ | |
325 | |
326 PURPOSE : | |
327 */ | |
328 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCREG(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
329 T_BAT_cmd_send *cmd) | |
330 { | |
331 T_ACI_BAT_RSLT ret; | |
332 T_BAT_cmd_response resp; | |
333 T_BAT_res_que_percent_creg creg; | |
334 | |
335 TRACE_FUNCTION ("qBAT_PercentCREG()"); | |
336 | |
337 resp.ctrl_response = BAT_RES_QUE_PERCENT_CREG; | |
338 resp.response.ptr_que_percent_creg = &creg; | |
339 | |
340 ret = qAT_PercentCREG(src_infos_psi->srcId, | |
341 (T_ACI_CREG_STAT*)&creg.stat, | |
342 (USHORT*)&creg.lac, | |
343 (USHORT*)&creg.ci, | |
344 (T_ACI_P_CREG_GPRS_IND*)&creg.gprs_ind); | |
345 | |
346 aci_bat_send(src_infos_psi, &resp); | |
347 return(ret); | |
348 } | |
349 | |
350 /* | |
351 +--------------------------------------------------------------------+ | |
352 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
353 | STATE : code ROUTINE : sBAT_PlusWS46 | | |
354 +--------------------------------------------------------------------+ | |
355 | |
356 PURPOSE : | |
357 */ | |
358 GLOBAL T_ACI_BAT_RSLT sBAT_PlusWS46(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
359 T_BAT_cmd_send *cmd) | |
360 { | |
361 T_ACI_BAT_RSLT ret; | |
362 T_BAT_plus_ws46_n mode = cmd->params.ptr_set_plus_ws46->n; | |
363 | |
364 TRACE_FUNCTION ("sBAT_PlusWS46()"); | |
365 | |
366 ret = sAT_PlusWS46(src_infos_psi->srcId, mode); | |
367 return(ret); | |
368 } | |
369 | |
370 /* | |
371 +--------------------------------------------------------------------+ | |
372 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
373 | STATE : code ROUTINE : qBAT_PlusWS46 | | |
374 +--------------------------------------------------------------------+ | |
375 | |
376 PURPOSE : | |
377 */ | |
378 GLOBAL T_ACI_BAT_RSLT qBAT_PlusWS46(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
379 T_BAT_cmd_send *cmd) | |
380 { | |
381 T_ACI_BAT_RSLT ret; | |
382 T_BAT_cmd_response resp; | |
383 T_BAT_res_que_plus_ws46 ws46; | |
384 | |
385 TRACE_FUNCTION ("qBAT_PlusWS46()"); | |
386 | |
387 resp.ctrl_response = BAT_RES_QUE_PLUS_WS46; | |
388 resp.response.ptr_que_plus_ws46 = &ws46; | |
389 | |
390 ret = qAT_PlusWS46(src_infos_psi->srcId, (T_ACI_WS46_MOD *)&ws46.n); | |
391 | |
392 aci_bat_send(src_infos_psi, &resp); | |
393 return(ret); | |
394 } | |
395 | |
396 /* | |
397 +--------------------------------------------------------------------+ | |
398 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
399 | STATE : code ROUTINE : sBAT_PercentCHPL | | |
400 +--------------------------------------------------------------------+ | |
401 | |
402 PURPOSE : | |
403 */ | |
404 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCHPL(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
405 T_BAT_cmd_send *cmd) | |
406 { | |
407 T_ACI_BAT_RSLT ret; | |
408 T_ACI_OPER_NTRY oper; | |
409 UBYTE len; | |
410 | |
411 TRACE_FUNCTION ("sBAT_PercentCHPL()"); | |
412 | |
413 /* | |
414 * Call the corresponding ACI function. T_ACI_BAT_RSLT is | |
415 * assumed to be equivalent to T_ACI_RESULT. | |
416 */ | |
417 ret=(T_ACI_BAT_RSLT)sAT_PercentCHPL(src_infos_psi->srcId,&oper); | |
418 | |
419 /* | |
420 * If the command completes, we must send a response. | |
421 */ | |
422 if (ret==ACI_BAT_CMPL) | |
423 { | |
424 T_BAT_cmd_response resp; | |
425 T_BAT_res_set_percent_chpl chpl_data; | |
426 | |
427 resp.ctrl_response=BAT_RES_SET_PERCENT_CHPL; | |
428 resp.response.ptr_set_percent_chpl=&chpl_data; | |
429 | |
430 chpl_data.type=BAT_P_CHPL_TYPE_FROM_IMS; | |
431 | |
432 switch (cmd->params.ptr_set_percent_chpl->oprfrmt) | |
433 { | |
434 case BAT_P_CHPL_OPRFRMT_LONG: | |
435 len=strlen(oper.longName); | |
436 | |
437 if (len<=BAT_MAX_CHPL_OPER_LEN) | |
438 { | |
439 memcpy(chpl_data.oper,oper.longName,len); | |
440 chpl_data.c_oper=(U8)len; | |
441 } | |
442 else | |
443 { | |
444 return(ACI_BAT_FAIL); | |
445 } | |
446 break; | |
447 | |
448 case BAT_P_CHPL_OPRFRMT_SHORT: | |
449 len=strlen(oper.shrtName); | |
450 | |
451 if (len<=BAT_MAX_CHPL_OPER_LEN) | |
452 { | |
453 memcpy(chpl_data.oper,oper.shrtName,len); | |
454 chpl_data.c_oper=(U8)len; | |
455 } | |
456 else | |
457 { | |
458 return(ACI_BAT_FAIL); | |
459 } | |
460 break; | |
461 | |
462 case BAT_P_CHPL_OPRFRMT_NUMERIC: | |
463 /* | |
464 * Representation of the numeric format as in the ATI. | |
465 */ | |
466 if ((oper.mnc & 0x00F)==0xF) | |
467 sprintf((char *)chpl_data.oper, "%03x,%02x",oper.mcc, oper.mnc >> 4); | |
468 else | |
469 sprintf((char *)chpl_data.oper, "%03x,%03x",oper.mcc, oper.mnc); | |
470 | |
471 chpl_data.c_oper=(U8)strlen((char *)chpl_data.oper); | |
472 break; | |
473 | |
474 default: | |
475 return(ACI_BAT_FAIL); | |
476 break; | |
477 } | |
478 | |
479 aci_bat_send(src_infos_psi,&resp); | |
480 } | |
481 | |
482 return(ret); | |
483 } | |
484 | |
485 /* | |
486 +--------------------------------------------------------------------+ | |
487 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
488 | STATE : code ROUTINE : sBAT_PlusCTZU | | |
489 +--------------------------------------------------------------------+ | |
490 | |
491 PURPOSE : | |
492 */ | |
493 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCTZU(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
494 T_BAT_cmd_send *cmd) | |
495 { | |
496 T_ACI_BAT_RSLT ret; | |
497 | |
498 TRACE_FUNCTION ("sBAT_PlusCTZU()"); | |
499 | |
500 ret = sAT_PlusCTZU (src_infos_psi->srcId, cmd->params.ptr_set_plus_ctzu->onoff); | |
501 return(ret); | |
502 } | |
503 | |
504 /* | |
505 +--------------------------------------------------------------------+ | |
506 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
507 | STATE : code ROUTINE : qBAT_PlusCTZU | | |
508 +--------------------------------------------------------------------+ | |
509 | |
510 PURPOSE : | |
511 */ | |
512 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCTZU(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
513 T_BAT_cmd_send *cmd) | |
514 { | |
515 T_ACI_BAT_RSLT ret; | |
516 | |
517 T_BAT_cmd_response resp; | |
518 T_BAT_res_que_plus_ctzu ctzu; | |
519 | |
520 TRACE_FUNCTION ("qBAT_PlusCTZU()"); | |
521 | |
522 resp.ctrl_response = BAT_RES_QUE_PLUS_CTZU; | |
523 resp.response.ptr_que_plus_ctzu = &ctzu; | |
524 ret = qAT_PlusCTZU(src_infos_psi->srcId, (T_ACI_CTZU_MODE*)&ctzu.onoff); | |
525 | |
526 aci_bat_send(src_infos_psi, &resp); | |
527 return(ret); | |
528 } | |
529 | |
530 /* | |
531 +--------------------------------------------------------------------+ | |
532 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
533 | STATE : code ROUTINE : sBAT_PercentCWUP | | |
534 +--------------------------------------------------------------------+ | |
535 | |
536 PURPOSE : | |
537 */ | |
538 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCWUP(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
539 T_BAT_cmd_send *cmd) | |
540 { | |
541 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
542 | |
543 TRACE_FUNCTION ("sBAT_PercentCWUP()"); | |
544 | |
545 ret = sAT_PercentCWUP (src_infos_psi->srcId, cmd->params.ptr_set_percent_cwup->type); | |
546 return(ret); | |
547 } | |
548 | |
549 /* | |
550 +--------------------------------------------------------------------+ | |
551 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
552 | STATE : code ROUTINE : sBAT_PercentCTZV | | |
553 +--------------------------------------------------------------------+ | |
554 | |
555 PURPOSE : %CTZV command mode (time and date report) | |
556 */ | |
557 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCTZV (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
558 T_BAT_cmd_send *cmd) | |
559 { | |
560 T_ACI_BAT_RSLT ret; | |
561 | |
562 TRACE_FUNCTION ("sBAT_PercentCTZV()"); | |
563 | |
564 ret = sAT_PercentCTZV (src_infos_psi->srcId, | |
565 (T_ACI_PCTZV_MODE)cmd->params.ptr_set_percent_ctzv->mode); | |
566 return(ret); | |
567 } | |
568 | |
569 /* | |
570 +--------------------------------------------------------------------+ | |
571 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
572 | STATE : code ROUTINE : sBAT_PlusCIND | | |
573 +--------------------------------------------------------------------+ | |
574 | |
575 PURPOSE : | |
576 */ | |
577 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCIND(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
578 T_BAT_cmd_send *cmd) | |
579 { | |
580 T_ACI_BAT_RSLT ret; | |
581 | |
582 TRACE_FUNCTION ("sBAT_PlusCIND()"); | |
583 | |
584 ret = sAT_PlusCIND( src_infos_psi->srcId, | |
585 cmd->params.ptr_set_plus_cind->signal_ctrl, | |
586 cmd->params.ptr_set_plus_cind->smsfull_ctrl); | |
587 return(ret); | |
588 } | |
589 | |
590 /* | |
591 +--------------------------------------------------------------------+ | |
592 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
593 | STATE : code ROUTINE : qBAT_PlusCIND | | |
594 +--------------------------------------------------------------------+ | |
595 | |
596 PURPOSE : | |
597 */ | |
598 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCIND(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
599 T_BAT_cmd_send *cmd) | |
600 { | |
601 T_ACI_BAT_RSLT ret; | |
602 | |
603 T_BAT_cmd_response resp; | |
604 T_BAT_res_que_plus_cind cind; | |
605 | |
606 TRACE_FUNCTION ("qBAT_PlusCIND()"); | |
607 | |
608 resp.ctrl_response = BAT_RES_QUE_PLUS_CIND; | |
609 resp.response.ptr_que_plus_cind = &cind; | |
610 | |
611 ret = qAT_PlusCIND(src_infos_psi->srcId, | |
612 (T_ACI_CIND_SIGNAL_TYPE*)&cind.signal, | |
613 (T_ACI_CIND_SMSFULL_TYPE*)&cind.smsfull); | |
614 | |
615 aci_bat_send(src_infos_psi, &resp); | |
616 return(ret); | |
617 } | |
618 | |
619 /* | |
620 +--------------------------------------------------------------------+ | |
621 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
622 | STATE : code ROUTINE : sBAT_PlusCMER | | |
623 +--------------------------------------------------------------------+ | |
624 | |
625 PURPOSE : | |
626 */ | |
627 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMER(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
628 T_BAT_cmd_send *cmd) | |
629 { | |
630 T_ACI_BAT_RSLT ret; | |
631 | |
632 T_ACI_CMER_MODE_TYPE sCmerModeSettings = CMER_MODE_INVALID; | |
633 T_ACI_CMER_IND_TYPE sCmerIndicationSettings = CMER_INDICATOR_INVALID; | |
634 T_ACI_CMER_BFR_TYPE sCmerBfrSettings = CMER_BFR_INVALID; | |
635 | |
636 TRACE_FUNCTION ("sBAT_PlusCMER()"); | |
637 | |
638 switch (cmd->params.ptr_set_plus_cmer->ind_option) | |
639 { | |
640 case BAT_CMER_IND_OPTION_LOWER: | |
641 ret = sAT_PlusCMER(src_infos_psi->srcId, | |
642 sCmerModeSettings, | |
643 sCmerIndicationSettings, | |
644 sCmerBfrSettings); | |
645 break; | |
646 | |
647 case BAT_CMER_IND_OPTION_GREATER_EQUAL: | |
648 ret = sAT_PlusCMER(src_infos_psi->srcId, | |
649 sCmerModeSettings, | |
650 sCmerIndicationSettings, | |
651 sCmerBfrSettings); | |
652 break; | |
653 | |
654 case BAT_CMER_IND_OPTION_NOT_PRESENT: | |
655 default: | |
656 return ACI_BAT_FAIL; | |
657 break; | |
658 } | |
659 return(ret); | |
660 } | |
661 | |
662 /* | |
663 +--------------------------------------------------------------------+ | |
664 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
665 | STATE : code ROUTINE : qBAT_PlusCMER | | |
666 +--------------------------------------------------------------------+ | |
667 | |
668 PURPOSE : | |
669 */ | |
670 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCMER(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
671 T_BAT_cmd_send *cmd) | |
672 { | |
673 T_ACI_BAT_RSLT ret; | |
674 T_BAT_cmd_response resp; | |
675 T_BAT_res_que_plus_cmer cmer; | |
676 | |
677 T_ACI_CMER_MODE_TYPE sCmerModeSettings; | |
678 T_ACI_CMER_IND_TYPE sCmerIndicationSettings; | |
679 T_ACI_CMER_BFR_TYPE sCmerBfrSettings; | |
680 | |
681 TRACE_FUNCTION ("qBAT_PlusCMER()"); | |
682 | |
683 resp.ctrl_response = BAT_RES_QUE_PLUS_CMER; | |
684 resp.response.ptr_que_plus_cmer = &cmer; | |
685 | |
686 ret = qAT_PlusCMER(src_infos_psi->srcId, | |
687 &sCmerModeSettings, | |
688 &sCmerIndicationSettings, | |
689 &sCmerBfrSettings); | |
690 | |
691 switch (cmd->params.ptr_que_plus_cmer->bat_dummy) | |
692 { | |
693 default: | |
694 break; | |
695 } | |
696 aci_bat_send(src_infos_psi, &resp); | |
697 return(ret); | |
698 } | |
699 |