comparison src/g23m-aci/aci/aci_bat_sms.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 "ati_cmd.h"
25 #include "aci_cmd.h"
26 #include "aci_bat_cmh.h" /* prototypes of sBAT_,qBAT_,tBAT_ */
27 #include "aci_bat.h"
28 #include "psa.h"
29 #include "psa_sms.h"
30 #include "cmh.h"
31
32 EXTERN T_SMS_SHRD_PRM smsShrdPrm;
33
34 EXTERN SHORT cmhSMS_getPrfRge ( void );
35
36 EXTERN T_ATI_RSLT txt_rdmode_to_smsrdmode(char *txt_rdmode);
37
38
39
40 /*
41 +--------------------------------------------------------------------+
42 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
43 | STATE : code ROUTINE : sBAT_PlusCSMS |
44 +--------------------------------------------------------------------+
45
46 PURPOSE :
47 */
48 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCSMS (T_ACI_DTI_PRC_PSI *src_infos_psi,
49 T_BAT_cmd_send *cmd)
50 {
51 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
52
53 TRACE_FUNCTION ("sBAT_PlusCSMS()");
54
55 ret = (T_ACI_BAT_RSLT)sAT_PlusCSMS((T_ACI_CMD_SRC)src_infos_psi->srcId,(T_ACI_CSMS_SERV)cmd->params.ptr_set_plus_csms->service);
56
57 return ret;
58 }
59
60 /*
61 +--------------------------------------------------------------------+
62 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
63 | STATE : code ROUTINE : qBAT_PlusCSMS |
64 +--------------------------------------------------------------------+
65
66 PURPOSE :
67 */
68 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCSMS (T_ACI_DTI_PRC_PSI *src_infos_psi,
69 T_BAT_cmd_send *cmd)
70 {
71 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
72 T_ACI_CSMS_SERV service;
73 T_ACI_CSMS_SUPP mt;
74 T_ACI_CSMS_SUPP mo;
75 T_ACI_CSMS_SUPP bm;
76 T_BAT_cmd_response resp;
77 T_BAT_res_que_plus_csms que_csms_buffer;
78
79 TRACE_FUNCTION ("qBAT_PlusCSMS()");
80
81 resp.ctrl_response = BAT_RES_QUE_PLUS_CSMS;
82 resp.response.ptr_que_plus_csms = &que_csms_buffer;
83 ret = (T_ACI_BAT_RSLT)qAT_PlusCSMS((T_ACI_CMD_SRC)src_infos_psi->srcId,&service,&mt,&mo,&bm);
84 switch(ret)
85 {
86 case ACI_BAT_CMPL :
87 resp.response.ptr_que_plus_csms->service = (T_BAT_plus_csms_service)service;
88 resp.response.ptr_que_plus_csms->mt = (T_BAT_plus_csms_mt)mt;
89 resp.response.ptr_que_plus_csms->mo = (T_BAT_plus_csms_mo)mo;
90 resp.response.ptr_que_plus_csms->bm = (T_BAT_plus_csms_bm)bm;
91 aci_bat_send(src_infos_psi,&resp);
92 /*lint -fallthrough*/
93 default :
94 return (ret);
95 }
96 }
97
98 /*
99 +--------------------------------------------------------------------+
100 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
101 | STATE : code ROUTINE : sBAT_PlusCPMS |
102 +--------------------------------------------------------------------+
103
104 PURPOSE :
105 */
106 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCPMS (T_ACI_DTI_PRC_PSI *src_infos_psi,
107 T_BAT_cmd_send *cmd)
108 {
109 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
110 T_BAT_plus_cpms_mem1 mem1;
111 T_BAT_plus_cpms_mem2 mem2 = BAT_CPMS_MEM2_NOT_PRESENT;
112 T_BAT_plus_cpms_mem3 mem3 = BAT_CPMS_MEM3_NOT_PRESENT;
113
114 TRACE_FUNCTION ("sBAT_PlusCPMS()");
115
116 mem1 = cmd->params.ptr_set_plus_cpms->mem1;
117 mem2 = cmd->params.ptr_set_plus_cpms->mem2;
118 mem3 = cmd->params.ptr_set_plus_cpms->mem3;
119 ret = (T_ACI_BAT_RSLT)sAT_PlusCPMS ( (T_ACI_CMD_SRC)src_infos_psi->srcId,(T_ACI_SMS_STOR)mem1, (T_ACI_SMS_STOR)mem2, (T_ACI_SMS_STOR)mem3);
120
121 return (ret);
122 }
123
124 /*
125 +--------------------------------------------------------------------+
126 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
127 | STATE : code ROUTINE : qBAT_PlusCPMS |
128 +--------------------------------------------------------------------+
129
130 PURPOSE :
131 */
132 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCPMS (T_ACI_DTI_PRC_PSI *src_infos_psi,
133 T_BAT_cmd_send *cmd)
134 {
135 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
136
137 TRACE_FUNCTION ("qBAT_PlusCPMS()");
138 ret = (T_ACI_BAT_RSLT)qAT_PlusCPMS ( (T_ACI_CMD_SRC)src_infos_psi->srcId );
139 /* ..............RECEHECK............. */
140 /* Needs to be looked into. The cmd params are not filled thru this function call
141 see implementation of qAT_plusCPMS, Needs to be rewritten */
142
143 return (ret);
144 }
145
146 /*
147 +--------------------------------------------------------------------+
148 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
149 | STATE : code ROUTINE : sBAT_PlusCSCA |
150 +--------------------------------------------------------------------+
151
152 PURPOSE :
153 */
154 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCSCA (T_ACI_DTI_PRC_PSI *src_infos_psi,
155 T_BAT_cmd_send *cmd)
156 {
157 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
158 T_ACI_TOA tosca;
159 T_ACI_TOA *p_tosca;
160 CHAR sca[MAX_SMS_NUM_LEN];
161
162 TRACE_FUNCTION ("sBAT_PlusCSCA()");
163
164 memset (sca, 0, sizeof(sca));
165 p_tosca=&tosca;
166
167 if(cmd->params.ptr_set_plus_csca->tosca EQ (S16)BAT_PARAMETER_NOT_PRESENT)
168 {
169 p_tosca = NULL;
170 }
171 else
172 {
173 tosca=toa_demerge(cmd->params.ptr_set_plus_csca->tosca);
174 if (tosca.ton < 0 OR tosca.npi < 0)
175 {
176 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
177 return (ACI_BAT_FAIL);
178 }
179 }
180 memcpy(sca,cmd->params.ptr_set_plus_csca->sca,cmd->params.ptr_set_plus_csca->c_sca);
181 ret = (T_ACI_BAT_RSLT)sAT_PlusCSCA((T_ACI_CMD_SRC)src_infos_psi->srcId,sca,p_tosca);
182
183 return ret;
184 }
185
186 /*
187 +--------------------------------------------------------------------+
188 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
189 | STATE : code ROUTINE : qBAT_PlusCSCA |
190 +--------------------------------------------------------------------+
191
192 PURPOSE :
193 */
194 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCSCA (T_ACI_DTI_PRC_PSI *src_infos_psi,
195 T_BAT_cmd_send *cmd)
196 {
197 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
198 T_ACI_TOA tosca;
199 SHORT octet=0;
200 CHAR sca[MAX_SMS_NUM_LEN];
201 T_BAT_cmd_response resp;
202 T_BAT_res_que_plus_csca que_csca_buffer;
203
204 TRACE_FUNCTION ("qBAT_PlusCSCA()");
205 ret = (T_ACI_BAT_RSLT)qAT_PlusCSCA ((T_ACI_CMD_SRC)src_infos_psi->srcId,sca,&tosca);
206 resp.ctrl_response = BAT_RES_QUE_PLUS_CSCA;
207 resp.response.ptr_que_plus_csca = &que_csca_buffer;
208 switch(ret)
209 {
210 case ACI_BAT_CMPL :
211 octet=toa_merge(tosca);
212 resp.response.ptr_que_plus_csca->tosca = (U8)octet;
213 resp.response.ptr_que_plus_csca->c_sca = strlen(sca);
214 /* Are we sure the length is strlen(sca)? */
215 memcpy(resp.response.ptr_que_plus_csca->sca,sca,strlen(sca));
216 aci_bat_send(src_infos_psi,&resp);
217 /*lint -fallthrough*/
218 default :
219 return (ret);
220 }
221 }
222
223 /*
224 +--------------------------------------------------------------------+
225 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
226 | STATE : code ROUTINE : sBAT_PlusCSCB |
227 +--------------------------------------------------------------------+
228
229 PURPOSE :
230 */
231 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCSCB (T_ACI_DTI_PRC_PSI *src_infos_psi,
232 T_BAT_cmd_send *cmd)
233 {
234 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
235 USHORT *p_mids;
236 UBYTE *p_dcss;
237
238 TRACE_FUNCTION ("sBAT_PlusCSCB()");
239
240 if(cmd->params.ptr_set_plus_cscb->v_mids)
241 {
242 p_mids = cmd->params.ptr_set_plus_cscb->mids;
243 }
244 else
245 {
246 p_mids = NULL;
247 }
248 if(cmd->params.ptr_set_plus_cscb->v_dcss)
249 {
250 p_dcss = cmd->params.ptr_set_plus_cscb->dcss;
251 }
252 else
253 {
254 p_dcss = NULL;
255 }
256 ret=(T_ACI_BAT_RSLT)sAT_PlusCSCB((T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_CSCB_MOD)cmd->params.ptr_set_plus_cscb->mode, p_mids, p_dcss);
257
258 return ret;
259 }
260
261 /*
262 +--------------------------------------------------------------------+
263 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
264 | STATE : code ROUTINE : qBAT_PlusCSCB |
265 +--------------------------------------------------------------------+
266
267 PURPOSE : to query the cell broadcast channels, we pass to qAT_PlusCSCB()
268 two arrays (mids and dcss), which are filled in the following way:
269 - two consecutive array entries form one logical information
270 - when both entries have the same value, then it is a single channel
271 - when both entries have different values, then it is a range of channels.
272 mids is more or less a copy of EF CBMIR of the SIM. refer to 11.11
273 A string based response +CSCB: 0,"2,3,4-6,7,922-1003","0-3,5"
274 is on binary level as follow:
275 mode = BAT_CSCB_MODE_ACCEPT; <=== 0 = accepted
276 mids[0] = 0x0002;
277 mids[1] = 0x0002;
278 mids[2] = 0x0003;
279 mids[3] = 0x0003;
280 mids[4] = 0x0004; <=== range lower bound
281 mids[5] = 0x0006; <=== range upper bound
282 mids[6] = 0x0007;
283 mids[7] = 0x0007;
284 mids[8] = 0x039A; <=== range lower bound
285 mids[9] = 0x03EB; <=== range upper bound
286 dcss[0] = 0x00;
287 dcss[1] = 0x03;
288 dcss[2] = 0x05;
289 dcss[3] = 0x05;
290
291 */
292 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCSCB (T_ACI_DTI_PRC_PSI *src_infos_psi,
293 T_BAT_cmd_send *cmd)
294 {
295 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
296 T_BAT_cmd_response resp;
297 T_BAT_res_que_plus_cscb cscb;
298 int i;
299
300 TRACE_FUNCTION ("qBAT_PlusCSCB()");
301
302 resp.ctrl_response = BAT_RES_QUE_PLUS_CSCB;
303 resp.response.ptr_que_plus_cscb = &cscb;
304
305 cscb.c_mids = 0;
306 cscb.v_mids = FALSE;
307 cscb.c_dcss = 0;
308 cscb.v_dcss = FALSE;
309
310 memset(cscb.mids, 0xFF, BAT_MAX_IDENTS);
311 memset(cscb.dcss, 0xFF, BAT_MAX_IDENTS);
312
313 ret = (T_ACI_BAT_RSLT)qAT_PlusCSCB((T_ACI_CMD_SRC)src_infos_psi->srcId,
314 (T_ACI_CSCB_MOD*)&cscb.mode,
315 cscb.mids,
316 cscb.dcss);
317
318 switch(ret)
319 {
320 case ACI_BAT_CMPL :
321 i = 0;
322
323 if ((cscb.mids[0] NEQ 0xFFFF)
324 AND (cscb.mids[1] NEQ 0xFFFF))
325 {
326 cscb.v_mids = TRUE;
327 }
328
329 while ((i < BAT_MAX_IDENTS-1)
330 AND (cscb.mids[i] NEQ 0xFFFF)
331 AND (cscb.mids[i+1] NEQ 0xFFFF))
332 {
333 i += 2;
334 cscb.c_mids += 2;
335 }
336
337 i = 0;
338
339 if ((cscb.dcss[0] NEQ 0xFF)
340 AND (cscb.dcss[1] NEQ 0xFF))
341 {
342 cscb.v_dcss = TRUE;
343 }
344
345 while ((i < BAT_MAX_IDENTS-1)
346 AND (cscb.dcss[i] NEQ 0xFF)
347 AND (cscb.dcss[i+1] NEQ 0xFF))
348 {
349 i += 2;
350 cscb.c_dcss += 2;
351 }
352
353 aci_bat_send(src_infos_psi,&resp);
354 /*lint -fallthrough*/
355 default :
356 return (ret);
357 }
358 }
359
360 #ifdef _SIMULATION_
361 #pragma message( __TODO__"FF_HOMEZONE is currently a problem for linking" )
362 #endif
363 /* #ifdef FF_HOMEZONE */
364 /*
365 +--------------------------------------------------------------------+
366 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
367 | STATE : code ROUTINE : sBAT_PercentCBHZ |
368 +--------------------------------------------------------------------+
369
370 PURPOSE :
371 */
372 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCBHZ (T_ACI_DTI_PRC_PSI *src_infos_psi,
373 T_BAT_cmd_send *cmd)
374 {
375 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
376
377 TRACE_FUNCTION ("sBAT_PercentCBHZ()");
378
379 /* CBHZ_xxx depends on FF_HOMEZONE
380 ret = sAT_PercentCBHZ(src_infos_psi->srcId,cmd->params.ptr_set_percent_cbhz->mode
381 ,cmd->params.ptr_set_percent_cbhz->dcs,
382 cmd->params.ptr_set_percent_cbhz->timeout);
383 if (ret EQ AT_FAIL)
384 {
385 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_Unknown);
386 return (ACI_BAT_FAIL);
387 }
388 return (ACI_BAT_CMPL);
389 */
390 return(ret);
391 }
392
393 /*
394 +--------------------------------------------------------------------+
395 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
396 | STATE : code ROUTINE : tBAT_PercentCBHZ |
397 +--------------------------------------------------------------------+
398
399 PURPOSE :
400 */
401 GLOBAL T_ACI_BAT_RSLT tBAT_PercentCBHZ (T_ACI_DTI_PRC_PSI *src_infos_psi,
402 T_BAT_cmd_send *cmd)
403 {
404 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
405 /* CBHZ_xxx depends on FF_HOMEZONE
406 T_BAT_cmd_response resp;
407 T_BAT_res_tst_percent_cbhz tst_cbhz_buffer;
408 T_BAT_percent_cbhz_mode mode;
409 T_ACI_CS dcs;
410 T_BAT_percent_cbhz_timeout timeout = BAT_P_CBHZ_TIMOUT_NOT_PRESENT;
411
412 TRACE_FUNCTION ("tBAT_PercentCBHZ()");
413 resp.ctrl_response = BAT_RES_QUE_PERCENT_CBHZ;
414 resp.response.ptr_tst_percent_cbhz = &tst_cbhz_buffer;
415
416
417 resp.response.ptr_tst_percent_cbhz->mode = CBHZ_MOD_Active;
418 resp.response.ptr_tst_percent_cbhz->dcs = CS_Ascii;
419 resp.response.ptr_tst_percent_cbhz->timeout = CBHZ_MAX_TIMEOUT;
420
421 dont know how to fill the lower values ???
422 CBHZ_xxx depends on FF_HOMEZONE
423 aci_bat_send(src_infos_psi,&resp);
424 return(ACI_BAT_CMPL);
425 */
426 return(ret);
427 }
428
429 /*
430 +--------------------------------------------------------------------+
431 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
432 | STATE : code ROUTINE : qBAT_PercentCBHZ |
433 +--------------------------------------------------------------------+
434
435 PURPOSE :
436 */
437 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCBHZ (T_ACI_DTI_PRC_PSI *src_infos_psi,
438 T_BAT_cmd_send *cmd)
439 {
440 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
441 /* qAT_PercentCBHZ depends on FF_HOMEZONE
442 T_BAT_percent_cbhz_mode mode;
443 T_ACI_CS dcs;
444 T_BAT_percent_cbhz_timeout timeout = BAT_P_CBHZ_TIMOUT_NOT_PRESENT;
445 T_BAT_cmd_response resp;
446 T_BAT_res_que_percent_cbhz que_cbhz_buffer;
447
448 TRACE_FUNCTION ("qBAT_PercentCBHZ()");
449
450 resp.ctrl_response = BAT_RES_QUE_PERCENT_CBHZ;
451 resp.response.ptr_que_percent_cbhz = &que_cbhz_buffer;
452 ret = qAT_PercentCBHZ(src_infos_psi->srcId, &mode, &dcs, &timeout);
453 if (ret EQ AT_FAIL)
454 {
455 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_NotPresent);
456 return (ATI_FAIL);
457 }
458 resp.response.ptr_que_percent_cbhz->mode = mode;
459 resp.response.ptr_que_percent_cbhz->timeout = timeout;
460 resp.response.ptr_que_percent_cbhz->dcs = dcs;
461 */
462 return(ret);
463 }
464
465 /* #endif *//* FF_HOMEZONE */
466 /*
467 +--------------------------------------------------------------------+
468 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
469 | STATE : code ROUTINE : sBAT_PlusCSAS |
470 +--------------------------------------------------------------------+
471
472 PURPOSE :
473 */
474 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCSAS (T_ACI_DTI_PRC_PSI *src_infos_psi,
475 T_BAT_cmd_send *cmd)
476 {
477 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
478
479 TRACE_FUNCTION ("sBAT_PlusCSAS()");
480
481 ret = (T_ACI_BAT_RSLT)sAT_PlusCSAS ((T_ACI_CMD_SRC)src_infos_psi->srcId,cmd->params.ptr_set_plus_csas->profile);
482
483 return ret;
484 }
485
486
487 /*
488 +--------------------------------------------------------------------+
489 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
490 | STATE : code ROUTINE : tBAT_PlusCSAS |
491 +--------------------------------------------------------------------+
492
493 PURPOSE :
494 */
495 GLOBAL T_ACI_BAT_RSLT tBAT_PlusCSAS (T_ACI_DTI_PRC_PSI *src_infos_psi,
496 T_BAT_cmd_send *cmd)
497 {
498 SHORT profile = -1;
499 T_BAT_cmd_response resp;
500 T_BAT_res_tst_plus_csas tst_csas_buffer;
501
502
503 TRACE_FUNCTION ("tBAT_PlusCSAS()");
504
505 if ((profile = cmhSMS_getPrfRge ()) < 1)
506 {
507 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_MemFail );
508 return (ACI_BAT_FAIL);
509 }
510 else
511 {
512 resp.ctrl_response = BAT_RES_TST_PLUS_CSAS;
513 resp.response.ptr_tst_plus_csas = &tst_csas_buffer;
514 resp.response.ptr_tst_plus_csas->max = (profile - 1) ;
515 aci_bat_send(src_infos_psi,&resp);
516 return (ACI_BAT_CMPL);
517 }
518 }
519
520 /*
521 +--------------------------------------------------------------------+
522 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
523 | STATE : code ROUTINE : sBAT_PlusCRES |
524 +--------------------------------------------------------------------+
525
526 PURPOSE :
527 */
528 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCRES (T_ACI_DTI_PRC_PSI *src_infos_psi,
529 T_BAT_cmd_send *cmd)
530 {
531 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
532
533 TRACE_FUNCTION ("sBAT_PlusCRES()");
534
535 ret = (T_ACI_BAT_RSLT)sAT_PlusCRES ((T_ACI_CMD_SRC)src_infos_psi->srcId,cmd->params.ptr_set_plus_cres->profile);
536
537 return ret;
538 }
539
540 /*
541 +--------------------------------------------------------------------+
542 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
543 | STATE : code ROUTINE : tBAT_PlusCRES |
544 +--------------------------------------------------------------------+
545
546 PURPOSE :
547 */
548 GLOBAL T_ACI_BAT_RSLT tBAT_PlusCRES (T_ACI_DTI_PRC_PSI *src_infos_psi,
549 T_BAT_cmd_send *cmd)
550 {
551 T_ACI_CRES profile ;
552 T_BAT_cmd_response resp;
553 T_BAT_res_tst_plus_cres tst_cres_buffer;
554 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
555
556 TRACE_FUNCTION ("tBAT_PlusCRES()");
557
558 ret = (T_ACI_BAT_RSLT)tAT_PlusCRES ((T_ACI_CMD_SRC)src_infos_psi->srcId, &profile);
559 switch (ret)
560 {
561 case ACI_BAT_CMPL:
562 {
563 break;
564 }
565 case ACI_BAT_FAIL:
566 default:
567 {
568 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_MemFail );
569 return (ACI_BAT_FAIL);
570 }
571 }
572 resp.ctrl_response = BAT_RES_TST_PLUS_CRES;
573 resp.response.ptr_tst_plus_cres = &tst_cres_buffer;
574 resp.response.ptr_tst_plus_cres->max = profile.max ;
575 /* there is no min field to fill in */
576 //resp.response.ptr_tst_plus_cres->min = profile.min ;
577 aci_bat_send(src_infos_psi,&resp);
578 return (ACI_BAT_CMPL);
579 }
580
581
582 /*
583 +--------------------------------------------------------------------+
584 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
585 | STATE : code ROUTINE : sBAT_PlusCMGR |
586 +--------------------------------------------------------------------+
587
588 PURPOSE :
589 */
590 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMGR (T_ACI_DTI_PRC_PSI *src_infos_psi,
591 T_BAT_cmd_send *cmd)
592 {
593 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
594 SHORT idx=-1;
595
596 TRACE_FUNCTION ("sBAT_PlusCMGR()");
597
598 idx = cmd->params.ptr_set_plus_cmgr->sms_index;
599 if ( idx > 255 OR idx < 0)
600 {
601 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
602 return (ACI_BAT_FAIL);
603 }
604 ret = (T_ACI_BAT_RSLT)sAT_PlusCMGR_Gl((T_ACI_CMD_SRC)src_infos_psi->srcId, (UBYTE)idx, SMS_READ_Normal, NULL);
605 /*
606 TO DO
607 ret = sAT_PlusCMGR_Gl(src_infos_psi->srcId, (UBYTE)idx, cmglRead, NULL);
608
609 */
610 return (ret);
611 }
612
613 /*
614 +--------------------------------------------------------------------+
615 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
616 | STATE : code ROUTINE : sBAT_PercentCMGR |
617 +--------------------------------------------------------------------+
618
619 PURPOSE :
620 */
621 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCMGR (T_ACI_DTI_PRC_PSI *src_infos_psi,
622 T_BAT_cmd_send *cmd)
623 {
624 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
625 SHORT idx=-1;
626 #ifdef SMS_PDU_SUPPORT
627 T_ACI_CMGF_MOD mode;
628 #endif
629 CHAR *txtRdMode = NULL;
630
631
632 TRACE_FUNCTION ("sBAT_PercentCMGR()");
633
634 smsReadMode = SMS_READ_Normal;
635
636 #ifdef SMS_PDU_SUPPORT
637 /*
638 * request current mode
639 */
640 qAT_PlusCMGF((T_ACI_CMD_SRC)src_infos_psi->srcId, &mode);
641 if (mode EQ 0)
642 {
643 /*
644 * %CMGR=[index],[preview]
645 */
646 idx = cmd->params.ptr_set_percent_cmgr->sms_index;
647 smsReadMode = (T_ACI_SMS_READ)cmd->params.ptr_set_percent_cmgr->rdmode;
648 if ( idx > 255 OR idx < 0 OR smsReadMode > SMS_READ_StatusChange)
649 {
650 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
651 return (ACI_BAT_FAIL);
652 }
653 }
654 else
655 #endif
656 {
657 idx = cmd->params.ptr_set_percent_cmgr->sms_index;
658 if ( idx > 255 OR idx < 0)
659 {
660 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
661 return (ACI_BAT_FAIL);
662 }
663 txtRdMode = (CHAR *)&cmd->params.ptr_set_percent_cmgr->rdmode;
664 if (txt_rdmode_to_smsrdmode(txtRdMode) EQ ATI_FAIL)
665 {
666 return (ACI_BAT_FAIL);
667 }
668 }
669 ret = (T_ACI_BAT_RSLT)sAT_PercentCMGR_Gl((T_ACI_CMD_SRC)src_infos_psi->srcId, (UBYTE)idx, smsReadMode , NULL);
670
671 return (ret);
672 }
673 /*
674 +--------------------------------------------------------------------+
675 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
676 | STATE : code ROUTINE : sBAT_PlusCMGS |
677 +--------------------------------------------------------------------+
678
679 PURPOSE :
680 */
681 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMGS (T_ACI_DTI_PRC_PSI *src_infos_psi,
682 T_BAT_cmd_send *cmd)
683 {
684 T_ACI_BAT_RSLT ret;
685 T_ACI_SM_DATA pdu;
686
687 TRACE_FUNCTION ("sBAT_PlusCMGS()");
688
689 /*
690 * Check that 'data' in the T_ACI_SM_DATA structure is large enough
691 * to store the data in the BAT command. If it isn't then we may
692 * as well give up.
693 */
694 if (cmd->params.ptr_set_plus_cmgs->c_pdu>MAX_SM_LEN)
695 {
696 ACI_ERR_DESC(ACI_ERR_CLASS_Ext,EXT_ERR_Parameter);
697 return(ACI_BAT_FAIL);
698 }
699
700 /*
701 * Copy the data, secure in the knowledge that we have enough room.
702 */
703 memcpy(
704 pdu.data,
705 cmd->params.ptr_set_plus_cmgs->pdu,
706 MAX_SM_LEN);
707
708 pdu.len=cmd->params.ptr_set_plus_cmgs->c_pdu;
709
710 /*
711 * Call the corresponding sAT function. T_ACI_BAT_RSLT is
712 * assumed to be equivalent to T_ACI_RESULT.
713 */
714 ret=(T_ACI_BAT_RSLT)sAT_PlusCMGSPdu((T_ACI_CMD_SRC)src_infos_psi->srcId,&pdu);
715
716 return(ret);
717 }
718
719 /*
720 +--------------------------------------------------------------------+
721 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
722 | STATE : code ROUTINE : sBAT_PlusCMSS |
723 +--------------------------------------------------------------------+
724
725 PURPOSE :
726 */
727 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMSS (T_ACI_DTI_PRC_PSI *src_infos_psi,
728 T_BAT_cmd_send *cmd)
729 {
730 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
731 T_ACI_TOA toda;
732 T_ACI_TOA *p_toda;
733 SHORT index=-1,
734 toda_val=0;
735 CHAR da[MAX_SMS_NUM_LEN] , *p_da;
736
737 TRACE_FUNCTION ("sBAT_PlusCMSS()");
738
739 p_toda=&toda;
740 p_da=da;
741
742 index = cmd->params.ptr_set_plus_cmss->index;
743 if(cmd->params.ptr_set_plus_cmss->v_da)
744 {
745 memcpy(da,cmd->params.ptr_set_plus_cmss->da,cmd->params.ptr_set_plus_cmss->c_da);
746 }
747 else
748 {
749 p_da = NULL;
750 }
751 toda_val=cmd->params.ptr_set_plus_cmss->toda;
752 if(toda_val EQ (SHORT)BAT_PARAMETER_NOT_PRESENT)
753 {
754 p_toda=NULL;
755 }
756 else
757 {
758 toda=toa_demerge(toda_val);
759 if (toda.ton < 0 OR toda.npi < 0)
760 {
761 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_NotPresent);
762 return (ACI_BAT_FAIL);
763 }
764 }
765 ret = (T_ACI_BAT_RSLT)sAT_PlusCMSS_Gl((T_ACI_CMD_SRC)src_infos_psi->srcId, (UBYTE)index, p_da, p_toda, NULL, NULL);
766
767 return (ret);
768 }
769
770 /*
771 +--------------------------------------------------------------------+
772 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
773 | STATE : code ROUTINE : sBAT_PlusCMGW |
774 +--------------------------------------------------------------------+
775
776 PURPOSE :
777 */
778 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMGW (T_ACI_DTI_PRC_PSI *src_infos_psi,
779 T_BAT_cmd_send *cmd)
780 {
781 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
782 T_ACI_SMS_STAT stat;
783 T_ACI_SM_DATA pdu;
784 UBYTE sca_len;
785 UBYTE pdu_message_octets_length = 0;
786
787 TRACE_FUNCTION ("sBAT_PlusCMGW()");
788
789 stat = (T_ACI_SMS_STAT)cmd->params.ptr_set_plus_cmgw->sms_stat;
790 sca_len = cmd->params.ptr_set_plus_cmgw->pdu[0];
791 /* The first octet in pdu is length of sca */
792
793 if (sca_len > ((MAX_SMS_ADDR_DIG+1)/2) + 1)
794 {
795 TRACE_ERROR("SCA too long !!!");
796 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
797 return (ACI_BAT_FAIL);
798 }
799
800 pdu_message_octets_length = (cmd->params.ptr_set_plus_cmgw->length-2-sca_len*2)/2;
801 if(pdu_message_octets_length NEQ cmd->params.ptr_set_plus_cmgw->length)
802 {
803 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
804 TRACE_EVENT("ERROR: input pdu message length do not match the real length!");
805 return (ACI_BAT_FAIL);
806 }
807 memcpy(pdu.data,cmd->params.ptr_set_plus_cmgw->pdu,cmd->params.ptr_set_plus_cmgw->c_pdu);
808 ret = (T_ACI_BAT_RSLT)sAT_PlusCMGWPdu ((T_ACI_CMD_SRC)src_infos_psi->srcId, (UBYTE)stat, &pdu);
809
810 return (ret);
811 }
812
813 /*
814 |+--------------------------------------------------------------------+
815 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
816 | STATE : code ROUTINE : sBAT_PlusCNMA |
817 +---------------------------------------------------------------------+
818
819 PURPOSE :
820 */
821 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCNMA (T_ACI_DTI_PRC_PSI *src_infos_psi,
822 T_BAT_cmd_send *cmd)
823 {
824 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
825 T_ACI_SM_DATA pdu = {0}, *p_pdu;
826
827 TRACE_FUNCTION ("sBAT_PlusCNMA()");
828 p_pdu = &pdu;
829 if(cmd->params.ptr_set_plus_cnma->v_pdu)
830 {
831 memcpy(pdu.data,cmd->params.ptr_set_plus_cnma->pdu,cmd->params.ptr_set_plus_cnma->c_pdu);
832 pdu.len = cmd->params.ptr_set_plus_cnma->c_pdu ;
833 }
834 else
835 {
836 p_pdu = NULL;
837 }
838 ret = (T_ACI_BAT_RSLT)sAT_PlusCNMAPdu ((T_ACI_CMD_SRC)src_infos_psi->srcId, (SHORT)cmd->params.ptr_set_plus_cnma->n, p_pdu);
839
840 return(ret);
841 }
842
843 /*
844 +--------------------------------------------------------------------+
845 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
846 | STATE : code ROUTINE : sBAT_PlusCMGD |
847 +--------------------------------------------------------------------+
848
849 PURPOSE :
850 */
851 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMGD (T_ACI_DTI_PRC_PSI *src_infos_psi,
852 T_BAT_cmd_send *cmd)
853 {
854 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
855 SHORT index=-1;
856 SHORT status = BAT_CMGD_DEL_INDEX;
857
858
859 TRACE_FUNCTION ("sBAT_PlusCMGD()");
860
861 index = cmd->params.ptr_set_plus_cmgd->index;
862 status = cmd->params.ptr_set_plus_cmgd->status;
863
864 if((index > 255 OR index < 0) OR ((status < BAT_CMGD_DEL_INDEX) OR (status > BAT_CMGD_DEL_ALL)))
865 {
866 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
867 return (ACI_BAT_CMPL);
868 }
869
870 if (status > BAT_CMGD_DEL_INDEX)
871 {
872 index = 0;
873 }
874 ret = (T_ACI_BAT_RSLT)sAT_PlusCMGD_Gl((T_ACI_CMD_SRC)src_infos_psi->srcId,(UBYTE)index,status,NULL,NULL);
875
876 return (ret);
877 }
878
879 /*
880 +--------------------------------------------------------------------+
881 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
882 | STATE : code ROUTINE : sBAT_PlusCMGC |
883 +--------------------------------------------------------------------+
884
885 PURPOSE :
886 */
887 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMGC (T_ACI_DTI_PRC_PSI *src_infos_psi,
888 T_BAT_cmd_send *cmd)
889 {
890 T_ACI_SM_DATA pdu;
891 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
892 UBYTE sca_len;
893
894 TRACE_FUNCTION ("sBAT_PlusCMGC()");
895
896 sca_len = cmd->params.ptr_set_plus_cmgc->pdu[0];
897 /* The first octet in pdu is length of sca */
898
899 if (sca_len > ((MAX_SMS_ADDR_DIG+1)/2) + 1)
900 {
901 TRACE_ERROR("SCA too long !!!");
902 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
903 return (ACI_BAT_FAIL);
904 }
905 /*
906 pdu_message_octets_length = (cmd->params.ptr_set_plus_cmgc->length-2-sca_len*2)/2;
907
908 if(pdu_message_octets_length NEQ cmd->params.ptr_set_plus_cmgc->length)
909 {
910 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
911 TRACE_EVENT("ERROR: input pdu message length in cmgc do not match the real length!");
912 return (ACI_BAT_FAIL);
913 }
914 length paramter is not present in cmgc struct ??? its there in old ati code
915 */
916 memcpy(pdu.data,cmd->params.ptr_set_plus_cmgc->pdu,cmd->params.ptr_set_plus_cmgc->c_pdu);
917 pdu.len = cmd->params.ptr_set_plus_cmgc->c_pdu ;
918 ret = (T_ACI_BAT_RSLT)sAT_PlusCMGCPdu ( (T_ACI_CMD_SRC)src_infos_psi->srcId, &pdu );
919
920 return (ret);
921 }
922
923 /*
924 +--------------------------------------------------------------------+
925 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
926 | STATE : code ROUTINE : sBAT_PlusCMGL |
927 +--------------------------------------------------------------------+
928
929 PURPOSE :
930 */
931 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMGL (T_ACI_DTI_PRC_PSI *src_infos_psi,
932 T_BAT_cmd_send *cmd)
933 {
934 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
935
936 TRACE_FUNCTION ("sBAT_PlusCMGL()");
937
938 ret = (T_ACI_BAT_RSLT)sAT_PlusCMGL ( (T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_SMS_STAT)cmd->params.ptr_set_plus_cmgl->stat, 0, SMS_READ_Normal );
939
940 return (ret);
941 }
942
943 /*
944 +--------------------------------------------------------------------+
945 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
946 | STATE : code ROUTINE : sBAT_PercentCMGL |
947 +--------------------------------------------------------------------+
948
949 PURPOSE :
950 */
951 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCMGL (T_ACI_DTI_PRC_PSI *src_infos_psi,
952 T_BAT_cmd_send *cmd)
953 {
954 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
955 #ifdef SMS_PDU_SUPPORT
956 T_ACI_CMGF_MOD mode;
957 #endif
958 CHAR *txtRdMode = NULL;
959 CHAR *txtStat = NULL;
960 USHORT i;
961
962 TRACE_FUNCTION ("sBAT_PercentCMGL()");
963
964 #ifdef SMS_PDU_SUPPORT
965 /*
966 * request current mode
967 */
968 qAT_PlusCMGF((T_ACI_CMD_SRC)src_infos_psi->srcId, &mode);
969 if (mode EQ 0)
970 {
971 /*
972 * %CMGL=[stat],[preview]
973 */
974 smsReadMode = (T_ACI_SMS_READ)cmd->params.ptr_set_percent_cmgl->rdmode;
975 cmglStat = (T_ACI_SMS_STAT)cmd->params.ptr_set_percent_cmgl->stat;
976 if ( ((cmglStat < SMS_STAT_RecUnread OR cmglStat > SMS_STAT_All)
977 AND smsReadMode EQ SMS_READ_NotPresent)
978 OR (smsReadMode < (T_ACI_SMS_READ)SMS_STAT_RecUnread AND smsReadMode > SMS_READ_NotPresent)
979 OR (smsReadMode > SMS_READ_StatusChange))
980 {
981 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
982 return (ACI_BAT_FAIL);
983 }
984 }
985 else
986 #endif
987 {
988 txtStat = (char*)&cmd->params.ptr_set_percent_cmgl->stat;
989 txtRdMode = (char*)&cmd->params.ptr_set_percent_cmgl->rdmode;
990 if (txtStat[0] EQ '\0')
991 {
992 strcpy (txtStat, sms_stat[4].name); /* ALL as default */
993 }
994 i = 0;
995 while ( sms_stat[i].name NEQ NULL AND
996 strcmp ( sms_stat[i].name, txtStat ) NEQ 0 )
997 i++;
998
999 if ( sms_stat[i].name EQ NULL )
1000 {
1001 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_OpNotAllowed);
1002 return (ACI_BAT_FAIL);
1003 }
1004 cmglStat = sms_stat[i].stat;
1005
1006 if (txt_rdmode_to_smsrdmode(txtRdMode) EQ ATI_FAIL)
1007 {
1008 return (ACI_BAT_FAIL);
1009 }
1010 }
1011
1012 ret = (T_ACI_BAT_RSLT)sAT_PercentCMGL ( (T_ACI_CMD_SRC)src_infos_psi->srcId, cmglStat, smsReadMode );
1013
1014 return (ret);
1015 }
1016
1017 /*
1018 +--------------------------------------------------------------------+
1019 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1020 | STATE : code ROUTINE : sBAT_PlusCNMI |
1021 +--------------------------------------------------------------------+
1022
1023 PURPOSE :
1024 */
1025
1026
1027 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCNMI (T_ACI_DTI_PRC_PSI *src_infos_psi,
1028 T_BAT_cmd_send *cmd)
1029 {
1030 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
1031
1032 TRACE_FUNCTION ("sBAT_PlusCNMI()");
1033
1034 ret = (T_ACI_BAT_RSLT)sAT_PlusCNMI ( (T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_CNMI_MT)cmd->params.ptr_set_plus_cnmi->mt, (T_ACI_CNMI_BM)cmd->params.ptr_set_plus_cnmi->bm, (T_ACI_CNMI_DS)cmd->params.ptr_set_plus_cnmi->ds );
1035 switch(ret)
1036 {
1037 case ACI_BAT_CMPL :
1038 if(src_infos_psi->srcId NEQ CMD_SRC_LCL)
1039 {
1040 smsShrdPrm.smsSrcId = (T_ACI_CMD_SRC)src_infos_psi->srcId;
1041 }
1042 /*lint -fallthrough*/
1043 default :
1044 return(ret);
1045 }
1046 }
1047
1048 /*
1049 +--------------------------------------------------------------------+
1050 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1051 | STATE : code ROUTINE : qBAT_PlusCNMI |
1052 +--------------------------------------------------------------------+
1053
1054 PURPOSE :
1055 */
1056 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCNMI (T_ACI_DTI_PRC_PSI *src_infos_psi,
1057 T_BAT_cmd_send *cmd)
1058 {
1059 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
1060 T_BAT_plus_cnmi_mt mt = BAT_CNMI_MT_NOT_PRESENT; /*< 0: 4> (enum=32bit)<->T_BAT_plus_cnmi_mt Indication routing for SMS-DELIVERs */
1061 T_BAT_plus_cnmi_bm bm = BAT_CNMI_BM_NOT_PRESENT; /*< 4: 4> (enum=32bit)<->T_BAT_plus_cnmi_bm Indication routing for CBMs */
1062 T_BAT_plus_cnmi_ds ds = BAT_CNMI_DS_NOT_PRESENT;
1063 T_BAT_cmd_response resp;
1064 T_BAT_res_que_plus_cnmi que_cnmi_buffer;
1065
1066 TRACE_FUNCTION ("qBAT_PlusCNMI()");
1067
1068 resp.ctrl_response = BAT_RES_QUE_PLUS_CNMI;
1069 resp.response.ptr_que_plus_cnmi = &que_cnmi_buffer;
1070
1071 ret = (T_ACI_BAT_RSLT)qAT_PlusCNMI ( (T_ACI_CMD_SRC)src_infos_psi->srcId,(T_ACI_CNMI_MT*)&mt,(T_ACI_CNMI_BM*)&bm,(T_ACI_CNMI_DS*)&ds );
1072 switch(ret)
1073 {
1074 case ACI_BAT_CMPL :
1075 resp.response.ptr_que_plus_cnmi->mt = mt;
1076 resp.response.ptr_que_plus_cnmi->bm = bm;
1077 resp.response.ptr_que_plus_cnmi->ds = ds;
1078 aci_bat_send(src_infos_psi,&resp);
1079 /*lint -fallthrough*/
1080 default :
1081 return (ret);
1082 }
1083 }
1084
1085 #ifdef TI_PS_FF_AT_P_CMD_CPRSM
1086 /*
1087 +--------------------------------------------------------------------+
1088 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1089 | STATE : code ROUTINE : sBAT_PercentCPRSM |
1090 +--------------------------------------------------------------------+
1091
1092 PURPOSE :
1093 */
1094 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCPRSM (T_ACI_DTI_PRC_PSI *src_infos_psi,
1095 T_BAT_cmd_send *cmd)
1096 {
1097 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
1098 //T_ACI_CPRSM_MOD mode = CPRSM_MOD_NotPresent;
1099
1100 TRACE_FUNCTION ("sBAT_PercentCPRSM()");
1101
1102 ret = (T_ACI_BAT_RSLT)sAT_PercentCPRSM((T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_CPRSM_MOD)cmd->params.ptr_set_percent_cprsm->mode);
1103 switch (ret)
1104 {
1105 case (ACI_BAT_CMPL):
1106 case (ACI_BAT_EXCT):
1107 {
1108 break;
1109 }
1110 default:
1111 {
1112 TRACE_EVENT_P1("+CPRSM ERROR: undefined result: %d", ret);
1113 ACI_ERR_DESC(ACI_ERR_CLASS_Cms,CMS_ERR_UnknownErr);
1114 return ACI_BAT_FAIL;
1115 }
1116 }
1117 return(ret);
1118 }
1119
1120 /*
1121 +--------------------------------------------------------------------+
1122 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1123 | STATE : code ROUTINE : qBAT_PercentCPRSM |
1124 +--------------------------------------------------------------------+
1125
1126 PURPOSE :
1127 */
1128 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCPRSM (T_ACI_DTI_PRC_PSI *src_infos_psi,
1129 T_BAT_cmd_send *cmd)
1130 {
1131 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
1132
1133 TRACE_FUNCTION ("qBAT_PercentCPRSM()");
1134 ret = (T_ACI_BAT_RSLT)qAT_PercentCPRSM( (T_ACI_CMD_SRC)src_infos_psi->srcId );
1135 /* Does not fill in the response structure? */
1136 /* ACI does not fill in response mode in qAT_PercentCPRSM?*/
1137
1138 return (ret);
1139 }
1140 #endif /* TI_PS_FF_AT_P_CMD_CPRSM */
1141
1142 #ifdef REL99
1143 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCMGRS (T_ACI_DTI_PRC_PSI *src_infos_psi, T_BAT_cmd_send *cmd)
1144 {
1145 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
1146
1147 TRACE_FUNCTION("sBAT_PercentCMGRS()");
1148
1149 if(cmd->params.ptr_set_percent_cmgrs->mode > BAT_CMGRS_MODE_MANUAL_RETRANS)
1150 {
1151 return (ACI_BAT_FAIL);
1152 }
1153
1154 ret = (T_ACI_BAT_RSLT)sAT_PercentCMGRS((T_ACI_CMD_SRC)src_infos_psi->srcId,
1155 (T_ACI_CMGRS_MODE)cmd->params.ptr_set_percent_cmgrs->mode);
1156 return (ret);
1157 }
1158
1159 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCMGRS (T_ACI_DTI_PRC_PSI *src_infos_psi, T_BAT_cmd_send *cmd)
1160 {
1161 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL;
1162 T_BAT_cmd_response resp;
1163 UBYTE auto_rep_flag;
1164 T_BAT_res_que_percent_cmgrs que_cmgrs;
1165
1166 TRACE_FUNCTION ("qBAT_PercentCMGRS()");
1167
1168 resp.ctrl_response = BAT_RES_QUE_PERCENT_CMGRS;
1169 resp.response.ptr_que_percent_cmgrs = &que_cmgrs;
1170
1171 ret = (T_ACI_BAT_RSLT)qAT_PercentCMGRS((T_ACI_CMD_SRC)src_infos_psi->srcId,&auto_rep_flag);
1172
1173 switch(ret)
1174 {
1175 case ACI_BAT_CMPL :
1176 resp.response.ptr_que_percent_cmgrs->mode = (T_BAT_percent_cmgrs_mode)auto_rep_flag;
1177 aci_bat_send(src_infos_psi,&resp);
1178 /*lint -fallthrough*/
1179 default :
1180 return (ret);
1181 }
1182 }
1183 #endif /* REL99 */
1184