comparison src/g23m-aci/aci/aci_bat_cb.c @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-F&D (8411)
4 | Modul : ACI_BAT
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : This BAT callback modul is ...
18 |
19 +-----------------------------------------------------------------------------
20 */
21
22 #include "aci_all.h" /* includes prim.h, which includes p_bat.h */
23
24 #define ACI_BAT_CB_GLOBALS /* define this file as owner of globals in aci_bat_cb.h */
25 #include "aci_bat_cb.h" /* prototypes of sBAT_,qBAT_,tBAT_ */
26
27 #include "psa_psi.h"
28 #include "p_bat.h"
29 #include "aci_bat_err.h"
30 #include "aci_bat.h"
31 #include "aci_cmh.h"
32 #include "psa.h"
33 #include "cmh.h"
34 #include "aci_lst.h"
35 #include "cmh_psi.h"
36 #include "ati_cmd.h"
37 #include "aci_cmd.h"
38 #include "aci_fd.h"
39 #include "cmh_sms.h"
40 #include "cphs.h"
41
42 /*
43 +--------------------------------------------------------------------+
44 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
45 | STATE : code ROUTINE : aci_bat_src_info |
46 +--------------------------------------------------------------------+
47
48 PURPOSE : Can be called from rBAT_ functions in order to find the
49 command source ID and a pointer to the PSI source
50 information.
51 */
52 LOCAL void aci_bat_src_info (T_ACI_CMD_SRC *src_id, T_ACI_DTI_PRC_PSI **psi_src_info)
53 {
54 /*
55 * The source ID is copied from the global variable srcId_cb,
56 * which is set by the macro R_AT.
57 */
58 *src_id=(T_ACI_CMD_SRC)srcId_cb;
59
60 /*
61 * Use the function 'find_element()' to search for the PSI
62 * source that has the correct command source ID.
63 */
64 *psi_src_info=find_element(psi_src_params,srcId_cb,cmhPSItest_srcId);
65 }
66
67 /*
68 +--------------------------------------------------------------------+
69 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
70 | STATE : code ROUTINE : aci_bat_lang_str |
71 +--------------------------------------------------------------------+
72
73 PURPOSE : Work out the string for the indicated language.
74 */
75 LOCAL CHAR *aci_bat_lang_str (T_ACI_LAN_SUP *CLang)
76 {
77 UBYTE i;
78
79 if (CLang EQ NULL)
80 return(NULL);
81
82 /*
83 * If a string is provided, use that.
84 */
85 if (CLang->str)
86 return(CLang->str);
87
88 /*
89 * GSM 07.07 says that "AUTO" should be used for automatic mode.
90 */
91 if (CLang->lng EQ CLAN_LNG_AUT)
92 return("AUTO");
93
94 /*
95 * Use the lookup table 'lngs' to find the string.
96 */
97 for (i=0;lngs[i].str;i++)
98 {
99 if (CLang->lng EQ lngs[i].lng)
100 return(lngs[i].str);
101 }
102
103 return(NULL);
104 }
105
106 /*
107 +--------------------------------------------------------------------+
108 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
109 | STATE : code ROUTINE : rBAT_OK |
110 +--------------------------------------------------------------------+
111
112 PURPOSE :
113 */
114 GLOBAL void rBAT_OK(
115 T_ACI_AT_CMD cmd)
116 {
117 T_ACI_CMD_SRC src_id;
118 T_ACI_DTI_PRC_PSI *src_infos;
119 T_BAT_cmd_response resp;
120 T_BAT_no_parameter dummy;
121
122 TRACE_FUNCTION ("rBAT_OK()");
123
124 /*
125 * Get the source ID and a pointer to the PSI source information.
126 */
127 aci_bat_src_info(&src_id,&src_infos);
128
129 if (cmd EQ AT_CMD_D)
130 {
131 /*
132 * We are not waiting for a final response to ATD any more.
133 */
134 src_infos->bat_client[src_infos->active_client].atd_live=FALSE;
135 }
136
137 resp.ctrl_response=BAT_RES_AT_OK;
138
139 resp.response.ptr_at_ok = &dummy;
140 dummy.bat_dummy = 0xFF;
141
142 if (src_infos->bat_client[src_infos->active_client].curCmd EQ (T_BAT_ctrl_params)BATC_ABORT_COMMAND_CNF)/*lint !e650 (Warning - constant out of range for operator) */
143 {
144 T_BATC_confirm confirm;
145 T_BATC_abort_cmd abort_cmd;
146 confirm.rsp_params = BATC_ABORT_COMMAND_CNF;
147 abort_cmd.client_id = src_infos->active_client;
148 confirm.rsp.ptr_bat_abort_command_cnf = &abort_cmd;
149 aci_bat_send(src_infos,(T_BAT_cmd_response *)&confirm);
150 return;
151 }
152
153 #ifdef _SIMULATION_
154 src_infos->bat_client[src_infos->active_client].curCmd = (T_BAT_ctrl_params)-1;
155 #endif
156
157 aci_bat_send(src_infos,&resp);
158
159 /* check for possible next command queued */
160 aci_bat_run_cmd (src_infos);
161 }
162
163 /*
164 +--------------------------------------------------------------------+
165 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
166 | STATE : code ROUTINE : rBAT_CONNECT |
167 +--------------------------------------------------------------------+
168
169 PURPOSE :
170 */
171 GLOBAL void rBAT_CONNECT(
172 T_ACI_AT_CMD cmdId,
173 T_ACI_BS_SPEED speed,
174 SHORT cId,
175 BOOL flow_cntr)
176 {
177 T_ACI_CMD_SRC src_id;
178 T_ACI_DTI_PRC_PSI *src_infos;
179 T_BAT_res_at_connect connect_data;
180 T_BAT_cmd_response resp;
181
182 TRACE_FUNCTION ("rBAT_CONNECT()");
183
184 /*
185 * Get the source ID and a pointer to the PSI source information.
186 */
187 aci_bat_src_info(&src_id,&src_infos);
188
189 /*
190 * We are not waiting for a final response to ATD any more.
191 */
192 src_infos->bat_client[src_infos->active_client].atd_live=FALSE;
193
194 resp.ctrl_response=BAT_RES_AT_CONNECT;
195 resp.response.ptr_at_connect=&connect_data;
196
197 /*
198 * The ACI and BAT versions of 'speed' are quite a bit different,
199 * so we need this conversion. Note that we will be losing
200 * the "cmdId" and "cId" as these are not in the BAT.
201 */
202 switch(speed)
203 {
204 default:
205 case BS_SPEED_NotPresent:
206 case BS_SPEED_AUTO:
207 case BS_SPEED_28800_V110:
208 connect_data.data_rate=BAT_AT_CONNECT_RATE_NOT_PRESENT;
209 break;
210
211 case BS_SPEED_300_V21:
212 case BS_SPEED_300_V110:
213 connect_data.data_rate=BAT_AT_CONNECT_RATE_300;
214 break;
215
216 case BS_SPEED_1200_V22:
217 case BS_SPEED_1200_75_V23:
218 case BS_SPEED_1200_V120:
219 case BS_SPEED_1200_V110:
220 connect_data.data_rate=BAT_AT_CONNECT_RATE_1200;
221 break;
222
223 case BS_SPEED_2400_V22bis:
224 case BS_SPEED_2400_V26ter:
225 case BS_SPEED_2400_V120:
226 case BS_SPEED_2400_V110:
227 connect_data.data_rate=BAT_AT_CONNECT_RATE_2400;
228 break;
229
230 case BS_SPEED_4800_V32:
231 case BS_SPEED_4800_V120:
232 case BS_SPEED_4800_V110:
233 connect_data.data_rate=BAT_AT_CONNECT_RATE_4800;
234 break;
235
236 case BS_SPEED_9600_V32:
237 case BS_SPEED_9600_V34:
238 case BS_SPEED_9600_V120:
239 case BS_SPEED_9600_V110:
240 connect_data.data_rate=BAT_AT_CONNECT_RATE_9600;
241 break;
242
243 case BS_SPEED_14400_V34:
244 case BS_SPEED_14400_V120:
245 case BS_SPEED_14400_V110:
246 connect_data.data_rate=BAT_AT_CONNECT_RATE_14400;
247 break;
248
249 case BS_SPEED_19200_V110:
250 connect_data.data_rate=BAT_AT_CONNECT_RATE_19200;
251 break;
252
253 case BS_SPEED_38400_V110:
254 connect_data.data_rate=BAT_AT_CONNECT_RATE_38400;
255 break;
256 }
257
258 aci_bat_send(src_infos,&resp);
259
260 /* check for possible next command queued */
261 aci_bat_run_cmd (src_infos);
262 }
263
264 /*
265 +--------------------------------------------------------------------+
266 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
267 | STATE : code ROUTINE : rBAT_PlusCME |
268 +--------------------------------------------------------------------+
269
270 PURPOSE :
271 */
272 GLOBAL void rBAT_PlusCME(
273 T_ACI_AT_CMD cmdId,
274 T_ACI_CME_ERR err)
275 {
276 T_BAT_cmd_response resp;
277 T_BAT_res_plus_cme_error error_data;
278 T_ACI_CMD_SRC src_id;
279 T_ACI_DTI_PRC_PSI *src_infos;
280
281 TRACE_FUNCTION ("rBAT_PlusCME()");
282
283 /*
284 * Get the source ID and a pointer to the PSI source information.
285 */
286 aci_bat_src_info(&src_id,&src_infos);
287
288 resp.ctrl_response=BAT_RES_PLUS_CME_ERROR;
289 resp.response.ptr_plus_cme_error=&error_data;
290
291
292 /* If the err is NotPresent or Unknown try to get the CME error
293 from aciErrDesc and display to the terminal */
294 if ((err EQ CME_ERR_NotPresent) OR (err EQ CME_ERR_Unknown))
295 {
296 if (ACI_BAT_GET_ERR_CLASS() EQ ACI_ERR_CLASS_Cme)
297 {
298 err = (T_ACI_CME_ERR) ( ACI_BAT_GET_ERR_VALUE() );
299 ACI_BAT_RESET_ERR_DESC();
300 }
301 }
302
303 #ifdef TI_PS_FF_BAT_CPHS_ERR_RES
304 /*
305 * Valid CME Error for %CPHS if CPHS not supported by SIM
306 * Customer specific. Put under custom flag TI_PS_FF_BAT_CPHS_ERR_RES
307 */
308 if (cmdId EQ AT_CMD_CPHS AND
309 cphs_check_status() EQ CPHS_NOT_INIT)
310 {
311 err = CME_ERR_OpNotSupp;
312 }
313 #endif /* TI_PS_FF_BAT_CPHS_ERR_RES */
314
315 /*
316 * This relies on T_ACI_CME_ERR being the same as
317 * T_BAT_plus_cme_error_error, which (apart from a couple of
318 * omissions in each enumeration) it is.
319 */
320 resp.response.ptr_plus_cme_error->error=(T_BAT_plus_cme_error_error)err;
321
322 aci_bat_send(src_infos,&resp);
323
324 /* check for possible next command queued */
325 aci_bat_run_cmd (src_infos);
326 }
327
328 /*
329 +--------------------------------------------------------------------+
330 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
331 | STATE : code ROUTINE : rBAT_NO_CARRIER |
332 +--------------------------------------------------------------------+
333
334 PURPOSE :
335 */
336 GLOBAL void rBAT_NO_CARRIER(
337 T_ACI_AT_CMD cmdId,
338 SHORT cId)
339 {
340 T_ACI_CMD_SRC src_id;
341 T_ACI_DTI_PRC_PSI *src_infos;
342 T_BAT_cmd_response resp;
343 T_BAT_no_parameter dummy;
344
345 TRACE_FUNCTION ("rBAT_NO_CARRIER()");
346
347 /*
348 * Get the source ID and a pointer to the PSI source information.
349 */
350 aci_bat_src_info(&src_id,&src_infos);
351
352 /*
353 * atd_live is TRUE, send final response else unsolicited response.
354 */
355 if(src_infos->bat_client[src_infos->active_client].atd_live EQ TRUE)
356 {
357 src_infos->bat_client[src_infos->active_client].atd_live=FALSE;
358 resp.ctrl_response = BAT_RES_AT_NO_CARRIER_FINAL;
359 resp.response.ptr_at_no_carrier_final = &dummy;
360 }
361 else
362 {
363 resp.ctrl_response = BAT_RES_UNS_AT_NO_CARRIER;
364 resp.response.ptr_res_uns_at_no_carrier = &dummy;
365 }
366
367 dummy.bat_dummy = 0xFF;
368 aci_bat_send(src_infos,&resp);
369
370 /* check for possible next command queued */
371 aci_bat_run_cmd (src_infos);
372 }
373
374 /*
375 +--------------------------------------------------------------------+
376 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
377 | STATE : code ROUTINE : rBAT_PlusCRING |
378 +--------------------------------------------------------------------+
379
380 PURPOSE :
381 */
382 GLOBAL void rBAT_PlusCRING(
383 T_ACI_CRING_MOD mode,
384 T_ACI_CRING_SERV_TYP type1,
385 T_ACI_CRING_SERV_TYP type2)
386 {
387 T_BAT_cmd_response resp;
388 T_BAT_res_uns_plus_cring cring_data;
389 T_ACI_CMD_SRC src_id;
390 T_ACI_DTI_PRC_PSI *src_infos;
391
392 TRACE_FUNCTION ("rBAT_PlusCRING()");
393
394 /*
395 * Get the source ID and a pointer to the PSI source information.
396 */
397 aci_bat_src_info(&src_id,&src_infos);
398
399 resp.ctrl_response=BAT_RES_UNS_PLUS_CRING;
400 resp.response.ptr_plus_cring=&cring_data;
401
402 /*
403 * This relies on T_ACI_CRING_SERV_TYP being the same as
404 * T_BAT_cring_type/T_BAT_plus_cring_type2.
405 */
406 cring_data.type1=(T_BAT_cring_type)type1;
407 cring_data.type2=(T_BAT_plus_cring_type2)type2;
408
409 /*
410 * This relies on T_ACI_CRING_MOD being the same as
411 * T_BAT_plus_cring_alt.
412 */
413 cring_data.alt=(T_BAT_plus_cring_alt)mode;
414
415 /*
416 * Mark as not present all the information in the BAT message
417 * that we don't have.
418 */
419 cring_data.v_pdp_addr=FALSE;
420 cring_data.v_l2p=FALSE;
421 cring_data.pdp_type=BAT_PDP_TYPE_NOT_PRESENT;
422
423 aci_bat_send(src_infos,&resp);
424 }
425
426 /*
427 +--------------------------------------------------------------------+
428 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
429 | STATE : code ROUTINE : rBAT_PlusDR |
430 +--------------------------------------------------------------------+
431
432 PURPOSE :
433 */
434 GLOBAL void rBAT_PlusDR(
435 T_ACI_DR_TYP type)
436 {
437 #ifndef FF_ATI_BAT
438
439 /*
440 * This is not included in the BAT interface, so ignore it.
441 */
442 TRACE_FUNCTION ("rBAT_PlusDR() - IGNORED");
443
444 #else
445
446 /*
447 * But for test purposes, fake a response by calling the equivalent
448 * ATI function directly.
449 */
450 TRACE_FUNCTION ("rBAT_PlusDR() - FAKE");
451 rCI_PlusDR(type);
452
453 #endif
454 }
455
456 /*
457 +--------------------------------------------------------------------+
458 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
459 | STATE : code ROUTINE : rBAT_PlusCR |
460 +--------------------------------------------------------------------+
461
462 PURPOSE :
463 */
464 GLOBAL void rBAT_PlusCR(
465 T_ACI_CRING_SERV_TYP service)
466 {
467 T_BAT_cmd_response resp;
468 T_BAT_res_uns_plus_cr cr_data;
469 T_ACI_CMD_SRC src_id;
470 T_ACI_DTI_PRC_PSI *src_infos;
471 CHAR *s;
472 UBYTE len;
473
474 TRACE_FUNCTION ("rBAT_PlusCR()");
475
476 /*
477 * Get the source ID and a pointer to the PSI source information.
478 */
479 aci_bat_src_info(&src_id,&src_infos);
480
481 resp.ctrl_response=BAT_RES_UNS_PLUS_CR;
482 resp.response.ptr_res_plus_cr=&cr_data;
483
484 switch(service)
485 {
486 case CRING_SERV_TYP_Async:
487 s="ASYNC";
488 break;
489
490 case CRING_SERV_TYP_Sync:
491 s="SYNC";
492 break;
493
494 case CRING_SERV_TYP_RelAsync:
495 s="REL ASYNC";
496 break;
497
498 case CRING_SERV_TYP_RelSync:
499 s="REL SYNC";
500 break;
501
502 #ifdef GPRS
503 case CRING_SERV_TYP_GPRS:
504 s="GPRS";
505 break;
506 #endif
507
508 default:
509 /*
510 * Unrecognised value, get out now.
511 */
512 return;
513 }
514
515 len=strlen(s);
516
517 /*
518 * Check that we have enough room in the BAT structure, if we
519 * haven't we may as well give up at this point.
520 */
521 if (len>BAT_MAX_CR_SERV_LEN)
522 return;
523
524 /*
525 * Copy the data into the BAT structure and set the counter.
526 */
527 memcpy(cr_data.serv,s,BAT_MAX_CR_SERV_LEN);
528 cr_data.c_serv=(U8)len;
529
530 aci_bat_send(src_infos,&resp);
531 }
532
533 /*
534 +--------------------------------------------------------------------+
535 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
536 | STATE : code ROUTINE : rBAT_PlusCPIN |
537 +--------------------------------------------------------------------+
538
539 PURPOSE : Response to qBAT_PlusCPIN(). Also see simactivated_cpinresult().
540 */
541 GLOBAL void rBAT_PlusCPIN(
542 T_ACI_CPIN_RSLT code)
543 {
544 T_ACI_CMD_SRC src_id;
545 T_ACI_DTI_PRC_PSI *src_infos;
546 T_BAT_cmd_response resp;
547 T_BAT_res_que_plus_cpin cpin_data;
548
549 TRACE_FUNCTION ("rBAT_PlusCPIN()");
550
551 /*
552 * Get the source ID and a pointer to the PSI source information.
553 */
554 aci_bat_src_info(&src_id,&src_infos);
555
556 resp.ctrl_response=BAT_RES_QUE_PLUS_CPIN;
557 resp.response.ptr_que_plus_cpin=&cpin_data;
558
559 /*
560 * Warning - this assumes that T_ACI_CPIN_RSLT and
561 * T_BAT_VAL_plus_cpin_code are eqivalent. They are, except that
562 * T_ACI_CPIN_RSLT has extra values not in the BAT.
563 */
564 resp.response.ptr_que_plus_cpin->code=(T_BAT_VAL_plus_cpin_code)code;
565
566 aci_bat_send(src_infos,&resp);
567 }
568
569 /*
570 +--------------------------------------------------------------------+
571 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
572 | STATE : code ROUTINE : rBAT_PlusCOPS |
573 +--------------------------------------------------------------------+
574
575 PURPOSE : See cmhMM_NetworkLst() for how this is used.
576 */
577 GLOBAL void rBAT_PlusCOPS(
578 SHORT lastIdx,
579 T_ACI_COPS_OPDESC *operLst)
580 {
581 T_ACI_CMD_SRC src_id;
582 T_ACI_DTI_PRC_PSI *src_infos;
583 T_BAT_cmd_response resp;
584 T_BAT_res_tst_plus_cops cops_data;
585 USHORT n;
586
587 TRACE_FUNCTION ("rBAT_PlusCOPS()");
588
589 /*
590 * Get the source ID and a pointer to the PSI source information.
591 */
592 aci_bat_src_info(&src_id,&src_infos);
593
594 resp.ctrl_response=BAT_RES_TST_PLUS_COPS;
595 resp.response.ptr_tst_plus_cops=&cops_data;
596
597 /*
598 * This has delivered a list, however the BAT response only
599 * allows for single items. So we must send each one
600 * individually. The use of null values of longOper and
601 * shortOper as list terminators is as in rAT_PlusCOPS().
602 */
603 n=0;
604
605 while ((operLst[n].longOper) AND (operLst[n].shortOper))
606 {
607 /*
608 * This assumes that T_BAT_VAL_plus_cops_status and T_ACI_COPS_STAT
609 * are identical (currently they are).
610 */
611 cops_data.status=(T_BAT_plus_cops_status)operLst[n].status;
612
613 /*
614 * Need to check this. Are all the operator names necessarily
615 * present?
616 */
617 strncpy((CHAR *)cops_data.long_oper,operLst[n].longOper,BAT_MAX_COPS_LONG_OPER_LEN);
618 cops_data.v_long_oper=TRUE;
619 cops_data.c_long_oper=strlen((CHAR*)cops_data.long_oper);
620
621 strncpy((CHAR *)cops_data.short_oper,operLst[n].shortOper,BAT_MAX_COPS_SHORT_OPER_LEN);
622 cops_data.v_short_oper=TRUE;
623 cops_data.c_short_oper=strlen((CHAR*)cops_data.short_oper);
624
625 strncpy((CHAR *)cops_data.num_oper,operLst[n].numOper,BAT_MAX_COPS_NUM_OPER_LEN);
626 cops_data.v_num_oper=TRUE;
627 cops_data.c_num_oper=strlen((CHAR*)cops_data.num_oper);
628
629 aci_bat_send(src_infos,&resp);
630
631 n++;
632 }
633 }
634
635 /*
636 +--------------------------------------------------------------------+
637 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
638 | STATE : code ROUTINE : rBAT_PercentCOPS |
639 +--------------------------------------------------------------------+
640
641 PURPOSE :
642 */
643 GLOBAL void rBAT_PercentCOPS(
644 SHORT lastIdx,
645 T_ACI_COPS_OPDESC *operLst)
646 {
647
648 #ifndef FF_ATI_BAT
649
650 /*
651 * This is not included in the BAT interface, so ignore it.
652 */
653 TRACE_FUNCTION ("rBAT_PercentCOPS() - IGNORED");
654
655 #else
656
657 /*
658 * But for test purposes, fake a response by calling the equivalent
659 * ATI function directly.
660 */
661 TRACE_FUNCTION ("rBAT_PercentCOPS() - FAKE");
662 rCI_PercentCOPS(lastIdx,operLst);
663
664 #endif
665
666 }
667
668 /*
669 +--------------------------------------------------------------------+
670 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
671 | STATE : code ROUTINE : rBAT_PlusCREG |
672 +--------------------------------------------------------------------+
673
674 PURPOSE : Notification of registration status. There is no +CREG in
675 BAT, so we use %CREG instead.
676 */
677 GLOBAL void rBAT_PlusCREG(
678 T_ACI_CREG_STAT status,
679 USHORT lac,
680 USHORT cid)
681 {
682 T_ACI_CMD_SRC src_id;
683 T_ACI_DTI_PRC_PSI *src_infos;
684 T_BAT_cmd_response resp;
685 T_BAT_res_uns_percent_creg creg_data;
686
687 TRACE_FUNCTION ("rBAT_PlusCREG()");
688
689 /*
690 * Get the source ID and a pointer to the PSI source information.
691 */
692 aci_bat_src_info(&src_id,&src_infos);
693
694 resp.ctrl_response=BAT_RES_UNS_PERCENT_CREG;
695 resp.response.ptr_res_percent_creg=&creg_data;
696
697 /*
698 * This relies on T_ACI_CREG_STAT and T_BAT_percent_creg_stat being
699 * identical.
700 */
701 creg_data.stat=(T_BAT_percent_creg_stat)status;
702
703 creg_data.lac=(S32)lac;
704 creg_data.ci=(S32)cid;
705 creg_data.gprs_ind=BAT_P_CREG_GPRS_IND_UNKNOWN;
706
707 aci_bat_send(src_infos,&resp);
708 }
709
710 /*
711 +--------------------------------------------------------------------+
712 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
713 | STATE : code ROUTINE : rBAT_PlusCCWA |
714 +--------------------------------------------------------------------+
715
716 PURPOSE :
717 */
718 GLOBAL void rBAT_PlusCCWA(
719 T_ACI_CLSSTAT *clsStat,
720 CHAR *number,
721 T_ACI_TOA *type,
722 U8 validity,
723 T_ACI_CLASS class_type,
724 #ifdef NO_ASCIIZ
725 T_ACI_PB_TEXT *alpha)
726 #else
727 CHAR *alpha)
728 #endif
729 {
730 T_ACI_CMD_SRC src_id;
731 T_ACI_DTI_PRC_PSI *src_infos;
732 T_BAT_cmd_response resp;
733 T_BAT_res_uns_plus_ccwa ccwa_data;
734 T_BAT_res_set_plus_ccwa ccwa_q_data;
735 T_ACI_CLASS test_class;
736 UBYTE len;
737
738 TRACE_FUNCTION ("rBAT_PlusCCWA()");
739
740 /*
741 * Get the source ID and a pointer to the PSI source information.
742 */
743 aci_bat_src_info(&src_id,&src_infos);
744
745 if(clsStat) /*Callback for sBAT_PlusCCWA guery (mode 2)*/
746 {
747 resp.ctrl_response = BAT_RES_SET_PLUS_CCWA;
748 resp.response.ptr_set_plus_ccwa = &ccwa_q_data;
749
750 if (clsStat->status EQ STATUS_Active)
751 {
752 //src_params->curAtCmd = AT_CMD_NONE;
753 test_class = CLASS_Vce;
754 while( test_class < 2*CLASS_Fax )
755 {
756 if( clsStat->class_type & test_class )
757 {
758 TRACE_EVENT_P1("test_class: %d", test_class);
759 ccwa_q_data.status = (T_BAT_plus_ccwa_status)clsStat->status;
760 ccwa_q_data.bearer_class = (T_BAT_plus_ccwa_bearer_class)test_class;
761
762 aci_bat_send(src_infos,&resp);
763 }
764 test_class *= CLASS_Dat; /* test next class */
765 }
766 }
767 else
768 {
769
770 ccwa_q_data.status = (T_BAT_plus_ccwa_status)clsStat->status;
771 ccwa_q_data.bearer_class = BAT_CCWA_CLASS_NOT_PRESENT;
772
773 aci_bat_send(src_infos,&resp);
774 }
775
776 }
777 else
778 {
779 resp.ctrl_response=BAT_RES_UNS_PLUS_CCWA;
780 resp.response.ptr_res_plus_ccwa=&ccwa_data;
781
782 if (number EQ NULL)
783 {
784 ccwa_data.number[0]=0;
785 ccwa_data.c_number=0;
786 }
787 else
788 {
789 len=strlen(number);
790
791 if (len<=BAT_MAX_CCWA_NUMBER_LEN)
792 {
793 memcpy(ccwa_data.number,number,len);
794 ccwa_data.c_number=(U8)len;
795 }
796 else
797 {
798 /*
799 * This is highly unlikely to happen, but if the number is too
800 * big, then put as many digits as will fit in the BAT structure
801 * from the END of the number.
802 */
803 memcpy(
804 ccwa_data.number,
805 number+(len-BAT_MAX_CCWA_NUMBER_LEN),
806 BAT_MAX_CCWA_NUMBER_LEN);
807
808 ccwa_data.c_number=(U8)BAT_MAX_CCWA_NUMBER_LEN;
809 }
810 }
811
812 if (type EQ NULL)
813 {
814 /*
815 * This is mandatory in the BAT so we have to do something here.
816 */
817 T_ACI_TOA t;
818
819 t.npi=NPI_Unknown;
820 t.ton=TON_Unknown;
821
822 ccwa_data.type=(U8)toa_merge(t);
823 }
824 else
825 {
826 ccwa_data.type=(U8)toa_merge(*type);
827 }
828
829 /*
830 * This relies on T_ACI_CLASS being equivalent to
831 * T_BAT_plus_ccwa_bearer_class.
832 */
833 ccwa_data.bearer_class=(T_BAT_plus_ccwa_bearer_class)class_type;
834
835 /*
836 * Alphanumeric data
837 */
838 if (alpha NEQ NULL)
839 {
840 USHORT len=0;
841
842 ccwa_data.v_alpha=TRUE;
843
844 #ifdef NO_ASCIIZ
845
846 utl_chsetFromSim(
847 alpha->data,
848 alpha->len,
849 ccwa_data.alpha,
850 BAT_MAX_PHB_NUM_LEN,
851 &len,
852 GSM_ALPHA_Def);
853
854 #else
855
856 utl_chsetFromSim(
857 alpha,
858 strlen(alpha),
859 ccwa_data.alpha,
860 BAT_MAX_PHB_NUM_LEN,
861 &len,
862 GSM_ALPHA_Int);
863
864 #endif
865
866 ccwa_data.c_alpha=(U8)len;
867 }
868 else
869 {
870 ccwa_data.v_alpha=FALSE;
871 }
872
873 ccwa_data.cli=(T_BAT_cli)validity;
874
875 aci_bat_send(src_infos,&resp);
876 }
877 }
878
879 /*
880 +--------------------------------------------------------------------+
881 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
882 | STATE : code ROUTINE : rBAT_PlusCLIP |
883 +--------------------------------------------------------------------+
884
885 PURPOSE :
886 */
887 GLOBAL void rBAT_PlusCLIP(
888 T_ACI_CLIP_STAT stat,
889 CHAR *number,
890 T_ACI_TOA * type,
891 U8 validity,
892 CHAR *subaddr,
893 T_ACI_TOS *satype,
894 #ifdef NO_ASCIIZ
895 T_ACI_PB_TEXT *alpha)
896 #else
897 CHAR *alpha)
898 #endif /*NO_ASCIIZ*/
899 {
900 T_ACI_CMD_SRC src_id;
901 T_ACI_DTI_PRC_PSI *src_infos;
902 T_BAT_cmd_response resp;
903 T_BAT_res_uns_plus_clip clip_data;
904 T_BAT_res_que_plus_clip que_clip_buffer;
905 UBYTE len;
906
907 TRACE_FUNCTION ("rBAT_PlusCLIP()");
908
909 /*
910 * Get the source ID and a pointer to the PSI source information.
911 */
912 aci_bat_src_info(&src_id,&src_infos);
913
914 if( stat EQ CLIP_STAT_NotPresent )
915 {
916 resp.response.ptr_res_plus_clip=&clip_data;
917 resp.ctrl_response=BAT_RES_UNS_PLUS_CLIP;
918 if (number EQ NULL)
919 {
920 clip_data.number[0]=0;
921 clip_data.c_number=0;
922 }
923 else
924 {
925 len=strlen(number);
926
927 if (len<=BAT_MAX_CLIP_NUMBER_LEN)
928 {
929 memcpy(clip_data.number,number,len);
930 clip_data.c_number=(U8)len;
931 }
932 else
933 {
934 /*
935 * This is highly unlikely to happen, but if the number is too
936 * big, then put as many digits as will fit in the BAT structure
937 * from the END of the number.
938 */
939 memcpy(
940 clip_data.number,
941 number+(len-BAT_MAX_CLIP_NUMBER_LEN),
942 BAT_MAX_CLIP_NUMBER_LEN);
943
944 clip_data.c_number=(U8)BAT_MAX_CLIP_NUMBER_LEN;
945 }
946 }
947
948 if (type EQ NULL)
949 {
950 /*
951 * This is mandatory in the BAT so we have to do something here.
952 */
953 T_ACI_TOA t;
954
955 t.npi=NPI_Unknown;
956 t.ton=TON_Unknown;
957
958 clip_data.type=(U8)toa_merge(t);
959 }
960 else
961 {
962 clip_data.type=(U8)toa_merge(*type);
963 }
964
965 if (subaddr EQ NULL)
966 {
967 clip_data.v_subaddr=FALSE;
968 clip_data.satype=-1;
969 }
970 else
971 {
972 clip_data.v_subaddr=TRUE;
973
974 if (satype EQ NULL)
975 clip_data.satype=-1;
976 else
977 clip_data.satype=(S16)tos_merge(*satype);
978
979 len=strlen(subaddr);
980
981 /*
982 * Easiest thing to do is copy as much subaddress data as the
983 * BAT structure can take. The length field will ensure that
984 * there are no problems, and will result in the subaddress
985 * being truncated if it is too long.
986 */
987 memcpy(clip_data.subaddr,subaddr,BAT_MAX_SUBADDR_LENGTH);
988
989 if (len>BAT_MAX_SUBADDR_LENGTH)
990 clip_data.c_subaddr=BAT_MAX_SUBADDR_LENGTH;
991 else
992 clip_data.c_subaddr=len;
993 }
994
995 clip_data.cli=(T_BAT_cli)validity;
996
997 /*
998 * Alphanumeric data
999 */
1000 if (alpha NEQ NULL)
1001 {
1002 USHORT len;
1003
1004 clip_data.v_alpha=TRUE;
1005
1006 #ifdef NO_ASCIIZ
1007
1008 utl_chsetFromSim(
1009 alpha->data,
1010 alpha->len,
1011 (UBYTE *)clip_data.alpha,
1012 BAT_MAX_PHB_NUM_LEN,
1013 &len,
1014 GSM_ALPHA_Def);
1015
1016 #else
1017
1018 utl_chsetFromSim(
1019 alpha,
1020 strlen(alpha),
1021 (UBYTE *)clip_data.alpha,
1022 BAT_MAX_PHB_NUM_LEN,
1023 &len,
1024 GSM_ALPHA_Def);
1025
1026 #endif /*NO_ASCIIZ*/
1027
1028 clip_data.c_alpha=(U8)len;
1029 }
1030 else
1031 {
1032 clip_data.v_alpha=FALSE;
1033 }
1034 }
1035 else
1036 {
1037 resp.ctrl_response=BAT_RES_QUE_PLUS_CLIP;
1038 resp.response.ptr_que_plus_clip=&que_clip_buffer;
1039 que_clip_buffer.m = (T_BAT_plus_clip_m)stat;
1040 }
1041 aci_bat_send(src_infos,&resp);
1042 }
1043
1044 /*
1045 +--------------------------------------------------------------------+
1046 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1047 | STATE : code ROUTINE : rBAT_PlusCDIP |
1048 +--------------------------------------------------------------------+
1049
1050 PURPOSE :
1051 */
1052 GLOBAL void rBAT_PlusCDIP(CHAR *number,
1053 T_ACI_TOA * type,
1054 CHAR *subaddr,
1055 T_ACI_TOS *satype)
1056 {
1057 T_ACI_CMD_SRC src_id;
1058 T_ACI_DTI_PRC_PSI *src_infos;
1059 T_BAT_cmd_response resp;
1060 T_BAT_res_uns_plus_cdip cdip_data;
1061 UBYTE len;
1062
1063 TRACE_FUNCTION ("rBAT_PlusCDIP()");
1064
1065 /*
1066 * Get the source ID and a pointer to the PSI source information.
1067 */
1068 aci_bat_src_info(&src_id,&src_infos);
1069
1070 resp.ctrl_response=BAT_RES_UNS_PLUS_CDIP;
1071 resp.response.ptr_res_plus_cdip=&cdip_data;
1072
1073 if (number EQ NULL)
1074 {
1075 cdip_data.number[0]=0;
1076 cdip_data.c_number=0;
1077 }
1078 else
1079 {
1080 len=strlen(number);
1081
1082 if (len<=BAT_MAX_CDIP_NUMBER_LEN)
1083 {
1084 memcpy(cdip_data.number,number,len);
1085 cdip_data.c_number=(U8)len;
1086 }
1087 else
1088 {
1089 /*
1090 * This is highly unlikely to happen, but if the number is too
1091 * big, then put as many digits as will fit in the BAT structure
1092 * from the END of the number.
1093 */
1094 memcpy(
1095 cdip_data.number,
1096 number+(len-BAT_MAX_CDIP_NUMBER_LEN),
1097 BAT_MAX_CDIP_NUMBER_LEN);
1098
1099 cdip_data.c_number=(U8)BAT_MAX_CDIP_NUMBER_LEN;
1100 }
1101 }
1102
1103 if (type EQ NULL)
1104 {
1105 /*
1106 * This is mandatory in the BAT so we have to do something here.
1107 */
1108 T_ACI_TOA t;
1109
1110 t.npi=NPI_Unknown;
1111 t.ton=TON_Unknown;
1112
1113 cdip_data.type=(U8)toa_merge(t);
1114 }
1115 else
1116 {
1117 cdip_data.type=(U8)toa_merge(*type);
1118 }
1119
1120 if (subaddr EQ NULL)
1121 {
1122 cdip_data.v_subaddr=FALSE;
1123 cdip_data.satype=-1;
1124 }
1125 else
1126 {
1127 cdip_data.v_subaddr=TRUE;
1128
1129 if (satype EQ NULL)
1130 cdip_data.satype=-1;
1131 else
1132 cdip_data.satype=(S16)tos_merge(*satype);
1133
1134 len=strlen(subaddr);
1135
1136 /*
1137 * Easiest thing to do is copy as much subaddress data as the
1138 * BAT structure can take. The length field will ensure that
1139 * there are no problems, and will result in the subaddress
1140 * being truncated if it is too long.
1141 */
1142 memcpy(cdip_data.subaddr,subaddr,BAT_MAX_SUBADDR_LENGTH);
1143
1144 if (len>BAT_MAX_SUBADDR_LENGTH)
1145 cdip_data.c_subaddr=BAT_MAX_SUBADDR_LENGTH;
1146 else
1147 cdip_data.c_subaddr=len;
1148 }
1149
1150 aci_bat_send(src_infos,&resp);
1151 }
1152
1153 /*
1154 +--------------------------------------------------------------------+
1155 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1156 | STATE : code ROUTINE : rBAT_PlusCOLP |
1157 +--------------------------------------------------------------------+
1158
1159 PURPOSE :
1160 */
1161 GLOBAL void rBAT_PlusCOLP(
1162 T_ACI_COLP_STAT stat,
1163 CHAR *number,
1164 T_ACI_TOA *type,
1165 CHAR *subaddr,
1166 T_ACI_TOS *satype,
1167 #ifdef NO_ASCIIZ
1168 T_ACI_PB_TEXT *alpha)
1169 #else
1170 CHAR *alpha)
1171 #endif /*NO_ASCIIZ*/
1172 {
1173 T_ACI_CMD_SRC src_id;
1174 T_ACI_DTI_PRC_PSI *src_infos;
1175 T_BAT_cmd_response resp;
1176 T_BAT_res_uns_plus_colp colp_data;
1177 T_BAT_res_que_plus_colp que_colp_buffer;
1178 UBYTE len;
1179
1180 TRACE_FUNCTION ("rBAT_PlusCOLP()");
1181
1182 /*
1183 * Get the source ID and a pointer to the PSI source information.
1184 */
1185 aci_bat_src_info(&src_id,&src_infos);
1186
1187 if (stat EQ COLP_STAT_NotPresent) /* Function call if connection is made*/
1188 {
1189 resp.ctrl_response=BAT_RES_UNS_PLUS_COLP;
1190 resp.response.ptr_res_plus_colp=&colp_data;
1191
1192 if (number EQ NULL)
1193 {
1194 colp_data.v_number=FALSE;
1195 }
1196 else
1197 {
1198 len=strlen(number);
1199
1200 colp_data.v_number=TRUE;
1201
1202 if (len<=BAT_MAX_COLP_NUMBER_LEN)
1203 {
1204 memcpy(colp_data.number,number,len);
1205 colp_data.c_number=(U8)len;
1206 }
1207 else
1208 {
1209 /*
1210 * This is highly unlikely to happen, but if the number is too
1211 * big, then put as many digits as will fit in the BAT structure
1212 * from the END of the number.
1213 */
1214 memcpy(
1215 colp_data.number,
1216 number+(len-BAT_MAX_COLP_NUMBER_LEN),
1217 BAT_MAX_COLP_NUMBER_LEN);
1218
1219 colp_data.c_number=(U8)BAT_MAX_COLP_NUMBER_LEN;
1220 }
1221 }
1222
1223 if (type EQ NULL)
1224 {
1225 /*
1226 * This is mandatory in the BAT so we have to do something here.
1227 */
1228 T_ACI_TOA t;
1229
1230 t.npi=NPI_Unknown;
1231 t.ton=TON_Unknown;
1232
1233 colp_data.type=(U8)toa_merge(t);
1234 }
1235 else
1236 {
1237 colp_data.type=(U8)toa_merge(*type);
1238 }
1239
1240 if (subaddr EQ NULL)
1241 {
1242 colp_data.v_subaddr=FALSE;
1243 colp_data.satype=-1;
1244 }
1245 else
1246 {
1247 colp_data.v_subaddr=TRUE;
1248
1249 if (satype EQ NULL)
1250 colp_data.satype=-1;
1251 else
1252 colp_data.satype=(S16)tos_merge(*satype);
1253
1254 len=strlen(subaddr);
1255
1256 /*
1257 * Easiest thing to do is copy as much subaddress data as the
1258 * BAT structure can take. The length field will ensure that
1259 * there are no problems, and will result in the subaddress
1260 * being truncated if it is too long.
1261 */
1262 memcpy(colp_data.subaddr,subaddr,BAT_MAX_SUBADDR_LENGTH);
1263
1264 if (len>BAT_MAX_SUBADDR_LENGTH)
1265 colp_data.c_subaddr=BAT_MAX_SUBADDR_LENGTH;
1266 else
1267 colp_data.c_subaddr=len;
1268 }
1269
1270 /*
1271 * Alphanumeric data
1272 */
1273 if (alpha!=NULL)
1274 {
1275 USHORT len;
1276
1277 colp_data.v_alpha=TRUE;
1278
1279 #ifdef NO_ASCIIZ
1280
1281 utl_chsetFromSim(
1282 alpha->data,
1283 alpha->len,
1284 (UBYTE *)colp_data.alpha,
1285 BAT_MAX_COLP_ALPHA_LEN,
1286 &len,
1287 GSM_ALPHA_Def);
1288
1289 #else
1290
1291 utl_chsetFromSim(
1292 alpha,
1293 strlen(alpha),
1294 (UBYTE *)colp_data.alpha,
1295 BAT_MAX_COLP_ALPHA_LEN,
1296 &len,
1297 GSM_ALPHA_Def);
1298
1299 #endif /*NO_ASCIIZ*/
1300
1301 colp_data.c_alpha=(U8)len;
1302 }
1303 else
1304 {
1305 colp_data.v_alpha=FALSE;
1306 }
1307 }
1308 else
1309 {
1310 que_colp_buffer.m = (T_BAT_plus_colp_m)stat;
1311 resp.ctrl_response=BAT_RES_QUE_PLUS_COLP;
1312 resp.response.ptr_que_plus_colp=&que_colp_buffer;
1313 }
1314 aci_bat_send(src_infos,&resp);
1315 }
1316
1317 /*
1318 +--------------------------------------------------------------------+
1319 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1320 | STATE : code ROUTINE : rBAT_PlusCRING_OFF |
1321 +--------------------------------------------------------------------+
1322
1323 PURPOSE :
1324 */
1325 GLOBAL void rBAT_PlusCRING_OFF(
1326 SHORT cId)
1327 {
1328 #ifndef FF_ATI_BAT
1329
1330 /*
1331 * This is not included in the BAT interface, so ignore it.
1332 */
1333 TRACE_FUNCTION ("rBAT_PlusCRING_OFF() - IGNORED");
1334
1335 #else
1336
1337 /*
1338 * But for test purposes, fake a response by calling the equivalent
1339 * ATI function directly.
1340 */
1341 TRACE_FUNCTION ("rBAT_PlusCRING_OFF() - FAKE");
1342 rCI_PlusCRING_OFF(cId);
1343
1344 #endif
1345 }
1346
1347 /*
1348 +--------------------------------------------------------------------+
1349 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1350 | STATE : code ROUTINE : rBAT_PlusCMS |
1351 +--------------------------------------------------------------------+
1352
1353 PURPOSE :
1354 */
1355 GLOBAL void rBAT_PlusCMS(
1356 T_ACI_AT_CMD cmdId,
1357 T_ACI_CMS_ERR err,
1358 T_EXT_CMS_ERROR *conc_error)
1359 {
1360 T_ACI_CMD_SRC src_id;
1361 T_ACI_DTI_PRC_PSI *src_infos;
1362 T_BAT_cmd_response resp;
1363 T_BAT_res_plus_cms_error error_data;
1364
1365 TRACE_FUNCTION ("rBAT_PlusCMS()");
1366
1367 /*
1368 * Get the source ID and a pointer to the PSI source information.
1369 */
1370 aci_bat_src_info(&src_id,&src_infos);
1371
1372 resp.ctrl_response=BAT_RES_PLUS_CMS_ERROR;
1373 resp.response.ptr_plus_cms_error=&error_data;
1374
1375 /*
1376 * This relies on T_ACI_CMS_ERR being the same as
1377 * T_BAT_plus_cms_error_err.
1378 */
1379 resp.response.ptr_plus_cms_error->err=(T_BAT_plus_cms_error_err)err;
1380
1381 /*
1382 * BAT does not include cmdId or conc_error, so these are
1383 * discarded.
1384 */
1385
1386 aci_bat_send(src_infos,&resp);
1387
1388 /* check for possible next command queued */
1389 aci_bat_run_cmd (src_infos);
1390 }
1391
1392 /*
1393 +--------------------------------------------------------------------+
1394 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1395 | STATE : code ROUTINE : rBAT_PlusCSMS |
1396 +--------------------------------------------------------------------+
1397
1398 PURPOSE :
1399 */
1400 GLOBAL void rBAT_PlusCSMS(
1401 T_ACI_CSMS_SERV service,
1402 T_ACI_CSMS_SUPP mt,
1403 T_ACI_CSMS_SUPP mo,
1404 T_ACI_CSMS_SUPP bm)
1405 {
1406 T_ACI_CMD_SRC src_id;
1407 T_ACI_DTI_PRC_PSI *src_infos;
1408 T_BAT_cmd_response resp;
1409 T_BAT_res_que_plus_csms csms_data;
1410
1411 TRACE_FUNCTION ("rBAT_PlusCSMS()");
1412
1413 /*
1414 * Get the source ID and a pointer to the PSI source information.
1415 */
1416 aci_bat_src_info(&src_id,&src_infos);
1417
1418 resp.ctrl_response=BAT_RES_QUE_PLUS_CSMS;
1419 resp.response.ptr_que_plus_csms=&csms_data;
1420
1421 /*
1422 * This relies on T_ACI_CSMS_SERV being equivalent to
1423 * T_BAT_plus_csms_service.
1424 */
1425 csms_data.service=(T_BAT_plus_csms_service)service;
1426
1427 /*
1428 * This relies on T_ACI_CSMS_SUPP being equivalent to
1429 * T_BAT_plus_csms_mt/mo/bm.
1430 */
1431 csms_data.mt=(T_BAT_plus_csms_mt)mt;
1432 csms_data.mo=(T_BAT_plus_csms_mo)mo;
1433 csms_data.bm=(T_BAT_plus_csms_bm)bm;
1434
1435 aci_bat_send(src_infos,&resp);
1436 }
1437
1438 /*
1439 +--------------------------------------------------------------------+
1440 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1441 | STATE : code ROUTINE : rBAT_PlusCMGS |
1442 +--------------------------------------------------------------------+
1443
1444 PURPOSE :
1445 */
1446 GLOBAL void rBAT_PlusCMGS(
1447 T_MNSMS_SUBMIT_CNF *mnsms_submit_cnf)
1448 {
1449 T_ACI_CMD_SRC src_id;
1450 T_ACI_DTI_PRC_PSI *src_infos;
1451 T_BAT_cmd_response resp;
1452 T_BAT_res_set_plus_cmgs cmgs_data;
1453
1454 TRACE_FUNCTION ("rBAT_PlusCMGS()");
1455
1456 /*
1457 * Get the source ID and a pointer to the PSI source information.
1458 */
1459 aci_bat_src_info(&src_id,&src_infos);
1460
1461 resp.ctrl_response=BAT_RES_SET_PLUS_CMGS;
1462 resp.response.ptr_set_plus_cmgs=&cmgs_data;
1463
1464 /*
1465 * Note that all the rest of the information is lost, as it is
1466 * not in the BAT.
1467 */
1468 cmgs_data.mr=(U8)mnsms_submit_cnf->tp_mr;
1469
1470 aci_bat_send(src_infos,&resp);
1471 }
1472
1473 /*
1474 +--------------------------------------------------------------------+
1475 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1476 | STATE : code ROUTINE : rBAT_PlusCMSS |
1477 +--------------------------------------------------------------------+
1478
1479 PURPOSE :
1480 */
1481 GLOBAL void rBAT_PlusCMSS(
1482 T_MNSMS_SUBMIT_CNF *mnsms_submit_cnf)
1483 {
1484 T_ACI_CMD_SRC src_id;
1485 T_ACI_DTI_PRC_PSI *src_infos;
1486 T_BAT_cmd_response resp;
1487 T_BAT_res_set_plus_cmss cmss_data;
1488 UBYTE len = 0;
1489 UBYTE sca_len = 0;
1490 UBYTE ackpdu_len = 0;
1491
1492 TRACE_FUNCTION ("rBAT_PlusCMSS()");
1493
1494 if (mnsms_submit_cnf EQ NULL)
1495 return;
1496
1497 /*
1498 * Calculate the PDU length in bytes from the number in bits.
1499 */
1500 len=((mnsms_submit_cnf->sms_sdu.l_buf+7)/8);
1501
1502 /*
1503 * The PDU data is mandatory, and a truncated version would be
1504 * meaningless, so if it won't fit in the BAT message we should
1505 * give up. This shouldn't happen anyway.
1506 */
1507 if (len>BAT_MAX_SM_LEN)
1508 return;
1509
1510 /*
1511 * Get the source ID and a pointer to the PSI source information.
1512 */
1513 aci_bat_src_info(&src_id,&src_infos);
1514
1515 resp.ctrl_response=BAT_RES_SET_PLUS_CMSS;
1516 resp.response.ptr_set_plus_cmss=&cmss_data;
1517
1518
1519 cmss_data.mr=mnsms_submit_cnf->tp_mr;
1520
1521 cmss_data.c_ackpdu = 0;
1522
1523 if (smsShrdPrm.CSMSservice EQ CSMS_SERV_GsmPh2Plus)
1524 {
1525 if (mnsms_submit_cnf->sms_sdu.l_buf)
1526 {
1527 sca_len = mnsms_submit_cnf->sms_sdu.buf[0] + 1;
1528 ackpdu_len = len - sca_len;
1529 /*
1530 * Now copy the PDU into the BAT structure without SCA field.
1531 */
1532 memcpy(cmss_data.ackpdu,&mnsms_submit_cnf->sms_sdu.buf[sca_len],ackpdu_len);
1533 cmss_data.c_ackpdu = ackpdu_len;
1534 }
1535 }
1536 aci_bat_send(src_infos,&resp);
1537 }
1538
1539 /*
1540 +--------------------------------------------------------------------+
1541 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1542 | STATE : code ROUTINE : rBAT_PlusCMGW |
1543 +--------------------------------------------------------------------+
1544
1545 PURPOSE :
1546 */
1547 GLOBAL void rBAT_PlusCMGW(
1548 UBYTE index,
1549 UBYTE numSeg)
1550 {
1551 T_ACI_CMD_SRC src_id;
1552 T_ACI_DTI_PRC_PSI *src_infos;
1553 T_BAT_cmd_response resp;
1554 T_BAT_res_set_plus_cmgw cmgw_data;
1555
1556 TRACE_FUNCTION ("rBAT_PlusCMGW()");
1557
1558 /*
1559 * Get the source ID and a pointer to the PSI source information.
1560 */
1561 aci_bat_src_info(&src_id,&src_infos);
1562
1563 resp.ctrl_response=BAT_RES_SET_PLUS_CMGW;
1564 resp.response.ptr_set_plus_cmgw=&cmgw_data;
1565
1566 cmgw_data.index=(U8)index;
1567
1568 /*
1569 * numSeg is lost as it is not in the BAT.
1570 */
1571
1572 aci_bat_send(src_infos,&resp);
1573 }
1574
1575 /*
1576 +--------------------------------------------------------------------+
1577 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1578 | STATE : code ROUTINE : rBAT_PlusCDS |
1579 +--------------------------------------------------------------------+
1580
1581 PURPOSE :
1582 */
1583 GLOBAL void rBAT_PlusCDS(
1584 T_MNSMS_STATUS_IND *mnsms_status_ind)
1585 {
1586 T_ACI_CMD_SRC src_id;
1587 T_ACI_DTI_PRC_PSI *src_infos;
1588 T_BAT_cmd_response resp;
1589 T_BAT_res_uns_plus_cds cds_data;
1590 UBYTE len;
1591
1592 TRACE_FUNCTION ("rBAT_PlusCDS()");
1593
1594 if (mnsms_status_ind EQ NULL)
1595 return;
1596
1597 /*
1598 * Calculate the PDU length in bytes from the number in bits.
1599 */
1600 len=((mnsms_status_ind->sms_sdu.l_buf+7)/8);
1601
1602 /*
1603 * The PDU data is mandatory, and a truncated version would be
1604 * meaningless, so if it won't fit in the BAT message we should
1605 * give up. This shouldn't happen anyway.
1606 */
1607 if (len>BAT_MAX_SM_LEN)
1608 return;
1609
1610 /*
1611 * Get the source ID and a pointer to the PSI source information.
1612 */
1613 aci_bat_src_info(&src_id,&src_infos);
1614
1615 resp.ctrl_response=BAT_RES_UNS_PLUS_CDS;
1616 resp.response.ptr_res_plus_cds=&cds_data;
1617
1618 /*
1619 * Now copy the PDU into the BAT structure.
1620 */
1621 /*lint -e670 (Warning - Possible access beyond array for function) */
1622 memcpy(cds_data.pdu,mnsms_status_ind->sms_sdu.buf,len);
1623 cds_data.c_pdu=(U8)len;
1624
1625 aci_bat_send(src_infos,&resp);
1626 }
1627
1628 /*
1629 +--------------------------------------------------------------------+
1630 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1631 | STATE : code ROUTINE : rBAT_PlusCMGC |
1632 +--------------------------------------------------------------------+
1633
1634 PURPOSE :
1635 */
1636 GLOBAL void rBAT_PlusCMGC(
1637 T_MNSMS_COMMAND_CNF *mnsms_command_cnf)
1638 {
1639 T_ACI_CMD_SRC src_id;
1640 T_ACI_DTI_PRC_PSI *src_infos;
1641 T_BAT_cmd_response resp;
1642 T_BAT_res_set_plus_cmgc cmgc_data;
1643 UBYTE len;
1644
1645 TRACE_FUNCTION ("rBAT_PlusCMGC()");
1646
1647 if (mnsms_command_cnf EQ NULL)
1648 return;
1649
1650 /*
1651 * Calculate the PDU length in bytes from the number in bits.
1652 */
1653 len=((mnsms_command_cnf->sms_sdu.l_buf+7)/8);
1654
1655 /*
1656 * The PDU data is mandatory, and a truncated version would be
1657 * meaningless, so if it won't fit in the BAT message we should
1658 * give up. This shouldn't happen anyway.
1659 */
1660 if (len>BAT_MAX_SM_LEN)
1661 return;
1662
1663 /*
1664 * Get the source ID and a pointer to the PSI source information.
1665 */
1666 aci_bat_src_info(&src_id,&src_infos);
1667
1668 resp.ctrl_response=BAT_RES_SET_PLUS_CMGC;
1669 resp.response.ptr_set_plus_cmgc=&cmgc_data;
1670
1671 cmgc_data.mr=mnsms_command_cnf->tp_mr;
1672
1673 /*
1674 * Now copy the PDU into the BAT structure.
1675 */
1676 /*lint -e670 (Warning - Possible access beyond array for function) */
1677 memcpy(cmgc_data.ackpdu,mnsms_command_cnf->sms_sdu.buf,len);
1678 cmgc_data.c_ackpdu=(U8)len;
1679
1680 aci_bat_send(src_infos,&resp);
1681 }
1682
1683 /*
1684 +--------------------------------------------------------------------+
1685 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1686 | STATE : code ROUTINE : rBAT_PlusCMGD |
1687 +--------------------------------------------------------------------+
1688
1689 PURPOSE :
1690 */
1691 GLOBAL void rBAT_PlusCMGD(void)
1692 {
1693 #ifndef FF_ATI_BAT
1694
1695 /*
1696 * This is not included in the BAT interface, so ignore it.
1697 */
1698 TRACE_FUNCTION ("rBAT_PlusCMGD() - IGNORED");
1699
1700 #else
1701
1702 /*
1703 * But for test purposes, fake a response by calling the equivalent
1704 * ATI function directly.
1705 */
1706 TRACE_FUNCTION ("rBAT_PlusCMGD() - FAKE");
1707 rCI_PlusCMGD();
1708
1709 #endif
1710 }
1711
1712 /*
1713 +--------------------------------------------------------------------+
1714 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1715 | STATE : code ROUTINE : rBAT_PlusCMGR |
1716 +--------------------------------------------------------------------+
1717
1718 PURPOSE :
1719 */
1720 GLOBAL void rBAT_PlusCMGR(
1721 T_MNSMS_READ_CNF *mnsms_read_cnf,
1722 T_ACI_CMGR_CBM *cbm)
1723 {
1724 T_ACI_CMD_SRC src_id;
1725 T_ACI_DTI_PRC_PSI *src_infos;
1726 T_BAT_cmd_response resp;
1727 T_BAT_res_set_plus_cmgr cmgr_data;
1728 T_ACI_PB_TEXT alpha;
1729 T_ACI_SMS_STAT stat;
1730 UBYTE len;
1731
1732 TRACE_FUNCTION ("rBAT_PlusCMGR()");
1733
1734 if (mnsms_read_cnf EQ NULL)
1735 return;
1736
1737 /*
1738 * Calculate the PDU length in bytes from the number in bits.
1739 */
1740 len=((mnsms_read_cnf->sms_sdu.l_buf+7)/8);
1741
1742 /*
1743 * The PDU data is mandatory, and a truncated version would be
1744 * meaningless, so if it won't fit in the BAT message we should
1745 * give up. This shouldn't happen anyway.
1746 */
1747 if (len>BAT_MAX_SM_LEN)
1748 return;
1749
1750 /*
1751 * Get the source ID and a pointer to the PSI source information.
1752 */
1753 aci_bat_src_info(&src_id,&src_infos);
1754
1755 resp.ctrl_response=BAT_RES_SET_PLUS_CMGR;
1756 resp.response.ptr_set_plus_cmgr=&cmgr_data;
1757
1758 /*
1759 * Now copy the PDU into the BAT structure.
1760 */
1761 /*lint -e670 (Warning - Possible access beyond array for function) */
1762 memcpy(cmgr_data.pdu,mnsms_read_cnf->sms_sdu.buf,len);
1763 cmgr_data.c_pdu=len;
1764
1765 /*
1766 * Convert status from PSA type to CMH type.
1767 */
1768 cmhSMS_getStatCmh(mnsms_read_cnf->status,&stat);
1769
1770 /*
1771 * This relies on T_ACI_SMS_STAT and T_BAT_sms_stat being equivalent
1772 * (apart from the extra 'invalid' value that the ACI has).
1773 */
1774 if (stat EQ SMS_STAT_Invalid)
1775 cmgr_data.sms_stat=BAT_STAT_NOT_PRESENT;
1776 else
1777 cmgr_data.sms_stat=(T_BAT_sms_stat)stat;
1778
1779 /*
1780 * Try and get the alphanumeric (phonebook) data.
1781 */
1782 cmhSMS_getPhbEntry(mnsms_read_cnf->sms_sdu.buf,&alpha,stat);
1783
1784 if (alpha.len)
1785 {
1786 USHORT len_cvtd_alpha;
1787
1788 utl_chsetFromGsm(
1789 (UBYTE*)alpha.data,
1790 alpha.len,
1791 (UBYTE*)cmgr_data.alpha,
1792 BAT_MAX_CMGR_ALPHA,
1793 &len_cvtd_alpha,
1794 GSM_ALPHA_Def);
1795
1796 cmgr_data.c_alpha=(U8)len_cvtd_alpha;
1797 cmgr_data.v_alpha=TRUE;
1798
1799 cmgr_data.alpha_cs=(T_BAT_plus_cmgr_alpha_cs)aci_bat_cs_get(src_infos);
1800 }
1801 else
1802 {
1803 cmgr_data.v_alpha=FALSE;
1804 }
1805
1806 aci_bat_send(src_infos,&resp);
1807 }
1808
1809 /*
1810 +--------------------------------------------------------------------+
1811 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1812 | STATE : code ROUTINE : rBAT_PercentCMGR |
1813 +--------------------------------------------------------------------+
1814
1815 PURPOSE :
1816 */
1817 GLOBAL void rBAT_PercentCMGR(
1818 T_MNSMS_READ_CNF *mnsms_read_cnf,
1819 T_ACI_CMGR_CBM *cbm)
1820 {
1821 T_ACI_CMD_SRC src_id;
1822 T_ACI_DTI_PRC_PSI *src_infos;
1823 T_BAT_cmd_response resp;
1824 T_BAT_res_set_percent_cmgr cmgr_data;
1825 T_ACI_PB_TEXT alpha;
1826 T_ACI_SMS_STAT stat;
1827 UBYTE len;
1828
1829 TRACE_FUNCTION ("rBAT_PercentCMGR()");
1830
1831 if (mnsms_read_cnf EQ NULL)
1832 return;
1833
1834 /*
1835 * Calculate the PDU length in bytes from the number in bits.
1836 */
1837 len=((mnsms_read_cnf->sms_sdu.l_buf+7)/8);
1838
1839 /*
1840 * The PDU data is mandatory, and a truncated version would be
1841 * meaningless, so if it won't fit in the BAT message we should
1842 * give up. This shouldn't happen anyway.
1843 */
1844 if (len>BAT_MAX_SM_LEN)
1845 return;
1846
1847 /*
1848 * Get the source ID and a pointer to the PSI source information.
1849 */
1850 aci_bat_src_info(&src_id,&src_infos);
1851
1852 resp.ctrl_response=BAT_RES_SET_PERCENT_CMGR;
1853 resp.response.ptr_set_percent_cmgr=&cmgr_data;
1854
1855 /*
1856 * Now copy the PDU into the BAT structure.
1857 */
1858 /*lint -e670 (Warning - Possible access beyond array for function) */
1859 memcpy(cmgr_data.pdu,mnsms_read_cnf->sms_sdu.buf,len);
1860 cmgr_data.c_pdu=len;
1861
1862 /*
1863 * Convert status from PSA type to CMH type.
1864 */
1865 cmhSMS_getStatCmh(mnsms_read_cnf->status,&stat);
1866
1867 /*
1868 * This relies on T_ACI_SMS_STAT and T_BAT_sms_stat being equivalent
1869 * (apart from the extra 'invalid' value that the ACI has).
1870 */
1871 if (stat EQ SMS_STAT_Invalid)
1872 cmgr_data.sms_stat=BAT_STAT_NOT_PRESENT;
1873 else
1874 cmgr_data.sms_stat=(T_BAT_sms_stat)stat;
1875
1876 /*
1877 * Try and get the alphanumeric (phonebook) data.
1878 */
1879 cmhSMS_getPhbEntry(mnsms_read_cnf->sms_sdu.buf,&alpha,stat);
1880
1881 if (alpha.len)
1882 {
1883 USHORT len_cvtd_alpha;
1884
1885 utl_chsetFromGsm(
1886 (UBYTE*)alpha.data,
1887 alpha.len,
1888 (UBYTE*)cmgr_data.alpha,
1889 BAT_MAX_CMGR_ALPHA,
1890 &len_cvtd_alpha,
1891 GSM_ALPHA_Def);
1892
1893 cmgr_data.c_alpha=(U8)len_cvtd_alpha;
1894 cmgr_data.v_alpha=TRUE;
1895
1896 cmgr_data.alpha_cs=(T_BAT_percent_cmgr_alpha_cs)aci_bat_cs_get(src_infos);
1897 }
1898 else
1899 {
1900 cmgr_data.v_alpha=FALSE;
1901 }
1902
1903 aci_bat_send(src_infos,&resp);
1904 }
1905
1906 /*
1907 +--------------------------------------------------------------------+
1908 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
1909 | STATE : code ROUTINE : rBAT_PlusCMGL |
1910 +--------------------------------------------------------------------+
1911
1912 PURPOSE :
1913 */
1914 GLOBAL void rBAT_PlusCMGL(
1915 T_MNSMS_READ_CNF *mnsms_read_cnf)
1916 {
1917 T_ACI_CMD_SRC src_id;
1918 T_ACI_DTI_PRC_PSI *src_infos;
1919 T_BAT_cmd_response resp;
1920 T_BAT_res_set_plus_cmgl cmgl_data;
1921 T_ACI_PB_TEXT alpha;
1922 T_ACI_SMS_STAT stat;
1923 UBYTE len;
1924
1925 TRACE_FUNCTION ("rBAT_PlusCMGL()");
1926
1927 if (mnsms_read_cnf EQ NULL)
1928 return;
1929
1930 /*
1931 * Calculate the PDU length in bytes from the number in bits.
1932 */
1933 len=((mnsms_read_cnf->sms_sdu.l_buf+7)/8);
1934
1935 /*
1936 * The PDU data is mandatory, and a truncated version would be
1937 * meaningless, so if it won't fit in the BAT message we should
1938 * give up. This shouldn't happen anyway.
1939 */
1940 if (len>BAT_MAX_SM_LEN)
1941 return;
1942
1943 /*
1944 * Get the source ID and a pointer to the PSI source information.
1945 */
1946 aci_bat_src_info(&src_id,&src_infos);
1947
1948 resp.ctrl_response=BAT_RES_SET_PLUS_CMGL;
1949 resp.response.ptr_set_plus_cmgl=&cmgl_data;
1950
1951 cmgl_data.sms_index=(U16)mnsms_read_cnf->rec_num;
1952
1953 /*
1954 * Now copy the PDU into the BAT structure.
1955 */
1956 /*lint -e670 (Warning - Possible access beyond array for function) */
1957 memcpy(cmgl_data.pdu,mnsms_read_cnf->sms_sdu.buf,len);
1958 cmgl_data.c_pdu=len;
1959
1960 /*
1961 * Try and get the alphanumeric (phonebook) data.
1962 */
1963 cmhSMS_getStatCmh(mnsms_read_cnf->status,&stat);
1964 cmhSMS_getPhbEntry(mnsms_read_cnf->sms_sdu.buf,&alpha,stat);
1965
1966 if (alpha.len)
1967 {
1968 USHORT len_cvtd_alpha;
1969
1970 utl_chsetFromGsm(
1971 (UBYTE*)alpha.data,
1972 alpha.len,
1973 (UBYTE*)cmgl_data.alpha,
1974 BAT_MAX_CMGL_ALPHA,
1975 &len_cvtd_alpha,
1976 GSM_ALPHA_Def);
1977
1978 cmgl_data.c_alpha=(U8)len_cvtd_alpha;
1979 cmgl_data.v_alpha=TRUE;
1980
1981 cmgl_data.alpha_cs=(T_BAT_plus_cmgl_alpha_cs)aci_bat_cs_get(src_infos);
1982 }
1983 else
1984 {
1985 cmgl_data.v_alpha=FALSE;
1986 }
1987
1988 /*
1989 * This relies on T_ACI_SMS_STAT and T_BAT_plus_cmgl_stat being equivalent
1990 * (apart from the extra 'invalid' value that the ACI has).
1991 */
1992 if (stat EQ SMS_STAT_Invalid)
1993 cmgl_data.stat=BAT_CMGL_STAT_NOT_PRESENT;
1994 else
1995 cmgl_data.stat=(T_BAT_plus_cmgl_stat)stat;
1996
1997 aci_bat_send(src_infos,&resp);
1998 }
1999
2000
2001 /*
2002 +--------------------------------------------------------------------+
2003 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2004 | STATE : code ROUTINE : rBAT_PercentCMGL |
2005 +--------------------------------------------------------------------+
2006
2007 PURPOSE :
2008 */
2009 GLOBAL void rBAT_PercentCMGL(
2010 T_MNSMS_READ_CNF *mnsms_read_cnf)
2011 {
2012 T_ACI_CMD_SRC src_id;
2013 T_ACI_DTI_PRC_PSI *src_infos;
2014 T_BAT_cmd_response resp;
2015 T_BAT_res_set_percent_cmgl cmgl_data;
2016 T_ACI_PB_TEXT alpha;
2017 T_ACI_SMS_STAT stat;
2018 UBYTE len;
2019
2020 TRACE_FUNCTION ("rBAT_PercentCMGL()");
2021
2022 if (mnsms_read_cnf EQ NULL)
2023 return;
2024
2025 /*
2026 * Calculate the PDU length in bytes from the number in bits.
2027 */
2028 len=((mnsms_read_cnf->sms_sdu.l_buf+7)/8);
2029
2030 /*
2031 * The PDU data is mandatory, and a truncated version would be
2032 * meaningless, so if it won't fit in the BAT message we should
2033 * give up. This shouldn't happen anyway.
2034 */
2035 if (len>BAT_MAX_SM_LEN)
2036 return;
2037
2038 /*
2039 * Get the source ID and a pointer to the PSI source information.
2040 */
2041 aci_bat_src_info(&src_id,&src_infos);
2042
2043 resp.ctrl_response=BAT_RES_SET_PERCENT_CMGL;
2044 resp.response.ptr_set_percent_cmgl=&cmgl_data;
2045
2046 cmgl_data.sms_index=(U16)mnsms_read_cnf->rec_num;
2047
2048 /*
2049 * Now copy the PDU into the BAT structure.
2050 */
2051 /*lint -e670 (Warning - Possible access beyond array for function) */
2052 memcpy(cmgl_data.pdu,mnsms_read_cnf->sms_sdu.buf,len);
2053 cmgl_data.c_pdu=len;
2054
2055 /*
2056 * Try and get the alphanumeric (phonebook) data.
2057 */
2058 cmhSMS_getStatCmh(mnsms_read_cnf->status,&stat);
2059 cmhSMS_getPhbEntry(mnsms_read_cnf->sms_sdu.buf,&alpha,stat);
2060
2061 if (alpha.len)
2062 {
2063 USHORT len_cvtd_alpha;
2064
2065 utl_chsetFromGsm(
2066 (UBYTE*)alpha.data,
2067 alpha.len,
2068 (UBYTE*)cmgl_data.alpha,
2069 BAT_MAX_CMGL_ALPHA,
2070 &len_cvtd_alpha,
2071 GSM_ALPHA_Def);
2072
2073 cmgl_data.c_alpha=(U8)len_cvtd_alpha;
2074 cmgl_data.v_alpha=TRUE;
2075
2076 cmgl_data.alpha_cs=(T_BAT_percent_cmgl_alpha_cs)aci_bat_cs_get(src_infos);
2077 }
2078 else
2079 {
2080 cmgl_data.v_alpha=FALSE;
2081 }
2082
2083 /*
2084 * This relies on T_ACI_SMS_STAT and T_BAT_plus_cmgl_stat being equivalent
2085 * (apart from the extra 'invalid' value that the ACI has).
2086 */
2087 if (stat EQ SMS_STAT_Invalid)
2088 cmgl_data.stat=BAT_P_CMGL_STAT_NOT_PRESENT;
2089 else
2090 cmgl_data.stat=(T_BAT_percent_cmgl_stat)stat;
2091
2092 aci_bat_send(src_infos,&resp);
2093 }
2094
2095 /*
2096 +--------------------------------------------------------------------+
2097 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2098 | STATE : code ROUTINE : rBAT_PlusCMTI |
2099 +--------------------------------------------------------------------+
2100
2101 PURPOSE :
2102 */
2103 GLOBAL void rBAT_PlusCMTI(
2104 T_ACI_SMS_STOR mem,
2105 UBYTE index)
2106 {
2107 T_ACI_CMD_SRC src_id;
2108 T_ACI_DTI_PRC_PSI *src_infos;
2109 T_BAT_cmd_response resp;
2110 T_BAT_res_uns_plus_cmti cmti_data;
2111
2112 TRACE_FUNCTION ("rBAT_PlusCMTI()");
2113
2114 /*
2115 * Get the source ID and a pointer to the PSI source information.
2116 */
2117 aci_bat_src_info(&src_id,&src_infos);
2118
2119 resp.ctrl_response=BAT_RES_UNS_PLUS_CMTI;
2120 resp.response.ptr_res_plus_cmti=&cmti_data;
2121
2122 /*
2123 * This relies on T_ACI_SMS_STOR being equivalent to T_BAT_sms_mem.
2124 */
2125 cmti_data.sms_mem=(T_BAT_sms_mem)mem;
2126
2127 cmti_data.sms_index=(U16)index;
2128
2129 aci_bat_send(src_infos,&resp);
2130 }
2131
2132 /*
2133 +--------------------------------------------------------------------+
2134 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2135 | STATE : code ROUTINE : rBAT_PlusCMT |
2136 +--------------------------------------------------------------------+
2137
2138 PURPOSE : Report an incoming mobile terminated message.
2139 */
2140 GLOBAL void rBAT_PlusCMT(
2141 T_MNSMS_MESSAGE_IND *msg)
2142 {
2143 T_ACI_CMD_SRC src_id;
2144 T_ACI_DTI_PRC_PSI *src_infos;
2145 T_BAT_cmd_response resp;
2146 T_BAT_res_uns_plus_cmt cmt_data;
2147 UBYTE len;
2148 T_ACI_PB_TEXT alpha;
2149 T_ACI_SMS_STAT stat;
2150
2151 TRACE_FUNCTION ("rBAT_PlusCMT()");
2152
2153 /*
2154 * This shouldn't happen, but check anyway.
2155 */
2156 if (msg EQ NULL)
2157 return;
2158
2159 /*
2160 * Calculate the PDU length in bytes from the number in bits.
2161 */
2162 len=((msg->sms_sdu.l_buf+7)/8);
2163
2164 /*
2165 * The PDU data is mandatory, and a truncated version would be
2166 * meaningless, so if it won't fit in the BAT message we should
2167 * give up. This shouldn't happen anyway.
2168 */
2169 if (len>BAT_MAX_SM_LEN)
2170 return;
2171
2172 /*
2173 * Get the source ID and a pointer to the PSI source information.
2174 */
2175 aci_bat_src_info(&src_id,&src_infos);
2176
2177 resp.ctrl_response=BAT_RES_UNS_PLUS_CMT;
2178 resp.response.ptr_res_plus_cmt=&cmt_data;
2179
2180 /*
2181 * Now copy the PDU data into the BAT structure, secure in the
2182 * knowledge that we have enough room due to the check earlier.
2183 */
2184 /*lint -e670 (Warning - Possible access beyond array for function) */
2185 memcpy(cmt_data.pdu,&msg->sms_sdu.buf,len);
2186 cmt_data.c_pdu=(U8)len;
2187
2188 /*
2189 * Try and get the alphanumeric (phonebook) data.
2190 */
2191 cmhSMS_getStatCmh(msg->status,&stat);
2192 cmhSMS_getPhbEntry(msg->sms_sdu.buf,&alpha,stat);
2193
2194 if (alpha.len)
2195 {
2196 USHORT len_cvtd_alpha;
2197
2198 /*
2199 * This relies on T_ACI_CSCS_CHSET being identical to
2200 * T_BAT_plus_cscs_cs.
2201 */
2202 utl_chsetFromGsm(
2203 (UBYTE*)alpha.data,
2204 alpha.len,
2205 (UBYTE*)cmt_data.alpha,
2206 BAT_MAX_CMT_ALPHA,
2207 &len_cvtd_alpha,
2208 GSM_ALPHA_Def);
2209
2210 cmt_data.c_alpha=(U8)len_cvtd_alpha;
2211 cmt_data.v_alpha=TRUE;
2212
2213 cmt_data.alpha_cs=(T_BAT_plus_cmt_alpha_cs)aci_bat_cs_get(src_infos);
2214 }
2215 else
2216 {
2217 cmt_data.v_alpha=FALSE;
2218 }
2219
2220 aci_bat_send(src_infos,&resp);
2221 }
2222
2223 /*
2224 +--------------------------------------------------------------------+
2225 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2226 | STATE : code ROUTINE : rBAT_PlusCBM |
2227 +--------------------------------------------------------------------+
2228
2229 PURPOSE :
2230 */
2231 GLOBAL void rBAT_PlusCBM(
2232 T_MMI_CBCH_IND *mmi_cbch_ind)
2233 {
2234 T_ACI_CMD_SRC src_id;
2235 T_ACI_DTI_PRC_PSI *src_infos;
2236 T_BAT_cmd_response resp;
2237 T_BAT_res_uns_plus_cbm cbm_data;
2238
2239 TRACE_FUNCTION ("rBAT_PlusCBM()");
2240
2241 /*
2242 * Get the source ID and a pointer to the PSI source information.
2243 */
2244 aci_bat_src_info(&src_id,&src_infos);
2245
2246 resp.ctrl_response=BAT_RES_UNS_PLUS_CBM;
2247 resp.response.ptr_res_plus_cbm=&cbm_data;
2248
2249 /*
2250 * If the data received is too long for the BAT structure it will
2251 * effectively be truncated.
2252 */
2253 if (mmi_cbch_ind->cbch_len>BAT_MAX_SM_LEN)
2254 cbm_data.c_pdu=BAT_MAX_SM_LEN;
2255 else
2256 cbm_data.c_pdu=(U8)mmi_cbch_ind->cbch_len;
2257
2258 memcpy(cbm_data.pdu,mmi_cbch_ind->cbch_msg,sizeof(mmi_cbch_ind->cbch_msg));
2259
2260 aci_bat_send(src_infos,&resp);
2261 }
2262
2263 /*
2264 +--------------------------------------------------------------------+
2265 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2266 | STATE : code ROUTINE : rBAT_PlusCPMS |
2267 +--------------------------------------------------------------------+
2268
2269 PURPOSE :
2270 */
2271 GLOBAL void rBAT_PlusCPMS(
2272 T_ACI_SMS_STOR_OCC *mem1,
2273 T_ACI_SMS_STOR_OCC *mem2,
2274 T_ACI_SMS_STOR_OCC *mem3)
2275 {
2276 T_ACI_CMD_SRC src_id;
2277 T_ACI_DTI_PRC_PSI *src_infos;
2278 T_BAT_cmd_response resp;
2279 T_BAT_res_set_plus_cpms cpms_data;
2280
2281 TRACE_FUNCTION ("rBAT_PlusCPMS()");
2282
2283 /*
2284 * Get the source ID and a pointer to the PSI source information.
2285 */
2286 aci_bat_src_info(&src_id,&src_infos);
2287
2288 resp.ctrl_response=BAT_RES_SET_PLUS_CPMS;
2289 resp.response.ptr_set_plus_cpms=&cpms_data;
2290
2291 if (mem1 EQ NULL)
2292 {
2293 /*
2294 * If this happens we would be required to populate mandatory
2295 * parameters without the information to do so. Give up.
2296 */
2297 return;
2298 }
2299
2300 cpms_data.mem1=(T_BAT_plus_cpms_mem1)mem1->mem;
2301 cpms_data.used1=(U8)mem1->used;
2302 cpms_data.total1=(U8)mem1->total;
2303
2304 if (mem2)
2305 {
2306 cpms_data.mem2=(T_BAT_plus_cpms_mem2)mem2->mem;
2307 cpms_data.used2=(U8)mem2->used;
2308 cpms_data.total2=(U8)mem2->total;
2309 }
2310 else
2311 {
2312 cpms_data.mem2=BAT_CPMS_MEM2_NOT_PRESENT;
2313 cpms_data.used2=0;
2314 cpms_data.total2=0;
2315 }
2316
2317 if (mem3)
2318 {
2319 cpms_data.mem3=(T_BAT_plus_cpms_mem3)mem3->mem;
2320 cpms_data.used3=(U8)mem3->used;
2321 cpms_data.total3=(U8)mem3->total;
2322 }
2323 else
2324 {
2325 cpms_data.mem3=BAT_CPMS_MEM3_NOT_PRESENT;
2326 cpms_data.used3=0;
2327 cpms_data.total3=0;
2328 }
2329
2330 aci_bat_send(src_infos,&resp);
2331 }
2332
2333 /*
2334 +--------------------------------------------------------------------+
2335 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2336 | STATE : code ROUTINE : rBAT_PlusILRR |
2337 +--------------------------------------------------------------------+
2338
2339 PURPOSE :
2340 */
2341 GLOBAL void rBAT_PlusILRR(
2342 T_ACI_BS_SPEED speed,
2343 T_ACI_BS_FRM format,
2344 T_ACI_BS_PAR parity)
2345 {
2346 T_ACI_CMD_SRC src_id;
2347 T_ACI_DTI_PRC_PSI *src_infos;
2348 T_BAT_cmd_response resp;
2349 T_BAT_res_uns_plus_ilrr ilrr_data;
2350
2351 TRACE_FUNCTION ("rBAT_PlusILRR()");
2352
2353 resp.ctrl_response=BAT_RES_UNS_PLUS_ILRR;
2354 resp.response.ptr_res_plus_ilrr=&ilrr_data;
2355
2356 /*
2357 * T_ACI_BS_SPEED is very different from T_BAT_plus_ilrr_rate,
2358 * so we need this conversion.
2359 */
2360 switch (speed)
2361 {
2362 case BS_SPEED_NotPresent:
2363 /*
2364 * BAT does not include a 'not present' value, but I don't
2365 * see any better alternative than this.
2366 */
2367 ilrr_data.rate=(T_BAT_plus_ilrr_rate) -1;
2368 break;
2369
2370 case BS_SPEED_300_V21:
2371 case BS_SPEED_300_V110:
2372 ilrr_data.rate=BAT_ILRR_RATE_300;
2373 break;
2374
2375 case BS_SPEED_1200_V22:
2376 case BS_SPEED_1200_75_V23:
2377 case BS_SPEED_1200_V120:
2378 case BS_SPEED_1200_V110:
2379 ilrr_data.rate=BAT_ILRR_RATE_1200;
2380 break;
2381
2382 case BS_SPEED_2400_V22bis:
2383 case BS_SPEED_2400_V26ter:
2384 case BS_SPEED_2400_V120:
2385 case BS_SPEED_2400_V110:
2386 ilrr_data.rate=BAT_ILRR_RATE_2400;
2387 break;
2388
2389 case BS_SPEED_4800_V32:
2390 case BS_SPEED_4800_V120:
2391 case BS_SPEED_4800_V110:
2392 ilrr_data.rate=BAT_ILRR_RATE_4800;
2393 break;
2394
2395 case BS_SPEED_9600_V32:
2396 case BS_SPEED_9600_V34:
2397 case BS_SPEED_9600_V120:
2398 case BS_SPEED_9600_V110:
2399 ilrr_data.rate=BAT_ILRR_RATE_9600;
2400 break;
2401
2402 case BS_SPEED_14400_V34:
2403 case BS_SPEED_14400_V120:
2404 case BS_SPEED_14400_V110:
2405 ilrr_data.rate=BAT_ILRR_RATE_14400;
2406 break;
2407
2408 case BS_SPEED_19200_V110:
2409 ilrr_data.rate=BAT_ILRR_RATE_19200;
2410 break;
2411
2412 case BS_SPEED_38400_V110:
2413 ilrr_data.rate=BAT_ILRR_RATE_38400;
2414 break;
2415
2416 default:
2417 case BS_SPEED_AUTO:
2418 case BS_SPEED_28800_V110:
2419 ilrr_data.rate=BAT_ILRR_RATE_1;
2420 break;
2421 }
2422
2423 /*
2424 * This relies on T_ACI_BS_FRM and T_BAT_framing_format being
2425 * identical.
2426 */
2427 ilrr_data.framing_format=(T_BAT_framing_format)format;
2428
2429 /*
2430 * This relies on T_ACI_BS_PAR and T_BAT_framing_format being
2431 * identical.
2432 */
2433 ilrr_data.framing_parity=(T_BAT_framing_parity)parity;
2434
2435 /*
2436 * Get the source ID and a pointer to the PSI source information.
2437 */
2438 aci_bat_src_info(&src_id,&src_infos);
2439
2440 aci_bat_send(src_infos,&resp);
2441 }
2442
2443 /*
2444 +--------------------------------------------------------------------+
2445 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2446 | STATE : code ROUTINE : rBAT_BUSY |
2447 +--------------------------------------------------------------------+
2448
2449 PURPOSE :
2450 */
2451 GLOBAL void rBAT_BUSY(
2452 T_ACI_AT_CMD cmdId,
2453 SHORT cId)
2454 {
2455 T_BAT_cmd_response resp;
2456 T_BAT_no_parameter dummy;
2457 T_ACI_CMD_SRC src_id;
2458 T_ACI_DTI_PRC_PSI *src_infos;
2459
2460 TRACE_FUNCTION ("rBAT_BUSY()");
2461
2462 /*
2463 * Get the source ID and a pointer to the PSI source information.
2464 */
2465 aci_bat_src_info(&src_id,&src_infos);
2466
2467 if (src_infos->bat_client[src_infos->active_client].atd_live EQ TRUE)
2468 {
2469 /*
2470 * We were still waiting for a final response to ATD - this is it.
2471 */
2472 resp.ctrl_response=BAT_RES_AT_BUSY;
2473 src_infos->bat_client[src_infos->active_client].atd_live=FALSE;
2474 }
2475 else
2476 {
2477 /*
2478 * We've already had the final response to ATD, so this must be
2479 * an unsolicited message.
2480 */
2481 resp.ctrl_response=BAT_RES_UNS_AT_BUSY;
2482 }
2483
2484 resp.response.ptr_at_busy = &dummy;
2485 dummy.bat_dummy = 0xFF;
2486
2487 aci_bat_send(src_infos,&resp);
2488
2489 /* check for possible next command queued */
2490 aci_bat_run_cmd (src_infos);
2491 }
2492
2493 /*
2494 +--------------------------------------------------------------------+
2495 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2496 | STATE : code ROUTINE : rBAT_NO_ANSWER |
2497 +--------------------------------------------------------------------+
2498
2499 PURPOSE :
2500 */
2501 GLOBAL void rBAT_NO_ANSWER(
2502 T_ACI_AT_CMD cmdId,
2503 SHORT cId)
2504 {
2505 T_BAT_cmd_response resp;
2506 T_BAT_no_parameter dummy;
2507 T_ACI_CMD_SRC src_id;
2508 T_ACI_DTI_PRC_PSI *src_infos;
2509
2510 TRACE_FUNCTION ("rBAT_NO_ANSWER()");
2511
2512 /*
2513 * Get the source ID and a pointer to the PSI source information.
2514 */
2515 aci_bat_src_info(&src_id,&src_infos);
2516
2517 if (src_infos->bat_client[src_infos->active_client].atd_live EQ TRUE)
2518 {
2519 /*
2520 * We were still waiting for a final response to ATD - this is it.
2521 */
2522 resp.ctrl_response=BAT_RES_AT_NO_ANSWER;
2523 src_infos->bat_client[src_infos->active_client].atd_live=FALSE;
2524 }
2525 else
2526 {
2527 /*
2528 * We've already had the final response to ATD, so this must be
2529 * an unsolicited message.
2530 */
2531 resp.ctrl_response=BAT_RES_UNS_AT_NO_ANSWER;
2532 }
2533
2534 resp.response.ptr_at_no_answer = &dummy;
2535 dummy.bat_dummy = 0xFF;
2536
2537 aci_bat_send(src_infos,&resp);
2538
2539 /* check for possible next command queued */
2540 aci_bat_run_cmd (src_infos);
2541 }
2542
2543 /*
2544 +--------------------------------------------------------------------+
2545 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2546 | STATE : code ROUTINE : rBAT_PercentSIMREM |
2547 +--------------------------------------------------------------------+
2548
2549 PURPOSE :
2550 */
2551 GLOBAL void rBAT_PercentSIMREM(
2552 T_ACI_SIMREM_TYPE srType)
2553 {
2554 T_ACI_CMD_SRC src_id;
2555 T_ACI_DTI_PRC_PSI *src_infos;
2556 T_BAT_cmd_response resp;
2557 T_BAT_res_uns_percent_simrem simrem_data;
2558
2559 TRACE_FUNCTION ("rBAT_PercentSIMREM()");
2560
2561 /*
2562 * Get the source ID and a pointer to the PSI source information.
2563 */
2564 aci_bat_src_info(&src_id,&src_infos);
2565
2566 resp.ctrl_response=BAT_RES_UNS_PERCENT_SIMREM;
2567 resp.response.ptr_res_percent_simrem=&simrem_data;
2568
2569 /*
2570 * This relies on T_ACI_SIMREM_TYPE being identical to
2571 * T_BAT_percent_simrem_m.
2572 */
2573 simrem_data.m=(T_BAT_percent_simrem_m)srType;
2574
2575 aci_bat_send(src_infos,&resp);
2576 }
2577
2578 /*
2579 +--------------------------------------------------------------------+
2580 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2581 | STATE : code ROUTINE : rBAT_PlusCLIR |
2582 +--------------------------------------------------------------------+
2583
2584 PURPOSE :
2585 */
2586 GLOBAL void rBAT_PlusCLIR(
2587 T_ACI_CLIR_MOD mode,
2588 T_ACI_CLIR_STAT stat)
2589 {
2590 T_ACI_CMD_SRC src_id;
2591 T_ACI_DTI_PRC_PSI *src_infos;
2592 T_BAT_cmd_response resp;
2593 T_BAT_res_que_plus_clir clir_data;
2594
2595 TRACE_FUNCTION ("rBAT_PlusCLIR()");
2596
2597 /*
2598 * Get the source ID and a pointer to the PSI source information.
2599 */
2600 aci_bat_src_info(&src_id,&src_infos);
2601
2602 resp.ctrl_response=BAT_RES_QUE_PLUS_CLIR;
2603 resp.response.ptr_que_plus_clir=&clir_data;
2604
2605 /*
2606 * T_ACI_CLIR_STAT and T_BAT_plus_clir_m are identical except for
2607 * the fact that the BAT version does not include a 'not present'
2608 * value.
2609 */
2610 if (stat EQ CLIR_STAT_NotPresent)
2611 clir_data.m=BAT_CLIR_M_UNKNOWN;
2612 else
2613 clir_data.m=(T_BAT_plus_clir_m)stat;
2614
2615 /*
2616 * This relies on T_ACI_CLIR_MOD and T_BAT_plus_clir_n being
2617 * identical.
2618 */
2619 clir_data.n=(T_BAT_plus_clir_n)mode;
2620
2621 aci_bat_send(src_infos,&resp);
2622 }
2623
2624 /*
2625 +--------------------------------------------------------------------+
2626 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2627 | STATE : code ROUTINE : rBAT_PercentCOLR |
2628 +--------------------------------------------------------------------+
2629
2630 PURPOSE :
2631 */
2632 GLOBAL void rBAT_PercentCOLR(
2633 T_ACI_COLR_STAT stat)
2634 {
2635 #ifndef FF_ATI_BAT
2636
2637 /*
2638 * This is not included in the BAT interface, so ignore it.
2639 */
2640 TRACE_FUNCTION ("rBAT_PercentCOLR() - IGNORED");
2641
2642 #else
2643
2644 /*
2645 * But for test purposes, fake a response by calling the equivalent
2646 * ATI function directly.
2647 */
2648 TRACE_FUNCTION ("rBAT_PercentCOLR() - FAKE");
2649 rCI_PercentCOLR(stat);
2650
2651 #endif
2652 }
2653
2654 /*
2655 +--------------------------------------------------------------------+
2656 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2657 | STATE : code ROUTINE : rBAT_PlusCSSI |
2658 +--------------------------------------------------------------------+
2659
2660 PURPOSE :
2661 */
2662 GLOBAL void rBAT_PlusCSSI(
2663 T_ACI_CSSI_CODE code,
2664 SHORT index)
2665 {
2666 T_ACI_CMD_SRC src_id;
2667 T_ACI_DTI_PRC_PSI *src_infos;
2668 T_BAT_cmd_response resp;
2669 T_BAT_res_uns_plus_cssi cssi_data;
2670
2671 TRACE_FUNCTION ("rBAT_PlusCSSI()");
2672
2673 /*
2674 * Get the source ID and a pointer to the PSI source information.
2675 */
2676 aci_bat_src_info(&src_id,&src_infos);
2677
2678 resp.ctrl_response=BAT_RES_UNS_PLUS_CSSI;
2679 resp.response.ptr_res_plus_cssi=&cssi_data;
2680
2681 /*
2682 * This relies on T_ACI_CSSI_CODE being identical to
2683 * T_BAT_plus_cssi_code1.
2684 */
2685 cssi_data.code1=(T_BAT_plus_cssi_code1)code;
2686
2687 cssi_data.index=(S32)index;
2688
2689 aci_bat_send(src_infos,&resp);
2690 }
2691
2692 /*
2693 +--------------------------------------------------------------------+
2694 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2695 | STATE : code ROUTINE : rBAT_PlusCSSU |
2696 +--------------------------------------------------------------------+
2697
2698 PURPOSE :
2699 */
2700 GLOBAL void rBAT_PlusCSSU(
2701 T_ACI_CSSU_CODE code,
2702 SHORT index,
2703 CHAR *number,
2704 T_ACI_TOA *type,
2705 CHAR *subaddr,
2706 T_ACI_TOS *satype)
2707 {
2708 T_ACI_CMD_SRC src_id;
2709 T_ACI_DTI_PRC_PSI *src_infos;
2710 T_BAT_cmd_response resp;
2711 T_BAT_res_uns_plus_cssu cssu_data;
2712 UBYTE len;
2713
2714 TRACE_FUNCTION ("rBAT_PlusCSSU()");
2715
2716 /*
2717 * Get the source ID and a pointer to the PSI source information.
2718 */
2719 aci_bat_src_info(&src_id,&src_infos);
2720
2721 resp.ctrl_response=BAT_RES_UNS_PLUS_CSSU;
2722 resp.response.ptr_res_plus_cssu=&cssu_data;
2723
2724 /*
2725 * This relies on T_ACI_CSSU_CODE and T_BAT_plus_cssu_code2
2726 * being identical.
2727 */
2728 cssu_data.code2=(T_BAT_plus_cssu_code2)code;
2729
2730 cssu_data.index=(S32)index;
2731
2732 if (number EQ NULL)
2733 {
2734 cssu_data.v_number=FALSE;
2735 }
2736 else
2737 {
2738 len=strlen(number);
2739
2740 cssu_data.v_number=TRUE;
2741
2742 if (len<=BAT_MAX_CSSU_NUMBER_LEN)
2743 {
2744 memcpy(cssu_data.number,number,len);
2745 cssu_data.c_number=(U8)len;
2746 }
2747 else
2748 {
2749 /*
2750 * This is highly unlikely to happen, but if the number is too
2751 * big, then put as many digits as will fit in the BAT structure
2752 * from the END of the number.
2753 */
2754 memcpy(
2755 cssu_data.number,
2756 number+(len-BAT_MAX_CSSU_NUMBER_LEN),
2757 BAT_MAX_CSSU_NUMBER_LEN);
2758
2759 cssu_data.c_number=(U8)BAT_MAX_CSSU_NUMBER_LEN;
2760 }
2761 }
2762
2763 if (type EQ NULL)
2764 {
2765 cssu_data.type=-1;
2766 }
2767 else
2768 {
2769 cssu_data.type=(U16)toa_merge(*type);
2770 }
2771
2772 if (subaddr EQ NULL)
2773 {
2774 cssu_data.v_subaddr=FALSE;
2775 cssu_data.satype=-1;
2776 }
2777 else
2778 {
2779 cssu_data.v_subaddr=TRUE;
2780
2781 if (satype EQ NULL)
2782 cssu_data.satype=-1;
2783 else
2784 cssu_data.satype=(S16)tos_merge(*satype);
2785
2786 len=strlen(subaddr);
2787
2788 /*
2789 * Easiest thing to do is copy as much subaddress data as the
2790 * BAT structure can take. The length field will ensure that
2791 * there are no problems, and will result in the subaddress
2792 * being truncated if it is too long.
2793 */
2794 memcpy(cssu_data.subaddr,subaddr,BAT_MAX_SUBADDR_LENGTH);
2795
2796 if (len>BAT_MAX_SUBADDR_LENGTH)
2797 cssu_data.c_subaddr=BAT_MAX_SUBADDR_LENGTH;
2798 else
2799 cssu_data.c_subaddr=len;
2800 }
2801
2802 aci_bat_send(src_infos,&resp);
2803 }
2804
2805 /*
2806 +--------------------------------------------------------------------+
2807 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2808 | STATE : code ROUTINE : rBAT_PlusCUSD |
2809 +--------------------------------------------------------------------+
2810
2811 PURPOSE :
2812 */
2813 GLOBAL void rBAT_PlusCUSD(
2814 T_ACI_CUSD_MOD m,
2815 T_ACI_USSD_DATA *ussd,
2816 SHORT dcs)
2817 {
2818 T_ACI_CMD_SRC src_id;
2819 T_ACI_DTI_PRC_PSI *src_infos;
2820 T_BAT_cmd_response resp;
2821 T_BAT_res_uns_plus_cusd cusd_data;
2822
2823 TRACE_FUNCTION ("rBAT_PlusCUSD()");
2824
2825 /*
2826 * Get the source ID and a pointer to the PSI source information.
2827 */
2828 aci_bat_src_info(&src_id,&src_infos);
2829
2830 resp.ctrl_response=BAT_RES_UNS_PLUS_CUSD;
2831 resp.response.ptr_res_plus_cusd=&cusd_data;
2832
2833 /*
2834 * This assumes that T_ACI_CUSD_MOD and
2835 * T_BAT_VAL_plus_cusd_m are equivalent.
2836 */
2837 cusd_data.m=(T_BAT_VAL_plus_cusd_m)m;
2838
2839 if (ussd)
2840 {
2841 USHORT len;
2842
2843 /* If USSD string is coming as 7-bit default GSM char from N/w
2844 * and ME uses 2 bytes UCS2 character set for display.
2845 */
2846 if (( cmh_getAlphabetCb ( dcs ) EQ CSCS_ALPHA_7_Bit ) AND
2847 (ati_user_output_cfg[src_id].cscsChset EQ CSCS_CHSET_Ucs2))
2848 {
2849 utl_ucs2FromGsm_ussd(
2850 ussd->data,
2851 ussd->len,
2852 (UBYTE *)cusd_data.str,
2853 BAT_MAX_USSD_LEN,
2854 &len,
2855 GSM_ALPHA_Def,
2856 CSCS_ALPHA_8_Bit );
2857 }
2858 else {
2859 utl_ussdDtaToTe(
2860 ussd->data,
2861 ussd->len,
2862 (UBYTE *)cusd_data.str,
2863 BAT_MAX_USSD_LEN,
2864 &len,
2865 (UBYTE)dcs);
2866 }
2867 cusd_data.c_str=(U16)len;
2868 cusd_data.v_str=TRUE;
2869 }
2870 else
2871 {
2872 cusd_data.v_str=FALSE;
2873 }
2874
2875 cusd_data.dcs=(S16)dcs;
2876
2877 aci_bat_send(src_infos,&resp);
2878 }
2879
2880 /*
2881 +--------------------------------------------------------------------+
2882 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2883 | STATE : code ROUTINE : rBAT_PlusCCFC |
2884 +--------------------------------------------------------------------+
2885
2886 PURPOSE :
2887 */
2888 GLOBAL void rBAT_PlusCCFC (T_ACI_CCFC_SET* setting)
2889 {
2890 T_ACI_CMD_SRC src_id;
2891 T_ACI_DTI_PRC_PSI *src_infos;
2892 T_BAT_cmd_response resp;
2893 T_BAT_res_set_plus_ccfc ccfc_data = {BAT_CCFC_STATUS_NOT_ACTIVE,
2894 BAT_CCFC_CLASS_NOT_PRESENT,
2895 0,0,{0},0,0,0,0,{0},0,
2896 BAT_CCFC_TIME_NOT_PRESENT};
2897
2898 /*
2899 * Get the source ID and a pointer to the PSI source information.
2900 */
2901 aci_bat_src_info(&src_id,&src_infos);
2902
2903 TRACE_FUNCTION ("rBAT_PlusCCFC()");
2904
2905 /* fill the BAT response struct */
2906 resp.ctrl_response = BAT_RES_SET_PLUS_CCFC;
2907 resp.response.ptr_set_plus_ccfc = &ccfc_data;
2908
2909 ccfc_data.status = (T_BAT_plus_ccfc_status)setting->clsstat.status;
2910 ccfc_data.bearer_class = (T_BAT_plus_ccfc_bearer_class)setting->clsstat.class_type;
2911
2912 if (ccfc_data.c_number = strlen(setting->number))
2913 {
2914 ccfc_data.v_number = TRUE;
2915 memcpy(ccfc_data.number, setting->number, ccfc_data.c_number);
2916 }
2917
2918 /* Convert type to string */
2919 ccfc_data.type = toa_merge(setting->type);
2920
2921 if(ccfc_data.c_subaddr = strlen(setting->subaddr))
2922 {
2923 ccfc_data.v_subaddr = TRUE;
2924 memcpy(ccfc_data.subaddr, setting->subaddr, ccfc_data.c_subaddr);
2925 }
2926
2927 /* Convert sattype to string */
2928 ccfc_data.satype = tos_merge(setting->satype);
2929
2930 ccfc_data.time = (T_BAT_plus_ccfc_time)setting->time;
2931
2932 aci_bat_send(src_infos,&resp);
2933 }
2934
2935 /*
2936 +--------------------------------------------------------------------+
2937 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2938 | STATE : code ROUTINE : rBAT_PlusCLCK |
2939 +--------------------------------------------------------------------+
2940
2941 PURPOSE :
2942 */
2943 GLOBAL void rBAT_PlusCLCK(
2944 T_ACI_CLSSTAT *clsStat)
2945 {
2946 T_ACI_CMD_SRC src_id;
2947 T_ACI_DTI_PRC_PSI *src_infos;
2948 T_BAT_cmd_response resp;
2949 T_BAT_res_set_plus_clck clck_data;
2950
2951 TRACE_FUNCTION ("rBAT_PlusCLCK()");
2952
2953 /*
2954 * This shouldn't happen, but there's no point carrying on
2955 * if it does.
2956 */
2957 if (clsStat EQ NULL)
2958 return;
2959
2960 /*
2961 * Get the source ID and a pointer to the PSI source information.
2962 */
2963 aci_bat_src_info(&src_id,&src_infos);
2964
2965 resp.ctrl_response=BAT_RES_SET_PLUS_CLCK;
2966 resp.response.ptr_set_plus_clck=&clck_data;
2967
2968 /*
2969 * This relies on T_ACI_CLASS being identical to
2970 * T_BAT_bearer_class.
2971 */
2972 clck_data.bearer_class=(T_BAT_bearer_class)clsStat->class_type;
2973
2974 /*
2975 * This relies on T_ACI_STATUS being identical to
2976 * T_BAT_plus_clck_status. It is, except that the BAT does not
2977 * have a 'not present' value.
2978 */
2979 clck_data.status=(T_BAT_plus_clck_status)clsStat->status;
2980
2981 aci_bat_send(src_infos,&resp);
2982 }
2983
2984 /*
2985 +--------------------------------------------------------------------+
2986 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
2987 | STATE : code ROUTINE : rBAT_PlusCIMI |
2988 +--------------------------------------------------------------------+
2989
2990 PURPOSE :
2991 */
2992 GLOBAL void rBAT_PlusCIMI(
2993 CHAR *imsi)
2994 {
2995 T_ACI_CMD_SRC src_id;
2996 T_ACI_DTI_PRC_PSI *src_infos;
2997 T_BAT_cmd_response resp;
2998 T_BAT_res_set_plus_cimi cimi_data;
2999 UBYTE len;
3000
3001 TRACE_FUNCTION ("rBAT_PlusCIMI()");
3002
3003 /*
3004 * This shouldn't happen, but there's no point carrying on
3005 * if it does.
3006 */
3007 if (imsi EQ NULL)
3008 return;
3009
3010 len=strlen(imsi);
3011
3012 /*
3013 * There is also no point carrying on if the BAT structure has
3014 * insufficient space to store the whole IMSI.
3015 */
3016 if (len>BAT_MAX_CIMI_IMSI_LEN)
3017 return;
3018
3019 /*
3020 * Get the source ID and a pointer to the PSI source information.
3021 */
3022 aci_bat_src_info(&src_id,&src_infos);
3023
3024 resp.ctrl_response=BAT_RES_SET_PLUS_CIMI;
3025 resp.response.ptr_set_plus_cimi=&cimi_data;
3026
3027 memcpy(cimi_data.imsi,imsi,BAT_MAX_CIMI_IMSI_LEN);
3028 cimi_data.c_imsi=(U8)len;
3029
3030 aci_bat_send(src_infos,&resp);
3031 }
3032
3033 #ifdef SIM_TOOLKIT
3034 /*
3035 +--------------------------------------------------------------------+
3036 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3037 | STATE : code ROUTINE : rBAT_PercentSATI |
3038 +--------------------------------------------------------------------+
3039
3040 PURPOSE :
3041 */
3042 GLOBAL void rBAT_PercentSATI ( SHORT len, UBYTE* satCmd )
3043 {
3044 T_ACI_CMD_SRC src_id;
3045 T_ACI_DTI_PRC_PSI *src_infos;
3046 T_BAT_cmd_response resp;
3047 T_BAT_res_uns_percent_sati sati_data = {0};
3048
3049
3050 TRACE_FUNCTION ("rBAT_PercentSATI()");
3051 /*
3052 * Get the source ID and a pointer to the PSI source information.
3053 */
3054 aci_bat_src_info(&src_id,&src_infos);
3055
3056 /* fill the response struct and call aci_bat_send() */
3057 resp.ctrl_response = BAT_RES_UNS_PERCENT_SATI;
3058 resp.response.ptr_res_percent_sati = &sati_data;
3059
3060 /* Limit copy length to the BAT size */
3061 if(sati_data.c_satcmd = len)
3062 memcpy(sati_data.satcmd, satCmd,
3063 (sati_data.c_satcmd <= BAT_MAX_SATI_SAT_CMD_LEN) ?
3064 sati_data.c_satcmd : BAT_MAX_SATI_SAT_CMD_LEN);
3065
3066 aci_bat_send(src_infos,&resp);
3067 }
3068
3069 /*
3070 +--------------------------------------------------------------------+
3071 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3072 | STATE : code ROUTINE : rBAT_PercentSATE |
3073 +--------------------------------------------------------------------+
3074
3075 PURPOSE :
3076 */
3077 GLOBAL void rBAT_PercentSATE (SHORT len, UBYTE* satCmd)
3078 {
3079 T_ACI_CMD_SRC src_id;
3080 T_ACI_DTI_PRC_PSI *src_infos;
3081 T_BAT_cmd_response resp;
3082 T_BAT_res_set_percent_sate sate_data = {0};
3083
3084 TRACE_FUNCTION ("rBAT_PercentSATE()");
3085 /*
3086 * Get the source ID and a pointer to the PSI source information.
3087 */
3088 aci_bat_src_info(&src_id,&src_infos);
3089
3090 /* fill the response struct and call aci_bat_send() */
3091 resp.ctrl_response = BAT_RES_SET_PERCENT_SATE;
3092 resp.response.ptr_set_percent_sate = &sate_data;
3093
3094 /* Limit copy length to the BAT size */
3095 if(sate_data.c_satrsp = len)
3096 memcpy(sate_data.satrsp, satCmd,
3097 (sate_data.c_satrsp <= BAT_MAX_SATE_SAT_RSP_LEN) ?
3098 sate_data.c_satrsp : BAT_MAX_SATE_SAT_RSP_LEN);
3099
3100 aci_bat_send(src_infos,&resp);
3101 }
3102 #endif /* SIM_TOOLKIT */
3103
3104
3105 /*
3106 +--------------------------------------------------------------------+
3107 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3108 | STATE : code ROUTINE : rBAT_PercentIMEI |
3109 +--------------------------------------------------------------------+
3110
3111 PURPOSE : response to atd*#06# query the IMEI
3112 */
3113
3114 GLOBAL void rBAT_PercentIMEI(T_ACI_IMEI *imei)
3115 {
3116 T_ACI_CMD_SRC src_id;
3117 T_ACI_DTI_PRC_PSI *src_infos;
3118 T_BAT_cmd_response resp;
3119 T_BAT_res_que_percent_imei rsp_imei;
3120
3121 TRACE_FUNCTION ("rBAT_PercentIMEI()");
3122
3123 aci_bat_src_info(&src_id,&src_infos);
3124
3125 resp.ctrl_response = BAT_RES_QUE_PERCENT_IMEI;
3126 resp.response.ptr_que_percent_imei = &rsp_imei;
3127
3128 memcpy(&rsp_imei, imei, sizeof(T_BAT_res_que_percent_imei));
3129
3130 aci_bat_send(src_infos,&resp);
3131 }
3132
3133 /*
3134 +--------------------------------------------------------------------+
3135 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3136 | STATE : code ROUTINE : rBAT_PercentKSIR |
3137 +--------------------------------------------------------------------+
3138
3139 PURPOSE :
3140 */
3141 GLOBAL void rBAT_PercentKSIR (T_ACI_KSIR *ksStat)
3142 {
3143 T_ACI_CMD_SRC src_id;
3144 T_ACI_DTI_PRC_PSI *src_infos;
3145
3146 TRACE_FUNCTION ("rBAT_PercentKSIR()");
3147
3148 aci_bat_src_info(&src_id,&src_infos);
3149
3150 utl_cb_percentKSIR ((U8)src_id, ksStat);
3151 }
3152
3153 /*
3154 +--------------------------------------------------------------------+
3155 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3156 | STATE : code ROUTINE : rBAT_PercentCPI |
3157 +--------------------------------------------------------------------+
3158
3159 PURPOSE :
3160 */
3161 GLOBAL void rBAT_PercentCPI(
3162 SHORT cId,
3163 T_ACI_CPI_MSG msgType,
3164 T_ACI_CPI_IBT ibt,
3165 T_ACI_CPI_TCH tch,
3166 USHORT cause)
3167 {
3168 T_ACI_CMD_SRC src_id;
3169 T_ACI_DTI_PRC_PSI *src_infos;
3170 T_BAT_cmd_response resp;
3171 T_BAT_res_uns_percent_cpi cpi_data;
3172 T_ACI_CLCC_CALDESC clist[MAX_CALL_NR];
3173 UBYTE len;
3174 SHORT i;
3175
3176 TRACE_FUNCTION ("rBAT_PercentCPI()");
3177
3178 /*
3179 * Get the source ID and a pointer to the PSI source information.
3180 */
3181 aci_bat_src_info(&src_id,&src_infos);
3182
3183 resp.ctrl_response=BAT_RES_UNS_PERCENT_CPI;
3184 resp.response.ptr_res_percent_cpi=&cpi_data;
3185
3186 cpi_data.cid=(U8)cId;
3187
3188 /*
3189 * This relies on T_ACI_CPI_MSG being equivalent to
3190 * T_BAT_percent_cpi_msgtype.
3191 */
3192 cpi_data.msgtype=(T_BAT_percent_cpi_msgtype)msgType;
3193
3194 /*
3195 * This relies on T_ACI_CPI_IBT being equivalent to
3196 * T_BAT_percent_cpi_ibt.
3197 */
3198 cpi_data.ibt=(T_BAT_percent_cpi_ibt)ibt;
3199
3200 /*
3201 * This relies on T_ACI_CPI_TCH being equivalent to
3202 * T_BAT_percent_cpi_tch.
3203 */
3204 cpi_data.tch=(T_BAT_percent_cpi_tch)tch;
3205
3206 /*
3207 * Issue : OMAPS00061262, Removed the two TI internal Causes
3208 * MNCC_CAUSE_REEST_STARTED & MNCC_CAUSE_REEST_FINISHED from the %CPI
3209 */
3210 if( GET_CAUSE_ORIGIN_ENTITY(cause) EQ MNCC_CC_ORIGINATING_ENTITY AND
3211 GET_CAUSE_DEFBY(cause) EQ DEFBY_STD )
3212 {
3213 cpi_data.cause=(S32)GET_CAUSE_VALUE(cause);
3214 }
3215 else
3216 {
3217 cpi_data.cause=(S32) BAT_PARAMETER_NOT_PRESENT;
3218 }
3219
3220 /*
3221 * Set all the rest of the information to 'not present' as a
3222 * default.
3223 */
3224 cpi_data.dir=NOT_PRESENT_8BIT;
3225 cpi_data.mode=-1;
3226 cpi_data.type=-1;
3227 cpi_data.v_number=FALSE;
3228 cpi_data.v_alpha=FALSE;
3229 cpi_data.line=-1;
3230 cpi_data.prog_desc = BAT_P_CPI_PROG_DESC_NOT_PRESENT;
3231
3232 /*
3233 * Now try to obtain the rest of the information.
3234 */
3235 if (qAT_PercentCLCC(src_id,clist) EQ AT_CMPL)
3236 {
3237 for (i=0;i<MAX_CALL_NR;i++)
3238 {
3239 T_ACI_CLCC_CALDESC *call;
3240
3241 /*
3242 * Get a pointer to this particular call for convenience.
3243 */
3244 call=&clist[i];
3245
3246 if (call->idx EQ ACI_NumParmNotPresent)
3247 break;
3248
3249 if (call->idx EQ cId)
3250 {
3251 cpi_data.dir=(U8)call->dir;
3252 cpi_data.mode=(S16)call->mode;
3253
3254 len=strlen(call->number);
3255
3256 if (len AND (len<=BAT_MAX_CPI_NUMBER_LEN))
3257 {
3258 cpi_data.v_number=TRUE;
3259 memcpy(cpi_data.number,call->number,len);
3260 cpi_data.c_number=(U8)len;
3261 }
3262
3263 if (call->type.ton NEQ TON_NotPresent)
3264 cpi_data.type=(S16)toa_merge(call->type);
3265
3266 if (call->alpha.len)
3267 {
3268 USHORT len_cvtd_alpha;
3269
3270 #ifdef NO_ASCIIZ
3271 utl_chsetFromGsm(
3272 call->alpha.data,
3273 call->alpha.len,
3274 cpi_data.alpha,
3275 BAT_MAX_CPI_ALPHA_LEN,
3276 &len_cvtd_alpha,
3277 GSM_ALPHA_Def);
3278 #else
3279 utl_chsetFromGsm(
3280 call->alpha,
3281 0,
3282 cpi_data.alpha,
3283 BAT_MAX_CPI_ALPHA_LEN,
3284 &len_cvtd_alpha,
3285 GSM_ALPHA_Int);
3286 #endif
3287
3288 cpi_data.c_alpha=(U8)len_cvtd_alpha;
3289 cpi_data.v_alpha=TRUE;
3290 }
3291
3292 cpi_data.line=(S16)call->class_type;
3293 cpi_data.prog_desc = (T_BAT_percent_cpi_prog_desc)call->prog_desc;
3294
3295 /*
3296 * We have the information, now break out of the for loop.
3297 */
3298 break;
3299
3300 }
3301 }
3302 }
3303
3304 aci_bat_send(src_infos,&resp);
3305 }
3306
3307 /*
3308 +--------------------------------------------------------------------+
3309 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3310 | STATE : code ROUTINE : rBAT_PercentCTYI |
3311 +--------------------------------------------------------------------+
3312
3313 PURPOSE :
3314 */
3315 GLOBAL void rBAT_PercentCTYI(
3316 T_ACI_CTTY_NEG neg,
3317 T_ACI_CTTY_TRX trx)
3318 {
3319 T_ACI_CMD_SRC src_id;
3320 T_ACI_DTI_PRC_PSI *src_infos;
3321 T_BAT_cmd_response resp;
3322 T_BAT_res_uns_percent_ctyi ctyi_data;
3323
3324 TRACE_FUNCTION ("rBAT_PercentCTYI()");
3325
3326 /*
3327 * Get the source ID and a pointer to the PSI source information.
3328 */
3329 aci_bat_src_info(&src_id,&src_infos);
3330
3331 resp.ctrl_response=BAT_RES_UNS_PERCENT_CTYI;
3332 resp.response.ptr_res_percent_ctyi=&ctyi_data;
3333
3334 /*
3335 * This relies on T_ACI_CTTY_NEG and T_BAT_percent_ctyi_neg
3336 * being identical.
3337 */
3338 ctyi_data.neg=(T_BAT_percent_ctyi_neg)neg;
3339
3340 /*
3341 * The BAT has a 'not present' value but not an 'unknown' value,
3342 * vice versa for the ACI.
3343 */
3344 if (trx EQ CTTY_TRX_Unknown)
3345 ctyi_data.trx=BAT_TRX_NOT_PRESENT;
3346 else
3347 ctyi_data.trx=(T_BAT_trx)trx;
3348
3349 aci_bat_send(src_infos,&resp);
3350 }
3351
3352 /*
3353 +--------------------------------------------------------------------+
3354 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3355 | STATE : code ROUTINE : rBAT_PlusCNUM |
3356 +--------------------------------------------------------------------+
3357
3358 PURPOSE :
3359 */
3360 GLOBAL void rBAT_PlusCNUM(
3361 T_ACI_CNUM_MSISDN *msisdn,
3362 UBYTE num)
3363 {
3364 T_ACI_CMD_SRC src_id;
3365 T_ACI_DTI_PRC_PSI *src_infos;
3366 T_BAT_cmd_response resp;
3367 T_BAT_res_set_plus_cnum cnum_data;
3368 UBYTE i;
3369 UBYTE len;
3370
3371 TRACE_FUNCTION ("rBAT_PlusCNUM()");
3372
3373 /*
3374 * This shouldn't happen, but there's no point carrying on
3375 * if it does.
3376 */
3377 if (msisdn EQ NULL)
3378 return;
3379
3380 /*
3381 * Get the source ID and a pointer to the PSI source information.
3382 */
3383 aci_bat_src_info(&src_id,&src_infos);
3384
3385 resp.ctrl_response=BAT_RES_SET_PLUS_CNUM;
3386 resp.response.ptr_set_plus_cnum=&cnum_data;
3387
3388 /*
3389 * This has delivered a list, however the BAT response only
3390 * allows for single items. So we must send each one
3391 * individually.
3392 */
3393 for (i=0;i<num;i++)
3394 {
3395 T_ACI_CNUM_MSISDN *m;
3396
3397 /*
3398 * Get a pointer to this particular item for convenience.
3399 */
3400 m=&msisdn[i];
3401
3402 if (m->vldFlag EQ TRUE)
3403 {
3404 len=strlen(m->alpha);
3405
3406 if (len)
3407 {
3408 USHORT cvtd_len=0;
3409
3410 cnum_data.v_alpha=TRUE;
3411
3412 utl_chsetFromGsm(
3413 (UBYTE *)m->alpha,
3414 (USHORT)len,
3415 (UBYTE *)cnum_data.alpha,
3416 BAT_MAX_CNUM_ALPHA_LEN,
3417 &cvtd_len,
3418 GSM_ALPHA_Int);
3419
3420 cnum_data.c_alpha=(U8)cvtd_len;
3421 }
3422 else
3423 {
3424 cnum_data.v_alpha=FALSE;
3425 }
3426
3427 len=strlen(m->number);
3428
3429 if (len<=BAT_MAX_CNUM_NUMBER_LEN)
3430 {
3431 memcpy(cnum_data.number,m->number,len);
3432 cnum_data.c_number=(U8)len;
3433 }
3434 else
3435 {
3436 /*
3437 * This is highly unlikely to happen, but if the number is too
3438 * big, then put as many digits as will fit in the BAT structure
3439 * from the END of the number.
3440 */
3441 memcpy(
3442 cnum_data.number,
3443 m->number+(len-BAT_MAX_CNUM_NUMBER_LEN),
3444 BAT_MAX_CNUM_NUMBER_LEN);/*lint -e670 (Warning - Possible access beyond array for function)*/
3445
3446 cnum_data.c_number=(U8)BAT_MAX_CNUM_NUMBER_LEN;
3447 }
3448
3449 cnum_data.type=(U8)toa_merge(m->type);
3450
3451 cnum_data.index=(U8)i;
3452
3453 /*
3454 * Note that we are losing 'speed', 'service' and 'itc'
3455 * as they are not in the BAT.
3456 */
3457
3458 aci_bat_send(src_infos,&resp);
3459 }
3460 }
3461 }
3462
3463 /*
3464 +--------------------------------------------------------------------+
3465 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3466 | STATE : code ROUTINE : rBAT_PlusCPOL |
3467 +--------------------------------------------------------------------+
3468
3469 PURPOSE :
3470 */
3471 GLOBAL void rBAT_PlusCPOL(
3472 SHORT startIdx,
3473 SHORT lastIdx,
3474 T_ACI_CPOL_OPDESC *operLst,
3475 SHORT usdNtry)
3476 {
3477 T_ACI_CMD_SRC src_id;
3478 T_ACI_DTI_PRC_PSI *src_infos;
3479 T_BAT_cmd_response resp;
3480
3481 TRACE_FUNCTION ("rBAT_PlusCPOL()");
3482
3483 /*
3484 * Get the source ID and a pointer to the PSI source information.
3485 */
3486 aci_bat_src_info(&src_id,&src_infos);
3487
3488 /*
3489 * This could be a response to either a query or a test command.
3490 */
3491 if (aci_bat_cur_cmd_get(src_infos) EQ BAT_CMD_TST_PLUS_CPOL)
3492 {
3493 T_BAT_res_tst_plus_cpol cpol_data;
3494
3495 resp.ctrl_response=BAT_RES_TST_PLUS_CPOL;
3496 resp.response.ptr_tst_plus_cpol=&cpol_data;
3497
3498 /*
3499 * Note that we lose usdNtry, which is not in the BAT (or in
3500 * GSM 07.07) but is in the ACI. Whether this will give us
3501 * problems is for further study.
3502 */
3503 cpol_data.index1=((S16)startIdx EQ ACI_NumParmNotPresent) ? 1 : (S16)startIdx;
3504 cpol_data.index2=(S16)lastIdx;
3505
3506 aci_bat_send(src_infos,&resp);
3507 }
3508 else if (operLst NEQ NULL)
3509 {
3510 T_BAT_res_que_plus_cpol cpol_data;
3511 UBYTE i;
3512
3513 resp.ctrl_response=BAT_RES_QUE_PLUS_CPOL;
3514 resp.response.ptr_que_plus_cpol=&cpol_data;
3515
3516 /*
3517 * This has delivered a list, however the BAT response only
3518 * allows for single items. So we must send each one
3519 * individually.
3520 */
3521 for (i=0;i<MAX_OPER;i++)
3522 {
3523 T_ACI_CPOL_OPDESC *o;
3524 UBYTE len;
3525
3526 /*
3527 * Get a pointer to this particular item for convenience.
3528 */
3529 o=&operLst[i];
3530
3531 /*
3532 * Stop when we reach the end of the list.
3533 */
3534 if (o->index EQ ACI_NumParmNotPresent)
3535 break;
3536
3537 cpol_data.index=(U8)o->index;
3538
3539 /*
3540 * This relies on T_ACI_CPOL_FRMT and T_BAT_plus_cpol_format
3541 * being identical.
3542 */
3543 cpol_data.format=(T_BAT_plus_cpol_format)o->format;
3544
3545 len=strlen(o->oper);
3546
3547 /*
3548 * We copy as much of the operator name as the BAT structure
3549 * can handle. If it is too long it will effectively be
3550 * truncated.
3551 */
3552 if (len>BAT_MAX_CPOL_OPER_LEN)
3553 cpol_data.c_oper=BAT_MAX_CPOL_OPER_LEN;
3554 else
3555 cpol_data.c_oper=(U8)len;
3556
3557 memcpy(cpol_data.oper,o->oper,sizeof(o->oper));
3558
3559 aci_bat_send(src_infos,&resp);
3560 }
3561 }
3562 }
3563
3564 /*
3565 +--------------------------------------------------------------------+
3566 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3567 | STATE : code ROUTINE : rBAT_PlusCCCM |
3568 +--------------------------------------------------------------------+
3569
3570 PURPOSE :
3571 */
3572 GLOBAL void rBAT_PlusCCCM(
3573 LONG *ccm)
3574 {
3575 T_ACI_CMD_SRC src_id;
3576 T_ACI_DTI_PRC_PSI *src_infos;
3577 T_BAT_cmd_response resp;
3578 T_BAT_res_uns_plus_cccm cccm_data;
3579
3580 TRACE_FUNCTION ("rBAT_PlusCCCM()");
3581
3582 /*
3583 * This shouldn't happen, but there's no point carrying on
3584 * if it does.
3585 */
3586 if (ccm EQ NULL)
3587 return;
3588
3589 /*
3590 * Get the source ID and a pointer to the PSI source information.
3591 */
3592 aci_bat_src_info(&src_id,&src_infos);
3593
3594 resp.ctrl_response=BAT_RES_UNS_PLUS_CCCM;
3595 resp.response.ptr_res_plus_cccm=&cccm_data;
3596
3597 cccm_data.ccm=(U32)*ccm;
3598
3599 aci_bat_send(src_infos,&resp);
3600 }
3601
3602 /*
3603 +--------------------------------------------------------------------+
3604 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3605 | STATE : code ROUTINE : rBAT_PercentCTV |
3606 +--------------------------------------------------------------------+
3607
3608 PURPOSE :
3609 */
3610 GLOBAL void rBAT_PercentCTV(void)
3611 {
3612 #ifndef FF_ATI_BAT
3613 /*
3614 * This is not included in the BAT interface, so ignore it.
3615 */
3616 TRACE_FUNCTION ("rBAT_PercentCTV() - IGNORED");
3617 #else
3618 /*
3619 * But for test purposes, fake a response by calling the equivalent
3620 * ATI function directly.
3621 */
3622 TRACE_FUNCTION ("rBAT_PercentCTV() - FAKE");
3623 rCI_PercentCTV();
3624 #endif
3625 }
3626
3627 #ifdef SIM_TOOLKIT
3628 /*
3629 +--------------------------------------------------------------------+
3630 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3631 | STATE : code ROUTINE : rBAT_PercentSATN |
3632 +--------------------------------------------------------------------+
3633
3634 PURPOSE :
3635
3636 N.B. Not all ACI parameters are supported by BAT
3637 ACI parameters are SHORT len, UBYTE* satCmd, T_ACI_SATN_CNTRL_TYPE cntrl_type
3638 */
3639 GLOBAL void rBAT_PercentSATN (SHORT len, UBYTE* satCmd, T_ACI_SATN_CNTRL_TYPE cntrl_type)
3640 {
3641 T_ACI_CMD_SRC src_id;
3642 T_ACI_DTI_PRC_PSI *src_infos;
3643 T_BAT_cmd_response resp;
3644 T_BAT_res_uns_percent_satn satn_data = {0};
3645
3646 TRACE_FUNCTION ("rBAT_PercentSATN()");
3647 /*
3648 * Get the source ID and a pointer to the PSI source information.
3649 */
3650 aci_bat_src_info(&src_id,&src_infos);
3651
3652 /* fill the response struct and call aci_bat_send() */
3653 resp.ctrl_response = BAT_RES_UNS_PERCENT_SATN;
3654 resp.response.ptr_res_percent_satn = &satn_data;
3655
3656 if(satn_data.c_satcmd = len)
3657 memcpy(satn_data.satcmd, satCmd,
3658 (satn_data.c_satcmd <= BAT_MAX_SATN_SAT_CMD_LEN) ?
3659 satn_data.c_satcmd : BAT_MAX_SATN_SAT_CMD_LEN);
3660
3661 aci_bat_send(src_infos,&resp);
3662 }
3663
3664 /*
3665 +--------------------------------------------------------------------+
3666 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3667 | STATE : code ROUTINE : rBAT_PercentSATA |
3668 +--------------------------------------------------------------------+
3669
3670 PURPOSE :
3671
3672 N.B. Not all ACI parameters are supported by BAT
3673 ACI parameters are SHORT cId, LONG rdlTimeout_ms, T_ACI_SATA_ADD* addParm
3674 */
3675 #ifdef FF_SAT_E
3676 GLOBAL void rBAT_PercentSATA (SHORT cId, LONG rdlTimeout_ms, T_ACI_SATA_ADD* addParm)
3677 #else
3678 GLOBAL void rBAT_PercentSATA (SHORT cId, LONG rdlTimeout_ms)
3679 #endif
3680 {
3681 T_ACI_CMD_SRC src_id;
3682 T_ACI_DTI_PRC_PSI *src_infos;
3683 T_BAT_cmd_response resp;
3684 T_BAT_res_uns_percent_sata sata_data = {0};
3685
3686 TRACE_FUNCTION ("rBAT_PercentSATA()");
3687
3688 #ifdef FF_SAT_E
3689 /* Store for use with rCI_PercentSATA - ATI maintenace
3690 * Addparm is a global variable ! */
3691 memcpy(&Addparm, addParm, sizeof(T_ACI_SATA_ADD));
3692 #endif
3693
3694 /*
3695 * Get the source ID and a pointer to the PSI source information.
3696 */
3697 aci_bat_src_info(&src_id,&src_infos);
3698
3699 /* fill the response struct and call aci_bat_send() */
3700 resp.ctrl_response = BAT_RES_UNS_PERCENT_SATA;
3701 resp.response.ptr_res_percent_sata = &sata_data;
3702 sata_data.redial_timeout = (S32)rdlTimeout_ms;
3703 aci_bat_send(src_infos,&resp);
3704 }
3705 #endif /* SIM_TOOLKIT */
3706
3707 /*
3708 +--------------------------------------------------------------------+
3709 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3710 | STATE : code ROUTINE : rBAT_sms_ready |
3711 +--------------------------------------------------------------------+
3712
3713 PURPOSE :
3714 */
3715 GLOBAL void rBAT_sms_ready(void)
3716 {
3717 #ifndef FF_ATI_BAT
3718
3719 /*
3720 * This is not included in the BAT interface, so ignore it.
3721 */
3722 TRACE_FUNCTION ("rBAT_sms_ready() - IGNORED");
3723
3724 #else
3725
3726 /*
3727 * But for test purposes, fake a response by calling the equivalent
3728 * ATI function directly.
3729 */
3730 TRACE_FUNCTION ("rBAT_sms_ready() - FAKE");
3731 rCI_sms_ready();
3732
3733 #endif
3734 }
3735
3736 /*
3737 +--------------------------------------------------------------------+
3738 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3739 | STATE : code ROUTINE : rBAT_phb_status |
3740 +--------------------------------------------------------------------+
3741
3742 PURPOSE :
3743 */
3744 GLOBAL void rBAT_phb_status(
3745 T_ACI_PB_STAT status)
3746 {
3747 #ifndef FF_ATI_BAT
3748
3749 /*
3750 * This is not included in the BAT interface, so ignore it.
3751 */
3752 TRACE_FUNCTION ("rBAT_phb_status() - IGNORED");
3753
3754 #else
3755
3756 /*
3757 * But for test purposes, fake a response by calling the equivalent
3758 * ATI function directly.
3759 */
3760 TRACE_FUNCTION ("rBAT_phb_status() - FAKE");
3761 rCI_phb_status(status);
3762
3763 #endif
3764 }
3765
3766 /*
3767 +--------------------------------------------------------------------+
3768 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3769 | STATE : code ROUTINE : rBAT_PercentSIMINS |
3770 +--------------------------------------------------------------------+
3771
3772 PURPOSE :
3773 */
3774 GLOBAL void rBAT_PercentSIMINS(
3775 T_ACI_CME_ERR err)
3776 {
3777 T_ACI_CMD_SRC src_id;
3778 T_ACI_DTI_PRC_PSI *src_infos;
3779 T_BAT_cmd_response resp;
3780 T_BAT_res_uns_percent_simins simins_data;
3781
3782 TRACE_FUNCTION ("rBAT_PercentSIMINS()");
3783
3784 /*
3785 * Get the source ID and a pointer to the PSI source information.
3786 */
3787 aci_bat_src_info(&src_id,&src_infos);
3788
3789 resp.ctrl_response=BAT_RES_UNS_PERCENT_SIMINS;
3790 resp.response.ptr_res_percent_simins=&simins_data;
3791
3792 /*
3793 * T_ACI_CME_ERR is different from T_BAT_percent_simins_n, so
3794 * we need this conversion.
3795 */
3796 switch (err)
3797 {
3798 case CME_ERR_NotPresent:
3799 simins_data.n=BAT_P_SIMINS_N_NO_PIN;
3800 break;
3801
3802 case CME_ERR_SimPinReq:
3803 simins_data.n=BAT_P_SIMINS_N_SIM_PIN;
3804 break;
3805
3806 case CME_ERR_SimPukReq:
3807 simins_data.n=BAT_P_SIMINS_N_SIM_PUK;
3808 break;
3809
3810 case CME_ERR_SimFail:
3811 simins_data.n=BAT_P_SIMINS_N_SIM_FAIL;
3812 break;
3813
3814 case CME_ERR_SimBusy:
3815 simins_data.n=BAT_P_SIMINS_N_SIM_BUSY;
3816 break;
3817
3818 case CME_ERR_SimWrong:
3819 simins_data.n=BAT_P_SIMINS_N_SIM_WRONG;
3820 break;
3821
3822 case CME_ERR_SimResetNeeded:
3823 simins_data.n=BAT_P_SIMINS_N_SIM_RESET_NEEDED;
3824 break;
3825
3826 default:
3827 simins_data.n=BAT_P_SIMINS_N_UNKNOWN;
3828 break;
3829 }
3830
3831 aci_bat_send(src_infos,&resp);
3832 }
3833
3834 /*
3835 +--------------------------------------------------------------------+
3836 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3837 | STATE : code ROUTINE : rBAT_PlusCRSM |
3838 +--------------------------------------------------------------------+
3839
3840 PURPOSE :
3841 */
3842 GLOBAL void rBAT_PlusCRSM(
3843 SHORT sw1,
3844 SHORT sw2,
3845 SHORT rspLen,
3846 UBYTE *rsp)
3847 {
3848 T_ACI_CMD_SRC src_id;
3849 T_ACI_DTI_PRC_PSI *src_infos;
3850 T_BAT_cmd_response resp;
3851 T_BAT_res_set_plus_crsm crsm_data;
3852
3853 TRACE_FUNCTION ("rBAT_PlusCRSM()");
3854
3855 /*
3856 * Get the source ID and a pointer to the PSI source information.
3857 */
3858 aci_bat_src_info(&src_id,&src_infos);
3859
3860 resp.ctrl_response=BAT_RES_SET_PLUS_CRSM;
3861 resp.response.ptr_set_plus_crsm=&crsm_data;
3862
3863 crsm_data.sw1=(U8)sw1;
3864 crsm_data.sw2=(U8)sw2;
3865
3866 if (rsp EQ NULL)
3867 {
3868 crsm_data.c_response=0;
3869 }
3870 else
3871 {
3872 /*
3873 * There's nothing meaningful that we can do if there is too
3874 * much data to fit in the BAT message, so give up.
3875 */
3876 if (rspLen>BAT_MAX_CRSM_RESPONSE_LEN)
3877 return;
3878
3879 crsm_data.c_response=(U16)rspLen;
3880 memcpy(crsm_data.response,rsp,BAT_MAX_CRSM_RESPONSE_LEN);
3881 }
3882
3883 aci_bat_send(src_infos,&resp);
3884 }
3885
3886 /*
3887 +--------------------------------------------------------------------+
3888 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3889 | STATE : code ROUTINE : rBAT_PlusCSIM |
3890 +--------------------------------------------------------------------+
3891
3892 PURPOSE :
3893 */
3894 GLOBAL void rBAT_PlusCSIM(
3895 SHORT len,
3896 UBYTE *rsp)
3897 {
3898 T_ACI_CMD_SRC src_id;
3899 T_ACI_DTI_PRC_PSI *src_infos;
3900 T_BAT_cmd_response resp;
3901 T_BAT_res_set_plus_csim csim_data;
3902
3903 TRACE_FUNCTION ("rBAT_PlusCSIM()");
3904
3905 /*
3906 * Get the source ID and a pointer to the PSI source information.
3907 */
3908 aci_bat_src_info(&src_id,&src_infos);
3909
3910 resp.ctrl_response=BAT_RES_SET_PLUS_CSIM;
3911 resp.response.ptr_set_plus_csim=&csim_data;
3912
3913 if (rsp EQ NULL)
3914 {
3915 csim_data.c_response=0;
3916 }
3917 else
3918 {
3919 /*
3920 * There's nothing meaningful that we can do if there is too
3921 * much data to fit in the BAT message, so give up.
3922 */
3923 if (len>BAT_MAX_CSIM_RESP_LEN)
3924 return;
3925
3926 csim_data.c_response=(U16)len;
3927 memcpy(csim_data.response,rsp,BAT_MAX_CSIM_RESP_LEN);
3928 }
3929
3930 aci_bat_send(src_infos,&resp);
3931 }
3932
3933 /*
3934 +--------------------------------------------------------------------+
3935 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
3936 | STATE : code ROUTINE : rBAT_PercentCCBS |
3937 +--------------------------------------------------------------------+
3938
3939 PURPOSE :
3940 */
3941 GLOBAL void rBAT_PercentCCBS(
3942 T_ACI_CCBS_IND ind,
3943 T_ACI_CCBS_STAT status,
3944 T_ACI_CCBS_SET *setting,
3945 BOOL intermediate_result)
3946 {
3947 T_ACI_CMD_SRC src_id;
3948 T_ACI_DTI_PRC_PSI *src_infos;
3949 T_BAT_cmd_response resp;
3950 UBYTE len;
3951
3952 TRACE_FUNCTION ("rBAT_PercentCCBS()");
3953
3954 /*
3955 * Get the source ID and a pointer to the PSI source information.
3956 */
3957 aci_bat_src_info(&src_id,&src_infos);
3958
3959 if (intermediate_result EQ FALSE)
3960 {
3961 T_BAT_res_uns_percent_ccbs ccbs_data;
3962
3963 resp.ctrl_response=BAT_RES_UNS_PERCENT_CCBS;
3964 resp.response.ptr_res_percent_ccbs=&ccbs_data;
3965
3966 /*
3967 * This relies on T_ACI_CCBS_IND being identical to T_BAT_percent_ccbs_ind
3968 * and T_ACI_CCBS_STAT being identical to T_BAT_percent_ccbs_stat.
3969 */
3970 ccbs_data.ind=(T_BAT_percent_ccbs_ind)ind;
3971 ccbs_data.stat=(T_BAT_percent_ccbs_stat)status;
3972
3973 /*
3974 * As a default, set all the rest of the parameters as 'not present'.
3975 */
3976 ccbs_data.idx=BAT_P_CCBS_INDEX_NOT_PRESENT;
3977 ccbs_data.v_number=FALSE;
3978 ccbs_data.type=-1;
3979 ccbs_data.v_number=FALSE;
3980 ccbs_data.satype=-1;
3981 ccbs_data.bearer_class=BAT_CLASS_NOT_PRESENT;
3982 ccbs_data.ptn=BAT_P_CCBS_PATTERN_NOT_PRESENT;
3983
3984 if (setting NEQ NULL)
3985 {
3986 if (setting->number[0])
3987 {
3988 len=strlen(setting->number);
3989
3990 if (len<=BAT_MAX_CCBS_NUMBER_LEN)
3991 {
3992 memcpy(ccbs_data.number,setting->number,len);
3993 ccbs_data.c_number=(U8)len;
3994 }
3995 else
3996 {
3997 /*
3998 * This is highly unlikely to happen, but if the number is too
3999 * big, then put as many digits as will fit in the BAT structure
4000 * from the END of the number.
4001 */
4002 memcpy(
4003 ccbs_data.number,
4004 setting->number+(len-BAT_MAX_CCBS_NUMBER_LEN),
4005 BAT_MAX_CCBS_NUMBER_LEN);/*lint -e670 (Warning - Possible access beyond array for function)*/
4006
4007 ccbs_data.c_number=(U8)BAT_MAX_CCBS_NUMBER_LEN;
4008 }
4009
4010 ccbs_data.v_number=TRUE;
4011 ccbs_data.type=(S16)toa_merge(setting->type);
4012 }
4013
4014 if (setting->subaddr[0])
4015 {
4016 len=strlen(setting->subaddr);
4017
4018 /*
4019 * If the subaddress is too big to fit in the BAT message,
4020 * just leave it out.
4021 */
4022 if (len<=BAT_MAX_SUBADDR_LENGTH)
4023 {
4024 memcpy(ccbs_data.subaddr,setting->subaddr,len);
4025 ccbs_data.c_subaddr=(U8)len;
4026 ccbs_data.v_subaddr=TRUE;
4027 ccbs_data.satype=(S16)tos_merge(setting->satype);
4028 }
4029 }
4030
4031 /*
4032 * This relies on T_ACI_CLASS being identical to T_BAT_bearer_class and
4033 * T_ACI_ALRT_PATTERN being identical to T_BAT_percent_ccbs_ptn.
4034 */
4035 ccbs_data.bearer_class=(T_BAT_bearer_class)setting->class_type;
4036 ccbs_data.ptn=(T_BAT_percent_ccbs_ptn)setting->alrtPtn;
4037
4038 /*
4039 * This relies on the value presented being equivalent to
4040 * T_BAT_percent_ccbs_idx.
4041 */
4042 ccbs_data.idx=(T_BAT_percent_ccbs_idx)setting->idx;
4043 }
4044 }
4045 else
4046 {
4047 T_BAT_res_que_percent_ccbs ccbs_data;
4048
4049 resp.ctrl_response=BAT_RES_QUE_PERCENT_CCBS;
4050 resp.response.ptr_que_percent_ccbs=&ccbs_data;
4051
4052 /*
4053 * This relies on T_ACI_CCBS_IND being identical to T_BAT_percent_ccbs_ind
4054 * and T_ACI_CCBS_STAT being identical to T_BAT_percent_ccbs_stat.
4055 */
4056 ccbs_data.ind=(T_BAT_percent_ccbs_ind)ind;
4057 ccbs_data.stat=(T_BAT_percent_ccbs_stat)status;
4058
4059 /*
4060 * As a default, set all the rest of the parameters as 'not present'.
4061 */
4062 ccbs_data.idx=BAT_P_CCBS_INDEX_NOT_PRESENT;
4063 ccbs_data.v_number=FALSE;
4064 ccbs_data.type=-1;
4065 ccbs_data.v_number=FALSE;
4066 ccbs_data.satype=-1;
4067 ccbs_data.bearer_class=BAT_CLASS_NOT_PRESENT;
4068 ccbs_data.ptn=BAT_P_CCBS_PATTERN_NOT_PRESENT;
4069
4070 if (setting NEQ NULL)
4071 {
4072 if (setting->number[0])
4073 {
4074 len=strlen(setting->number);
4075
4076 if (len<=BAT_MAX_CCBS_NUMBER_LEN)
4077 {
4078 memcpy(ccbs_data.number,setting->number,len);
4079 ccbs_data.c_number=(U8)len;
4080 }
4081 else
4082 {
4083 /*
4084 * This is highly unlikely to happen, but if the number is too
4085 * big, then put as many digits as will fit in the BAT structure
4086 * from the END of the number.
4087 */
4088 memcpy(
4089 ccbs_data.number,
4090 setting->number+(len-BAT_MAX_CCBS_NUMBER_LEN),
4091 BAT_MAX_CCBS_NUMBER_LEN);/*lint -e670 (Warning - Possible access beyond array for function)*/
4092
4093 ccbs_data.c_number=(U8)BAT_MAX_CCBS_NUMBER_LEN;
4094 }
4095
4096 ccbs_data.v_number=TRUE;
4097 ccbs_data.type=(S16)toa_merge(setting->type);
4098 }
4099
4100 if (setting->subaddr[0])
4101 {
4102 len=strlen(setting->subaddr);
4103
4104 /*
4105 * If the subaddress is too big to fit in the BAT message,
4106 * just leave it out.
4107 */
4108 if (len<=BAT_MAX_SUBADDR_LENGTH)
4109 {
4110 memcpy(ccbs_data.subaddr,setting->subaddr,len);
4111 ccbs_data.c_subaddr=(U8)len;
4112 ccbs_data.v_subaddr=TRUE;
4113 ccbs_data.satype=(S16)tos_merge(setting->satype);
4114 }
4115 }
4116
4117 /*
4118 * This relies on T_ACI_CLASS being identical to T_BAT_bearer_class and
4119 * T_ACI_ALRT_PATTERN being identical to T_BAT_percent_ccbs_ptn.
4120 */
4121 ccbs_data.bearer_class=(T_BAT_bearer_class)setting->class_type;
4122 ccbs_data.ptn=(T_BAT_percent_ccbs_ptn)setting->alrtPtn;
4123
4124 /*
4125 * This relies on the value presented being equivalent to
4126 * T_BAT_percent_ccbs_idx.
4127 */
4128 ccbs_data.idx=(T_BAT_percent_ccbs_idx)setting->idx;
4129 }
4130 }
4131
4132 aci_bat_send(src_infos,&resp);
4133 }
4134
4135 /*
4136 +--------------------------------------------------------------------+
4137 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4138 | STATE : code ROUTINE : rBAT_PlusCCWV |
4139 +--------------------------------------------------------------------+
4140
4141 PURPOSE :
4142 */
4143 GLOBAL void rBAT_PlusCCWV(
4144 T_ACI_CCWV_CHRG charging)
4145 {
4146 T_ACI_CMD_SRC src_id;
4147 T_ACI_DTI_PRC_PSI *src_infos;
4148 T_BAT_cmd_response resp;
4149 T_BAT_no_parameter dummy;
4150
4151 TRACE_FUNCTION ("rBAT_PlusCCWV()");
4152
4153 /*
4154 * Get the source ID and a pointer to the PSI source information.
4155 */
4156 aci_bat_src_info(&src_id,&src_infos);
4157
4158 resp.ctrl_response = BAT_RES_UNS_PLUS_CCWV;
4159 resp.response.ptr_plus_ccwv = &dummy;
4160 dummy.bat_dummy = 0xFF;
4161
4162 /*
4163 * Note that the 'charging' parameter is lost as it is not in
4164 * the BAT.
4165 */
4166
4167 aci_bat_send(src_infos,&resp);
4168 }
4169
4170 /*
4171 +--------------------------------------------------------------------+
4172 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4173 | STATE : code ROUTINE : rBAT_PercentCNAP |
4174 +--------------------------------------------------------------------+
4175
4176 PURPOSE :
4177 */
4178 GLOBAL void rBAT_PercentCNAP(
4179 T_callingName *NameId,
4180 T_ACI_CNAP_STATUS status)
4181 {
4182 T_ACI_CMD_SRC src_id;
4183 T_ACI_DTI_PRC_PSI *src_infos;
4184 T_BAT_cmd_response resp;
4185 T_BAT_res_que_percent_cnap cnap_data;
4186 T_BAT_res_uns_percent_cnap uns_cnap_data;
4187
4188
4189
4190 TRACE_FUNCTION ("rBAT_PercentCNAP()");
4191
4192 /*
4193 * Get the source ID and a pointer to the PSI source information.
4194 */
4195 aci_bat_src_info(&src_id,&src_infos);
4196
4197 /*
4198 * This could be either an unsolicited event or a response to a
4199 * query. We have no way of knowing which it was, so we assume that
4200 * if we have a NameId, it was unsolicited.
4201 */
4202 if (NameId EQ NULL)
4203 {
4204 resp.ctrl_response=BAT_RES_QUE_PERCENT_CNAP;
4205 resp.response.ptr_que_percent_cnap = &cnap_data;
4206
4207 /*
4208 * This relies on T_ACI_CNAP_STATUS being identical to
4209 * T_BAT_percent_cnap_status.
4210 */
4211 cnap_data.status=(T_BAT_percent_cnap_status)status;
4212 }
4213 else
4214 {
4215 T_namePresentationAllowed *cnap_name_info;
4216
4217 resp.ctrl_response=BAT_RES_UNS_PERCENT_CNAP;
4218 resp.response.ptr_res_percent_cnap = &uns_cnap_data;
4219
4220 cnap_name_info=NULL;
4221
4222 if (NameId->v_namePresentationAllowed)
4223 {
4224 uns_cnap_data.pres_mode=BAT_P_CNAP_PRES_NAME;
4225 cnap_name_info=&NameId->namePresentationAllowed;
4226 }
4227 else if (NameId->v_presentationRestricted)
4228 {
4229 uns_cnap_data.pres_mode=BAT_P_CNAP_PRES_RESTRICTED;
4230 }
4231 else if (NameId->v_nameUnavailable)
4232 {
4233 uns_cnap_data.pres_mode=BAT_P_CNAP_PRES_NO_NAME;
4234 }
4235 else if (NameId->v_namePresentationRestricted)
4236 {
4237 uns_cnap_data.pres_mode=BAT_P_CNAP_PRES_NAME_RESTRICTED;
4238 cnap_name_info=&NameId->namePresentationRestricted;
4239 }
4240
4241 /*
4242 * As a default, set the rest of the parameters as 'not present'.
4243 */
4244 uns_cnap_data.dcs=-1;
4245 uns_cnap_data.v_name=FALSE;
4246
4247 if (cnap_name_info)
4248 {
4249 if (cnap_name_info->v_dataCodingScheme)
4250 uns_cnap_data.dcs=(S16)cnap_name_info->dataCodingScheme;
4251
4252 if ((cnap_name_info->v_nameString) AND
4253 (cnap_name_info->v_lengthInCharacters))
4254 {
4255 uns_cnap_data.v_name=TRUE;
4256
4257 /*
4258 * Copy as much of the data into the BAT message as it can
4259 * handle. If it is too long it will effectively be truncated.
4260 */
4261 if (cnap_name_info->lengthInCharacters>BAT_MAX_CNAP_NAME_LEN)
4262 uns_cnap_data.c_name=BAT_MAX_CNAP_NAME_LEN;
4263 else
4264 uns_cnap_data.c_name=cnap_name_info->lengthInCharacters;
4265
4266 memcpy(
4267 uns_cnap_data.name,
4268 &cnap_name_info->nameString.b_nameString,
4269 BAT_MAX_CNAP_NAME_LEN);
4270 }
4271 }
4272 }
4273
4274 aci_bat_send(src_infos,&resp);
4275 }
4276
4277 /*
4278 +--------------------------------------------------------------------+
4279 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4280 | STATE : code ROUTINE : rBAT_SignalSMS |
4281 +--------------------------------------------------------------------+
4282
4283 PURPOSE :
4284 */
4285 GLOBAL void rBAT_SignalSMS(
4286 UBYTE state)
4287 {
4288 #ifndef FF_ATI_BAT
4289
4290 /*
4291 * This is not included in the BAT interface, so ignore it.
4292 */
4293 TRACE_FUNCTION ("rBAT_SignalSMS() - IGNORED");
4294
4295 #else
4296
4297 /*
4298 * But for test purposes, fake a response by calling the equivalent
4299 * ATI function directly.
4300 */
4301 TRACE_FUNCTION ("rBAT_SignalSMS() - FAKE");
4302 rCI_SignalSMS(state);
4303
4304 #endif
4305 }
4306
4307 /*
4308 +--------------------------------------------------------------------+
4309 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4310 | STATE : code ROUTINE : rBAT_PlusCLAN |
4311 +--------------------------------------------------------------------+
4312
4313 PURPOSE :
4314 */
4315 GLOBAL void rBAT_PlusCLAN(
4316 T_ACI_LAN_SUP *CLang)
4317 {
4318 T_ACI_CMD_SRC src_id;
4319 T_ACI_DTI_PRC_PSI *src_infos;
4320 T_BAT_cmd_response resp;
4321 T_BAT_res_que_plus_clan clan_data;
4322 CHAR *str;
4323
4324 TRACE_FUNCTION ("rBAT_PlusCLAN()");
4325
4326 /*
4327 * Get the source ID and a pointer to the PSI source information.
4328 */
4329 aci_bat_src_info(&src_id,&src_infos);
4330
4331 resp.ctrl_response=BAT_RES_QUE_PLUS_CLAN;
4332 resp.response.ptr_que_plus_clan=&clan_data;
4333
4334 str=aci_bat_lang_str(CLang);
4335
4336 if (str EQ NULL)
4337 return;
4338
4339 clan_data.c_code=strlen(str);
4340
4341 if (clan_data.c_code<=BAT_MAX_CLAN_CODE_LEN)
4342 {
4343 memcpy(clan_data.code,str,BAT_MAX_CLAN_CODE_LEN);
4344 aci_bat_send(src_infos,&resp);
4345 }
4346 }
4347
4348 /*
4349 +--------------------------------------------------------------------+
4350 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4351 | STATE : code ROUTINE : rBAT_PlusCLAE |
4352 +--------------------------------------------------------------------+
4353
4354 PURPOSE :
4355 */
4356 GLOBAL void rBAT_PlusCLAE(
4357 T_ACI_LAN_SUP *CLang)
4358 {
4359 T_ACI_CMD_SRC src_id;
4360 T_ACI_DTI_PRC_PSI *src_infos;
4361 T_BAT_cmd_response resp;
4362 T_BAT_res_uns_plus_clae clae_data;
4363 CHAR *str;
4364
4365 TRACE_FUNCTION ("rBAT_PlusCLAE()");
4366
4367 /*
4368 * This shouldn't happen, but there's no point carrying on
4369 * if it does.
4370 */
4371 if (CLang EQ NULL)
4372 return;
4373
4374 /*
4375 * Get the source ID and a pointer to the PSI source information.
4376 */
4377 aci_bat_src_info(&src_id,&src_infos);
4378
4379 resp.ctrl_response=BAT_RES_UNS_PLUS_CLAE;
4380 resp.response.ptr_res_plus_clae=&clae_data;
4381
4382 str=aci_bat_lang_str(CLang);
4383
4384 if (str EQ NULL)
4385 return;
4386
4387 clae_data.c_code=strlen(str);
4388
4389 if (clae_data.c_code<=BAT_MAX_CLAE_CODE_LEN)
4390 {
4391 memcpy(clae_data.code,str,BAT_MAX_CLAE_CODE_LEN);
4392 aci_bat_send(src_infos,&resp);
4393 }
4394 }
4395
4396 /*
4397 +--------------------------------------------------------------------+
4398 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4399 | STATE : code ROUTINE : rBAT_PercentCSQ |
4400 +--------------------------------------------------------------------+
4401
4402 PURPOSE :
4403 */
4404 #ifdef FF_PS_RSSI
4405 GLOBAL void rBAT_PercentCSQ(
4406 UBYTE rssi,
4407 UBYTE ber,
4408 UBYTE actlevel,
4409 UBYTE min_access_level)
4410 #else
4411 GLOBAL void rBAT_PercentCSQ(
4412 UBYTE rssi,
4413 UBYTE ber,
4414 UBYTE actlevel)
4415 #endif
4416 {
4417 T_ACI_CMD_SRC src_id;
4418 T_ACI_DTI_PRC_PSI *src_infos;
4419 T_BAT_cmd_response resp;
4420 T_BAT_res_uns_percent_csq csq_data;
4421
4422 TRACE_FUNCTION ("rBAT_PercentCSQ()");
4423
4424 /*
4425 * Get the source ID and a pointer to the PSI source information.
4426 */
4427 aci_bat_src_info(&src_id,&src_infos);
4428
4429 resp.ctrl_response=BAT_RES_UNS_PERCENT_CSQ;
4430 resp.response.ptr_res_percent_csq=&csq_data;
4431
4432 csq_data.rssi=(S16)rssi;
4433 csq_data.ber=(S16)ber;
4434 csq_data.actlevel=(S16)actlevel;
4435
4436 #ifdef FF_PS_RSSI
4437 csq_data.min_access_level = (S16)min_access_level;
4438 #endif
4439 aci_bat_send(src_infos,&resp);
4440 }
4441
4442 /*
4443 +--------------------------------------------------------------------+
4444 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4445 | STATE : code ROUTINE : rBAT_PercentALS |
4446 +--------------------------------------------------------------------+
4447
4448 PURPOSE :
4449 */
4450 GLOBAL void rBAT_PercentALS(
4451 T_ACI_ALS_MOD ALSmode)
4452 {
4453 T_ACI_CMD_SRC src_id;
4454 T_ACI_DTI_PRC_PSI *src_infos;
4455 T_BAT_cmd_response resp;
4456 T_BAT_res_tst_percent_als als_data;
4457
4458 TRACE_FUNCTION ("rBAT_PercentALS()");
4459
4460 /*
4461 * Get the source ID and a pointer to the PSI source information.
4462 */
4463 aci_bat_src_info(&src_id,&src_infos);
4464
4465 resp.ctrl_response=BAT_RES_TST_PERCENT_ALS;
4466 resp.response.ptr_tst_percent_als=&als_data;
4467
4468 /*
4469 * T_ACI_ALS_MOD is not the same as T_BAT_percent_als_mode, so
4470 * we need this conversion.
4471 */
4472 switch (ALSmode)
4473 {
4474 default:
4475 case ALS_MOD_NOTPRESENT:
4476 /*
4477 * As the only (mandatory) parameter has no value allowed for
4478 * in BAT we may as well give up.
4479 */
4480 return;
4481
4482 case ALS_MOD_SPEECH:
4483 als_data.mode=BAT_P_ALS_MOD_SPEECH;
4484 break;
4485
4486 case ALS_MOD_AUX_SPEECH:
4487 als_data.mode=BAT_P_ALS_MOD_AUX_SPEECH;
4488 break;
4489 }
4490
4491 aci_bat_send(src_infos,&resp);
4492 }
4493
4494 /*
4495 +--------------------------------------------------------------------+
4496 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4497 | STATE : code ROUTINE : rBAT_PlusCTZV |
4498 +--------------------------------------------------------------------+
4499
4500 PURPOSE :
4501 */
4502 #ifdef FF_TIMEZONE
4503 GLOBAL void rBAT_PlusCTZV(S32 timezone)
4504 #else
4505 GLOBAL void rBAT_PlusCTZV(UBYTE *timezone)
4506 #endif
4507 {
4508 T_ACI_CMD_SRC src_id;
4509 T_ACI_DTI_PRC_PSI *src_infos;
4510 T_BAT_cmd_response resp;
4511 T_BAT_res_uns_plus_ctzv ctzv_data;
4512
4513 TRACE_FUNCTION ("rBAT_PlusCTZV()");
4514
4515 /*
4516 * Get the source ID and a pointer to the PSI source information.
4517 */
4518 aci_bat_src_info(&src_id,&src_infos);
4519
4520 resp.ctrl_response=BAT_RES_UNS_PLUS_CTZV;
4521 resp.response.ptr_res_plus_ctzv=&ctzv_data;
4522
4523 #ifdef FF_TIMEZONE
4524 ctzv_data.tz=(U8)timezone;
4525 #else
4526 if (timezone EQ NULL)
4527 return;
4528 else
4529 ctzv_data.tz=(U8)*timezone;
4530 #endif
4531
4532 aci_bat_send(src_infos,&resp);
4533 }
4534
4535 /*
4536 +--------------------------------------------------------------------+
4537 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4538 | STATE : code ROUTINE : rBAT_PercentCREG |
4539 +--------------------------------------------------------------------+
4540
4541 PURPOSE :
4542 */
4543 GLOBAL void rBAT_PercentCREG(
4544 T_ACI_CREG_STAT status,
4545 USHORT lac,
4546 USHORT cid,
4547 T_ACI_P_CREG_GPRS_IND gprs_ind,
4548 U8 rt)
4549 {
4550 T_ACI_CMD_SRC src_id;
4551 T_ACI_DTI_PRC_PSI *src_infos;
4552 T_BAT_cmd_response resp;
4553 T_BAT_res_uns_percent_creg creg_data;
4554
4555 TRACE_FUNCTION ("rBAT_PercentCREG()");
4556
4557 /*
4558 * Get the source ID and a pointer to the PSI source information.
4559 */
4560 aci_bat_src_info(&src_id,&src_infos);
4561
4562 resp.ctrl_response=BAT_RES_UNS_PERCENT_CREG;
4563 resp.response.ptr_res_percent_creg=&creg_data;
4564
4565 /*
4566 * This relies on T_ACI_CREG_STAT and T_BAT_percent_creg_stat being
4567 * identical.
4568 */
4569 creg_data.stat=(T_BAT_percent_creg_stat)status;
4570
4571 creg_data.lac=(S32)lac;
4572 creg_data.ci=(S32)cid;
4573
4574 /*
4575 * This relies on T_ACI_P_CREG_GPRS_IND and T_BAT_percent_creg_gprs_ind
4576 * being identical.
4577 */
4578 creg_data.gprs_ind=(T_BAT_percent_creg_gprs_ind)gprs_ind;
4579 creg_data.rt=(T_BAT_percent_creg_rt)rt;
4580
4581 aci_bat_send(src_infos,&resp);
4582 }
4583
4584 #ifdef GPRS
4585 /*
4586 +--------------------------------------------------------------------+
4587 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4588 | STATE : code ROUTINE : rBAT_PlusCGACT |
4589 +--------------------------------------------------------------------+
4590
4591 PURPOSE :
4592 */
4593 GLOBAL void rBAT_PlusCGACT(
4594 SHORT link_id)
4595 {
4596 #ifndef FF_ATI_BAT
4597
4598 /*
4599 * This is not included in the BAT interface, so ignore it.
4600 */
4601 TRACE_FUNCTION ("rBAT_PlusCGACT() - IGNORED");
4602
4603 #else
4604
4605 /*
4606 * But for test purposes, fake a response by calling the equivalent
4607 * ATI function directly.
4608 */
4609 TRACE_FUNCTION ("rBAT_PlusCGACT() - FAKE");
4610 rCI_PlusCGACT(link_id);
4611
4612 #endif
4613 }
4614
4615 /*
4616 +--------------------------------------------------------------------+
4617 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4618 | STATE : code ROUTINE : rBAT_PlusCGDATA |
4619 +--------------------------------------------------------------------+
4620
4621 PURPOSE :
4622 */
4623 GLOBAL void rBAT_PlusCGDATA(
4624 SHORT link_id)
4625 {
4626 #ifndef FF_ATI_BAT
4627
4628 /*
4629 * This is not included in the BAT interface, so ignore it.
4630 */
4631 TRACE_FUNCTION ("rBAT_PlusCGDATA() - IGNORED");
4632
4633 #else
4634
4635 /*
4636 * But for test purposes, fake a response by calling the equivalent
4637 * ATI function directly.
4638 */
4639 TRACE_FUNCTION ("rBAT_PlusCGDATA() - FAKE");
4640 rCI_PlusCGDATA(link_id);
4641
4642 #endif
4643 }
4644
4645 /*
4646 +--------------------------------------------------------------------+
4647 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4648 | STATE : code ROUTINE : rBAT_PlusCGANS |
4649 +--------------------------------------------------------------------+
4650
4651 PURPOSE :
4652 */
4653 GLOBAL void rBAT_PlusCGANS(
4654 SHORT link_id)
4655 {
4656 #ifndef FF_ATI_BAT
4657
4658 /*
4659 * This is not included in the BAT interface, so ignore it.
4660 */
4661 TRACE_FUNCTION ("rBAT_PlusCGANS() - IGNORED");
4662
4663 #else
4664
4665 /*
4666 * But for test purposes, fake a response by calling the equivalent
4667 * ATI function directly.
4668 */
4669 TRACE_FUNCTION ("rBAT_PlusCGANS() - FAKE");
4670 rCI_PlusCGANS(link_id);
4671
4672 #endif
4673 }
4674
4675 /*
4676 +--------------------------------------------------------------------+
4677 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4678 | STATE : code ROUTINE : rBAT_PlusCGEREP |
4679 +--------------------------------------------------------------------+
4680
4681 PURPOSE :
4682 */
4683 GLOBAL void rBAT_PlusCGEREP(
4684 T_CGEREP_EVENT event,
4685 T_CGEREP_EVENT_REP_PARAM *param)
4686 {
4687 #ifndef FF_ATI_BAT
4688
4689 /*
4690 * This is not included in the BAT interface, so ignore it.
4691 */
4692 TRACE_FUNCTION ("rBAT_PlusCGEREP() - IGNORED");
4693
4694 #else
4695
4696 /*
4697 * But for test purposes, fake a response by calling the equivalent
4698 * ATI function directly.
4699 */
4700 TRACE_FUNCTION ("rBAT_PlusCGEREP() - FAKE");
4701 rCI_PlusCGEREP(event,param);
4702
4703 #endif
4704 }
4705
4706 /*
4707 +--------------------------------------------------------------------+
4708 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4709 | STATE : code ROUTINE : rBAT_PlusCGREG |
4710 +--------------------------------------------------------------------+
4711
4712 PURPOSE :
4713 */
4714 GLOBAL void rBAT_PlusCGREG(
4715 T_CGREG_STAT stat,
4716 USHORT lac,
4717 USHORT ci)
4718 {
4719 T_ACI_CMD_SRC src_id;
4720 T_ACI_DTI_PRC_PSI *src_infos;
4721 T_BAT_cmd_response resp;
4722 T_BAT_res_uns_plus_cgreg cgreg_data;
4723
4724 TRACE_FUNCTION ("rBAT_PlusCGREG()");
4725
4726 /*
4727 * Get the source ID and a pointer to the PSI source information.
4728 */
4729 aci_bat_src_info(&src_id,&src_infos);
4730
4731 resp.ctrl_response=BAT_RES_UNS_PLUS_CGREG;
4732 resp.response.ptr_res_plus_cgreg=&cgreg_data;
4733
4734 /*
4735 * This relies on T_CGREG_STAT and T_BAT_plus_cgreg_stat being
4736 * identical. They are, except in that the ACI version has a
4737 * 'not present' value. We deal with it by using 'unknown'.
4738 */
4739 if (stat EQ CGREG_STAT_NOT_PRESENT)
4740 cgreg_data.stat=BAT_CGREG_STAT_UNKN;
4741 else
4742 cgreg_data.stat=(T_BAT_plus_cgreg_stat)stat;
4743
4744 cgreg_data.lac=(S32)lac;
4745 cgreg_data.ci=(S32)ci;
4746
4747 aci_bat_send(src_infos,&resp);
4748 }
4749
4750 /*
4751 +--------------------------------------------------------------------+
4752 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4753 | STATE : code ROUTINE : rBAT_changedQOS |
4754 +--------------------------------------------------------------------+
4755
4756 PURPOSE :
4757 */
4758 GLOBAL void rBAT_changedQOS(
4759 SHORT cid,
4760 T_PS_qos *qos)
4761 {
4762 #ifndef FF_ATI_BAT
4763
4764 /*
4765 * This is not included in the BAT interface, so ignore it.
4766 */
4767 TRACE_FUNCTION ("rBAT_changedQOS() - IGNORED");
4768
4769 #else
4770
4771 /*
4772 * But for test purposes, fake a response by calling the equivalent
4773 * ATI function directly.
4774 */
4775 TRACE_FUNCTION ("rBAT_changedQOS() - FAKE");
4776 rCI_changedQOS((U8)cid,qos);
4777
4778 #endif
4779 }
4780
4781 /*
4782 +--------------------------------------------------------------------+
4783 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4784 | STATE : code ROUTINE : rBAT_PercentSNCNT |
4785 +--------------------------------------------------------------------+
4786
4787 PURPOSE :
4788 */
4789 GLOBAL void rBAT_PercentSNCNT(
4790 UBYTE c_id,
4791 ULONG octets_uplink,
4792 ULONG octets_downlink,
4793 ULONG packets_uplink,
4794 ULONG packets_downlink)
4795 {
4796 T_ACI_CMD_SRC src_id;
4797 T_ACI_DTI_PRC_PSI *src_infos;
4798 T_BAT_cmd_response resp;
4799 T_BAT_res_uns_percent_sncnt sncnt_data;
4800
4801 TRACE_FUNCTION ("rBAT_PercentSNCNT()");
4802
4803 /*
4804 * Get the source ID and a pointer to the PSI source information.
4805 */
4806 aci_bat_src_info(&src_id,&src_infos);
4807
4808 resp.ctrl_response=BAT_RES_UNS_PERCENT_SNCNT;
4809 resp.response.ptr_uns_percent_sncnt=&sncnt_data;
4810
4811 /*
4812 * Warning: this could potentially deliver a value outside
4813 * the range specified by BAT.
4814 */
4815 sncnt_data.cid=(T_BAT_pdp_cid)c_id;
4816
4817 sncnt_data.oct_up=(U32)octets_uplink;
4818 sncnt_data.oct_down=(U32)octets_downlink;
4819 sncnt_data.pkt_up=(U32)packets_uplink;
4820 sncnt_data.pkt_down=(U32)packets_downlink;
4821
4822 aci_bat_send(src_infos,&resp);
4823 }
4824
4825 /*
4826 +--------------------------------------------------------------------+
4827 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4828 | STATE : code ROUTINE : rBAT_PercentCGREG |
4829 +--------------------------------------------------------------------+
4830
4831 PURPOSE :
4832 */
4833 GLOBAL void rBAT_PercentCGREG(
4834 T_P_CGREG_STAT stat,
4835 USHORT lac,
4836 USHORT ci,
4837 BOOL bActiveContext)
4838 {
4839 T_ACI_CMD_SRC src_id;
4840 T_ACI_DTI_PRC_PSI *src_infos;
4841 T_BAT_cmd_response resp;
4842 T_BAT_res_uns_percent_cgreg cgreg_data;
4843
4844 TRACE_FUNCTION ("rBAT_PercentCGREG()");
4845
4846 /*
4847 * Get the source ID and a pointer to the PSI source information.
4848 */
4849 aci_bat_src_info(&src_id,&src_infos);
4850
4851 resp.ctrl_response=BAT_RES_UNS_PERCENT_CGREG;
4852 resp.response.ptr_res_percent_cgreg=&cgreg_data;
4853
4854 /*
4855 * This relies on T_P_CGREG_STAT and T_BAT_percent_cgreg_stat being
4856 * identical. They are, except in that the ACI version has a
4857 * 'not present' value. We deal with it by using 'unknown'.
4858 */
4859 if (stat EQ P_CGREG_STAT_NOT_PRESENT)
4860 cgreg_data.stat=BAT_P_CGREG_STAT_UNKN;
4861 else
4862 cgreg_data.stat=(T_BAT_percent_cgreg_stat)stat;
4863
4864 cgreg_data.lac=(S32)lac;
4865 cgreg_data.ci=(S32)ci;
4866
4867 aci_bat_send(src_infos,&resp);
4868 }
4869
4870 #endif /* GPRS */
4871 /*
4872 +--------------------------------------------------------------------+
4873 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4874 | STATE : code ROUTINE : rBAT_PercentEM |
4875 +--------------------------------------------------------------------+
4876
4877 PURPOSE :
4878 */
4879 GLOBAL void rBAT_PercentEM(
4880 T_EM_VAL *val_tmp)
4881 {
4882 #ifndef FF_ATI_BAT
4883
4884 /*
4885 * This is not included in the BAT interface, so ignore it.
4886 */
4887 TRACE_FUNCTION ("rBAT_PercentEM() - IGNORED");
4888
4889 #else
4890
4891 /*
4892 * But for test purposes, fake a response by calling the equivalent
4893 * ATI function directly.
4894 */
4895 TRACE_FUNCTION ("rBAT_PercentEM() - FAKE");
4896 rCI_PercentEM(val_tmp);
4897
4898 #endif
4899 }
4900
4901 /*
4902 +--------------------------------------------------------------------+
4903 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4904 | STATE : code ROUTINE : rBAT_PercentEMET |
4905 +--------------------------------------------------------------------+
4906
4907 PURPOSE :
4908 */
4909 GLOBAL void rBAT_PercentEMET(
4910 T_DRV_SIGNAL_EM_EVENT *Signal)
4911 {
4912 #ifndef FF_ATI_BAT
4913
4914 /*
4915 * This is not included in the BAT interface, so ignore it.
4916 */
4917 TRACE_FUNCTION ("rBAT_PercentEMET() - IGNORED");
4918
4919 #else
4920
4921 /*
4922 * But for test purposes, fake a response by calling the equivalent
4923 * ATI function directly.
4924 */
4925 TRACE_FUNCTION ("rBAT_PercentEMET() - FAKE");
4926 rCI_PercentEMET(Signal);
4927
4928 #endif
4929 }
4930
4931 /*
4932 +--------------------------------------------------------------------+
4933 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4934 | STATE : code ROUTINE : rBAT_PercentEMETS |
4935 +--------------------------------------------------------------------+
4936
4937 PURPOSE :
4938 */
4939 GLOBAL void rBAT_PercentEMETS(
4940 UBYTE entity)
4941 {
4942 #ifndef FF_ATI_BAT
4943
4944 /*
4945 * This is not included in the BAT interface, so ignore it.
4946 */
4947 TRACE_FUNCTION ("rBAT_PercentEMETS() - IGNORED");
4948
4949 #else
4950
4951 /*
4952 * But for test purposes, fake a response by calling the equivalent
4953 * ATI function directly.
4954 */
4955 TRACE_FUNCTION ("rBAT_PercentEMETS() - FAKE");
4956 rCI_PercentEMETS(entity);
4957
4958 #endif
4959 }
4960
4961 /*
4962 +--------------------------------------------------------------------+
4963 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
4964 | STATE : code ROUTINE : rBAT_PercentCPNUMS |
4965 +--------------------------------------------------------------------+
4966
4967 PURPOSE :
4968 */
4969 GLOBAL void rBAT_PercentCPNUMS(
4970 UBYTE element_index,
4971 UBYTE index_level,
4972 CHAR *alpha_tag,
4973 CHAR *number,
4974 BOOL premium_flag,
4975 BOOL network_flag)
4976 {
4977 T_ACI_CMD_SRC src_id;
4978 T_ACI_DTI_PRC_PSI *src_infos;
4979 T_BAT_cmd_response resp;
4980 UBYTE len;
4981
4982 TRACE_FUNCTION ("rBAT_PercentCPNUMS()");
4983
4984 /*
4985 * Get the source ID and a pointer to the PSI source information.
4986 */
4987 aci_bat_src_info(&src_id,&src_infos);
4988
4989 /*
4990 * This is either a response to a test or a set command.
4991 */
4992 if (aci_bat_cur_cmd_get(src_infos) EQ BAT_CMD_TST_PERCENT_CPNUMS)
4993 {
4994 T_BAT_res_tst_percent_cpnums cpnums_data;
4995
4996 resp.ctrl_response=BAT_RES_TST_PERCENT_CPNUMS;
4997 resp.response.ptr_tst_percent_cpnums=&cpnums_data;
4998
4999 cpnums_data.element_id=(U8)element_index;
5000 cpnums_data.index_level=(U8)index_level;
5001
5002 cpnums_data.c_alpha_tag=0;
5003
5004 if (alpha_tag NEQ NULL)
5005 {
5006 len=strlen(alpha_tag);
5007
5008 if (len)
5009 {
5010 USHORT len_cvtd_text=0;
5011
5012 /*
5013 * Convert the data read from the SIM into the currently
5014 * selected character set.
5015 */
5016 utl_chsetFromSim(
5017 (UBYTE *)alpha_tag,
5018 (USHORT)len,
5019 (UBYTE *)cpnums_data.alpha_tag,
5020 BAT_MAX_CPNUMS_ALPHA_TAG_LEN,
5021 &len_cvtd_text,
5022 GSM_ALPHA_Def);
5023
5024 cpnums_data.c_alpha_tag=(U8)len_cvtd_text;
5025 }
5026 }
5027
5028 if (number EQ NULL)
5029 {
5030 cpnums_data.c_number=0;
5031 cpnums_data.number[0]=0;
5032 }
5033 else
5034 {
5035 len=strlen(number);
5036
5037 if (len<=BAT_MAX_CPNUMS_NUMBER_LEN)
5038 {
5039 memcpy(cpnums_data.number,number,len);
5040 cpnums_data.c_number=(U8)len;
5041 }
5042 else
5043 {
5044 /*
5045 * This is highly unlikely to happen, but if the number is too
5046 * big, then put as many digits as will fit in the BAT structure
5047 * from the END of the number.
5048 */
5049 memcpy(
5050 cpnums_data.number,
5051 number+(len-BAT_MAX_CPNUMS_NUMBER_LEN),
5052 BAT_MAX_CPNUMS_NUMBER_LEN);
5053
5054 cpnums_data.c_number=(U8)BAT_MAX_CPNUMS_NUMBER_LEN;
5055 }
5056 }
5057
5058 cpnums_data.premium_flag=(premium_flag EQ TRUE) ?
5059 BAT_P_CPNUMS_PREMIUM_FLAG_SET:BAT_P_CPNUMS_PREMIUM_FLAG_NOT_SET;
5060
5061 cpnums_data.network_flag=(network_flag EQ TRUE) ?
5062 BAT_P_CPNUMS_NETWORK_SET:BAT_P_CPNUMS_NETWORK_NOT_SET;
5063
5064 aci_bat_send(src_infos,&resp);
5065 }
5066 else
5067 {
5068 T_BAT_res_set_percent_cpnums cpnums_data;
5069
5070 resp.ctrl_response=BAT_RES_SET_PERCENT_CPNUMS;
5071 resp.response.ptr_set_percent_cpnums=&cpnums_data;
5072
5073 cpnums_data.element_id=(U8)element_index;
5074 cpnums_data.index_level=(U8)index_level;
5075
5076 cpnums_data.c_alpha_tag=0;
5077
5078 if (alpha_tag NEQ NULL)
5079 {
5080 len=strlen(alpha_tag);
5081
5082 if (len)
5083 {
5084 USHORT len_cvtd_text=0;
5085
5086 /*
5087 * Convert the data read from the SIM into the currently
5088 * selected character set.
5089 */
5090 utl_chsetFromSim(
5091 (UBYTE *)alpha_tag,
5092 (USHORT)len,
5093 (UBYTE *)cpnums_data.alpha_tag,
5094 BAT_MAX_CPNUMS_ALPHA_TAG_LEN,
5095 &len_cvtd_text,
5096 GSM_ALPHA_Def);
5097
5098 cpnums_data.c_alpha_tag=(U8)len_cvtd_text;
5099 }
5100 }
5101
5102 if (number EQ NULL)
5103 {
5104 cpnums_data.c_number=0;
5105 cpnums_data.number[0]=0;
5106 }
5107 else
5108 {
5109 len=strlen(number);
5110
5111 if (len<=BAT_MAX_CPNUMS_NUMBER_LEN)
5112 {
5113 memcpy(cpnums_data.number,number,len);
5114 cpnums_data.c_number=(U8)len;
5115 }
5116 else
5117 {
5118 /*
5119 * This is highly unlikely to happen, but if the number is too
5120 * big, then put as many digits as will fit in the BAT structure
5121 * from the END of the number.
5122 */
5123 memcpy(
5124 cpnums_data.number,
5125 number+(len-BAT_MAX_CPNUMS_NUMBER_LEN),
5126 BAT_MAX_CPNUMS_NUMBER_LEN);
5127
5128 cpnums_data.c_number=(U8)BAT_MAX_CPNUMS_NUMBER_LEN;
5129 }
5130 }
5131
5132 cpnums_data.premium_flag=(premium_flag EQ TRUE) ?
5133 BAT_P_CPNUMS_PREMIUM_FLAG_SET:BAT_P_CPNUMS_PREMIUM_FLAG_NOT_SET;
5134
5135 cpnums_data.network_flag=(network_flag EQ TRUE) ?
5136 BAT_P_CPNUMS_NETWORK_SET:BAT_P_CPNUMS_NETWORK_NOT_SET;
5137
5138 aci_bat_send(src_infos,&resp);
5139 }
5140 }
5141
5142 /*
5143 +--------------------------------------------------------------------+
5144 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5145 | STATE : code ROUTINE : rBAT_PercentCPVWI |
5146 +--------------------------------------------------------------------+
5147
5148 PURPOSE :
5149 */
5150 GLOBAL void rBAT_PercentCPVWI(
5151 UBYTE flag_set,
5152 USHORT line)
5153 {
5154 T_ACI_CMD_SRC src_id;
5155 T_ACI_DTI_PRC_PSI *src_infos;
5156 T_BAT_cmd_response resp;
5157
5158 TRACE_FUNCTION ("rBAT_PercentCPVWI()");
5159
5160 /*
5161 * Get the source ID and a pointer to the PSI source information.
5162 */
5163 aci_bat_src_info(&src_id,&src_infos);
5164
5165 /*
5166 * This could be either a response to a set command, or an
5167 * unsolicited event.
5168 */
5169 if (aci_bat_cur_cmd_get(src_infos) NEQ BAT_CMD_SET_PERCENT_CPVWI)
5170 {
5171 T_BAT_res_uns_percent_cpvwi cpvwi_data;
5172
5173 resp.ctrl_response=BAT_RES_UNS_PERCENT_CPVWI;
5174 resp.response.ptr_res_percent_cpvwi=&cpvwi_data;
5175
5176 cpvwi_data.line=(T_BAT_percent_cpvwi_lines)line;
5177
5178 cpvwi_data.status=(flag_set EQ TRUE) ?
5179 BAT_P_CPVWI_FLAG_ACTIVATED:BAT_P_CPVWI_FLAG_DEACTIVATED;
5180
5181 aci_bat_send(src_infos,&resp);
5182 }
5183 else
5184 {
5185 T_BAT_res_set_percent_cpvwi cpvwi_data;
5186
5187 resp.ctrl_response=BAT_RES_SET_PERCENT_CPVWI;
5188 resp.response.ptr_set_percent_cpvwi=&cpvwi_data;
5189
5190 cpvwi_data.line=(T_BAT_percent_cpvwi_lines)line;
5191
5192 cpvwi_data.status=(flag_set EQ TRUE) ?
5193 BAT_P_CPVWI_FLAG_ACTIVATED:BAT_P_CPVWI_FLAG_DEACTIVATED;
5194
5195 aci_bat_send(src_infos,&resp);
5196 }
5197 }
5198
5199 /*
5200 +--------------------------------------------------------------------+
5201 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5202 | STATE : code ROUTINE : rBAT_PercentCPROAM |
5203 +--------------------------------------------------------------------+
5204
5205 PURPOSE :
5206 */
5207 GLOBAL void rBAT_PercentCPROAM(
5208 UBYTE roam_status)
5209 {
5210 T_ACI_CMD_SRC src_id;
5211 T_ACI_DTI_PRC_PSI *src_infos;
5212 T_BAT_cmd_response resp;
5213 T_BAT_res_uns_percent_cproam cproam_data;
5214
5215 TRACE_FUNCTION ("rBAT_PercentCPROAM()");
5216
5217 /*
5218 * Get the source ID and a pointer to the PSI source information.
5219 */
5220 aci_bat_src_info(&src_id,&src_infos);
5221
5222 resp.ctrl_response=BAT_RES_UNS_PERCENT_CPROAM;
5223 resp.response.ptr_res_percent_cproam=&cproam_data;
5224
5225 cproam_data.roam_status=(roam_status) ?
5226 BAT_P_CPROAM_STATUS_ROAMING:BAT_P_CPROAM_STATUS_NOT_ROAMING;
5227
5228 aci_bat_send(src_infos,&resp);
5229 }
5230
5231 /*
5232 +--------------------------------------------------------------------+
5233 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5234 | STATE : code ROUTINE : rBAT_PlusCIEV |
5235 +--------------------------------------------------------------------+
5236
5237 PURPOSE :
5238 */
5239 GLOBAL void rBAT_PlusCIEV(
5240 T_ACI_MM_CIND_VAL_TYPE sCindValues,
5241 T_ACI_MM_CMER_VAL_TYPE sCmerSettings)
5242 {
5243 #ifndef FF_ATI_BAT
5244
5245 /*
5246 * This is not included in the BAT interface, so ignore it.
5247 */
5248 TRACE_FUNCTION ("rBAT_PlusCIEV() - IGNORED");
5249
5250 #else
5251
5252 /*
5253 * But for test purposes, fake a response by calling the equivalent
5254 * ATI function directly.
5255 */
5256 TRACE_FUNCTION ("rBAT_PlusCIEV() - FAKE");
5257 rCI_PlusCIEV(sCindValues,sCmerSettings);
5258
5259 #endif
5260 }
5261
5262 /*
5263 +--------------------------------------------------------------------+
5264 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5265 | STATE : code ROUTINE : rBAT_PercentRDL |
5266 +--------------------------------------------------------------------+
5267
5268 PURPOSE :
5269 */
5270 GLOBAL void rBAT_PercentRDL(
5271 T_ACI_CC_REDIAL_STATE state)
5272 {
5273 T_ACI_CMD_SRC src_id;
5274 T_ACI_DTI_PRC_PSI *src_infos;
5275 T_BAT_cmd_response resp;
5276 T_BAT_res_uns_percent_rdl rdl_data;
5277
5278 TRACE_FUNCTION ("rBAT_PercentRDL()");
5279
5280 /*
5281 * Get the source ID and a pointer to the PSI source information.
5282 */
5283 aci_bat_src_info(&src_id,&src_infos);
5284
5285 resp.ctrl_response=BAT_RES_UNS_PERCENT_RDL;
5286 resp.response.ptr_res_percent_rdl=&rdl_data;
5287
5288 /*
5289 * This relies on T_ACI_CC_REDIAL_STATE being identical to
5290 * T_BAT_percent_rdl_state.
5291 */
5292 rdl_data.state=(T_BAT_percent_rdl_state)state;
5293
5294 aci_bat_send(src_infos,&resp);
5295 }
5296
5297 #ifdef TI_PS_FF_AT_P_CMD_RDLB
5298 /*
5299 +--------------------------------------------------------------------+
5300 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5301 | STATE : code ROUTINE : rBAT_PercentRDLB |
5302 +--------------------------------------------------------------------+
5303
5304 PURPOSE :
5305 */
5306 GLOBAL void rBAT_PercentRDLB(
5307 T_ACI_CC_RDL_BLACKL_STATE state)
5308 {
5309 T_ACI_CMD_SRC src_id;
5310 T_ACI_DTI_PRC_PSI *src_infos;
5311 T_BAT_cmd_response resp;
5312 T_BAT_res_uns_percent_rdlb rdlb_data;
5313
5314 TRACE_FUNCTION ("rBAT_PercentRDLB()");
5315
5316 /*
5317 * Get the source ID and a pointer to the PSI source information.
5318 */
5319 aci_bat_src_info(&src_id,&src_infos);
5320
5321 resp.ctrl_response=BAT_RES_UNS_PERCENT_RDLB;
5322 resp.response.ptr_res_percent_rdlb=&rdlb_data;
5323
5324 /*
5325 * This relies on T_ACI_CC_RDL_BLACKL_STATE being identical to
5326 * T_BAT_percent_rdlb_state.
5327 */
5328 rdlb_data.state=(T_BAT_percent_rdlb_state)state;
5329
5330 aci_bat_send(src_infos,&resp);
5331 }
5332 #endif /* TI_PS_FF_AT_P_CMD_RDLB */
5333 /*
5334 +--------------------------------------------------------------------+
5335 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5336 | STATE : code ROUTINE : rBAT_PercentCCCN |
5337 +--------------------------------------------------------------------+
5338
5339 PURPOSE :
5340 */
5341 GLOBAL void rBAT_PercentCCCN(
5342 T_ACI_FAC_DIR tDirection,
5343 SHORT cId,
5344 T_MNCC_fac_inf *fie)
5345 {
5346 T_ACI_CMD_SRC src_id;
5347 T_ACI_DTI_PRC_PSI *src_infos;
5348 T_BAT_cmd_response resp;
5349 T_BAT_res_uns_percent_cccn cccn_data;
5350
5351 TRACE_FUNCTION ("rBAT_PercentCCCN()");
5352
5353 /*
5354 * No point continuing if we don't have this.
5355 */
5356 if (fie EQ NULL)
5357 return;
5358
5359 /*
5360 * There's also no point continuing if the facility information
5361 * can't fit into the BAT message.
5362 */
5363 if (fie->l_fac>BAT_MAX_CCCN_FACILITY_LEN)
5364 return;
5365
5366 /*
5367 * Get the source ID and a pointer to the PSI source information.
5368 */
5369 aci_bat_src_info(&src_id,&src_infos);
5370
5371 resp.ctrl_response=BAT_RES_UNS_PERCENT_CCCN;
5372 resp.response.ptr_res_percent_cccn=&cccn_data;
5373
5374 /*
5375 * This relies on T_ACI_FAC_DIR and T_BAT_percent_cccn_direction
5376 * being identical. They are, except that the ACI has a 'not
5377 * present' value.
5378 */
5379 cccn_data.direction=(T_BAT_percent_cccn_direction)tDirection;
5380
5381 cccn_data.cid=(U16)cId;
5382
5383 /*
5384 * Copy the facility data, secure in the knowledge that we have
5385 * enough room for it.
5386 */
5387 memcpy(cccn_data.facility,fie->fac,BAT_MAX_CCCN_FACILITY_LEN);
5388 cccn_data.c_facility=(U8)fie->l_fac;
5389
5390 aci_bat_send(src_infos,&resp);
5391 }
5392
5393 /*
5394 +--------------------------------------------------------------------+
5395 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5396 | STATE : code ROUTINE : rBAT_PercentCSSN |
5397 +--------------------------------------------------------------------+
5398
5399 PURPOSE :
5400 */
5401 GLOBAL void rBAT_PercentCSSN(
5402 T_ACI_FAC_DIR tDirection,
5403 T_ACI_FAC_TRANS_TYPE tType,
5404 T_MNCC_fac_inf *fie)
5405 {
5406 T_ACI_CMD_SRC src_id;
5407 T_ACI_DTI_PRC_PSI *src_infos;
5408 T_BAT_cmd_response resp;
5409 T_BAT_res_uns_percent_cssn cssn_data;
5410
5411 TRACE_FUNCTION ("rBAT_PercentCSSN()");
5412
5413 /*
5414 * No point continuing if we don't have this.
5415 */
5416 if (fie EQ NULL)
5417 return;
5418
5419 /*
5420 * There's also no point continuing if the facility information
5421 * can't fit into the BAT message.
5422 */
5423 if (fie->l_fac>BAT_MAX_CSSN_FACILITY_LEN)
5424 return;
5425
5426 /*
5427 * Get the source ID and a pointer to the PSI source information.
5428 */
5429 aci_bat_src_info(&src_id,&src_infos);
5430
5431 resp.ctrl_response=BAT_RES_UNS_PERCENT_CSSN;
5432 resp.response.ptr_res_percent_cssn=&cssn_data;
5433
5434 /*
5435 * This relies on T_ACI_FAC_DIR being the same as
5436 * T_BAT_percent_cssn_direction, and T_ACI_FAC_TRANS_TYPE being the
5437 * same as T_BAT_percent_cssn_trans_type. They are, except that
5438 * T_ACI_FAC_DIR also has a 'not present' value.
5439 */
5440 cssn_data.direction=(T_BAT_percent_cssn_direction)tDirection;
5441 cssn_data.trans_type=(T_BAT_percent_cssn_trans_type)tType;
5442
5443 /*
5444 * Copy the facility data, secure in the knowledge that we have
5445 * enough room for it.
5446 */
5447 memcpy(cssn_data.facility,fie->fac,BAT_MAX_CSSN_FACILITY_LEN);
5448 cssn_data.c_facility=(U8)fie->l_fac;
5449
5450 aci_bat_send(src_infos,&resp);
5451 }
5452
5453 /*
5454 +--------------------------------------------------------------------+
5455 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5456 | STATE : code ROUTINE : rBAT_PercentCSTAT |
5457 +--------------------------------------------------------------------+
5458
5459 PURPOSE :
5460 */
5461 GLOBAL void rBAT_PercentCSTAT(
5462 T_ACI_STATE_MSG msgType)
5463 {
5464 T_ACI_CMD_SRC src_id;
5465 T_ACI_DTI_PRC_PSI *src_infos;
5466 T_BAT_cmd_response resp;
5467 T_BAT_res_uns_percent_cstat cstat_data;
5468
5469 TRACE_FUNCTION ("rBAT_PercentCSTAT()");
5470
5471 /*
5472 * Get the source ID and a pointer to the PSI source information.
5473 */
5474 aci_bat_src_info(&src_id,&src_infos);
5475
5476 resp.ctrl_response=BAT_RES_UNS_PERCENT_CSTAT;
5477 resp.response.ptr_res_percent_cstat=&cstat_data;
5478
5479 /*
5480 * This relies on T_ACI_ENTITY_ID_MSG being the same as
5481 * T_BAT_percent_cstat_entity_id and T_ACI_ENTITY_STATE_MSG being
5482 * the same as T_BAT_percent_cstat_status.
5483 */
5484 cstat_data.entity_id=(T_BAT_percent_cstat_entity_id)msgType.entityId;
5485 cstat_data.status=(T_BAT_percent_cstat_status)msgType.entityState;
5486
5487 aci_bat_send(src_infos,&resp);
5488 }
5489
5490 /*
5491 +--------------------------------------------------------------------+
5492 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5493 | STATE : code ROUTINE : rBAT_Z |
5494 +--------------------------------------------------------------------+
5495
5496 PURPOSE :
5497 */
5498 GLOBAL void rBAT_Z(void)
5499 {
5500
5501 #ifndef FF_ATI_BAT
5502
5503 /*
5504 * This is not included in the BAT interface, so ignore it.
5505 */
5506 TRACE_FUNCTION ("rBAT_Z() - IGNORED");
5507
5508 #else
5509
5510 /*
5511 * But for test purposes, fake a response by calling the equivalent
5512 * ATI function directly.
5513 */
5514 TRACE_FUNCTION ("rBAT_Z() - FAKE");
5515 rCI_Z();
5516
5517 #endif
5518
5519 }
5520
5521 #ifdef TI_PS_FF_AT_P_CMD_CPRSM
5522 /*
5523 +--------------------------------------------------------------------+
5524 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5525 | STATE : code ROUTINE : rBAT_PercentCPRSM |
5526 +--------------------------------------------------------------------+
5527
5528 PURPOSE :
5529 */
5530 GLOBAL void rBAT_PercentCPRSM(
5531 T_ACI_CPRSM_MOD mode)
5532 {
5533 T_ACI_CMD_SRC src_id;
5534 T_ACI_DTI_PRC_PSI *src_infos;
5535 T_BAT_cmd_response resp;
5536 T_BAT_res_que_percent_cprsm cprsm_data;
5537
5538 TRACE_FUNCTION ("rBAT_PercentCPRSM()");
5539
5540 /*
5541 * Get the source ID and a pointer to the PSI source information.
5542 */
5543 aci_bat_src_info(&src_id,&src_infos);
5544
5545 resp.ctrl_response=BAT_RES_QUE_PERCENT_CPRSM;
5546 resp.response.ptr_que_percent_cprsm=&cprsm_data;
5547
5548 /*
5549 * This relies on T_ACI_CPRSM_MOD and T_BAT_percent_cprsm_mode being
5550 * identical. They are, except that the ACI version includes a
5551 * 'not present' value.
5552 */
5553 cprsm_data.mode=(T_BAT_percent_cprsm_mode)mode;
5554
5555 aci_bat_send(src_infos,&resp);
5556 }
5557 #endif /* TI_PS_FF_AT_P_CMD_CPRSM */
5558 /*
5559 +--------------------------------------------------------------------+
5560 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5561 | STATE : code ROUTINE : rBAT_PercentCTZV |
5562 +--------------------------------------------------------------------+
5563
5564 PURPOSE :
5565 */
5566 GLOBAL void rBAT_PercentCTZV(
5567 T_MMR_INFO_IND *mmr_info_ind,
5568 S32 timezone)
5569 {
5570 T_ACI_CMD_SRC src_id;
5571 T_ACI_DTI_PRC_PSI *src_infos;
5572 T_BAT_cmd_response resp;
5573 T_BAT_res_uns_percent_ctzv ctzv_data;
5574
5575 TRACE_FUNCTION ("rBAT_PercentCTZV()");
5576
5577 if (mmr_info_ind EQ NULL)
5578 return;
5579
5580 /*
5581 * Get the source ID and a pointer to the PSI source information.
5582 */
5583 aci_bat_src_info(&src_id,&src_infos);
5584
5585 resp.ctrl_response=BAT_RES_UNS_PERCENT_CTZV;
5586 resp.response.ptr_res_percent_ctzv=&ctzv_data;
5587
5588 if ((mmr_info_ind->plmn.v_plmn) AND
5589 ((SIZE_MCC+SIZE_MNC) <= BAT_MAX_CTZV_NUM_OPER_LEN))
5590 {
5591 ctzv_data.v_num_oper=TRUE;
5592 memcpy(ctzv_data.num_oper,mmr_info_ind->plmn.mcc,SIZE_MCC);
5593 memcpy(ctzv_data.num_oper+SIZE_MCC,mmr_info_ind->plmn.mnc,SIZE_MNC);
5594 ctzv_data.c_num_oper=(U8)(SIZE_MCC+SIZE_MNC);
5595 }
5596 else
5597 {
5598 ctzv_data.v_num_oper=FALSE;
5599 }
5600
5601 if (mmr_info_ind->short_name.v_name)
5602 {
5603 USHORT len;
5604
5605 utl_chsetFromGsm(
5606 mmr_info_ind->short_name.text,
5607 mmr_info_ind->short_name.c_text,
5608 ctzv_data.short_oper,
5609 BAT_MAX_CTZV_SHORT_OPER,
5610 &len,
5611 GSM_ALPHA_Def);
5612
5613 ctzv_data.v_short_oper=TRUE;
5614 ctzv_data.c_short_oper=(U8)len;
5615
5616 /* Extend BAT to included add_ci parameter */
5617 ctzv_data.add_ci = mmr_info_ind->short_name.add_ci;
5618 }
5619 else
5620 {
5621 ctzv_data.v_short_oper=FALSE;
5622 }
5623
5624 if (mmr_info_ind->full_name.v_name)
5625 {
5626 USHORT len;
5627
5628 utl_chsetFromGsm(
5629 mmr_info_ind->full_name.text,
5630 mmr_info_ind->full_name.c_text,
5631 ctzv_data.long_oper,
5632 BAT_MAX_CTZV_LONG_OPER,
5633 &len,
5634 GSM_ALPHA_Def);
5635
5636 ctzv_data.v_long_oper=TRUE;
5637 ctzv_data.c_long_oper=(U8)len;
5638
5639 /* Extend BAT to included add_ci parameter */
5640 ctzv_data.add_ci = mmr_info_ind->full_name.add_ci;
5641 }
5642 else
5643 {
5644 ctzv_data.v_long_oper=FALSE;
5645 }
5646
5647 ctzv_data.year=(U8)mmr_info_ind->time.year;
5648 ctzv_data.month=(U8)mmr_info_ind->time.month;
5649 ctzv_data.day=(U8)mmr_info_ind->time.day;
5650 ctzv_data.hour=(U8)mmr_info_ind->time.hour;
5651 ctzv_data.minutes=(U8)mmr_info_ind->time.minute;
5652 ctzv_data.seconds=(U8)mmr_info_ind->time.second;
5653 ctzv_data.time_zone=(S8)timezone;
5654
5655 aci_bat_send(src_infos,&resp);
5656 }
5657
5658 /*
5659 +--------------------------------------------------------------------+
5660 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5661 | STATE : code ROUTINE : rBAT_PercentCNIV |
5662 +--------------------------------------------------------------------+
5663
5664 PURPOSE :
5665 */
5666 GLOBAL void rBAT_PercentCNIV(T_MMR_INFO_IND *mmr_info_ind)
5667 {
5668 T_ACI_CMD_SRC src_id;
5669 T_ACI_DTI_PRC_PSI *src_infos;
5670 T_BAT_cmd_response resp;
5671 T_BAT_res_uns_percent_cniv cniv_data;
5672
5673 TRACE_FUNCTION ("rBAT_PercentCNIV()");
5674
5675 if (mmr_info_ind EQ NULL)
5676 {
5677 return;
5678 }
5679
5680 /*
5681 * Get the source ID and a pointer to the PSI source information.
5682 */
5683 aci_bat_src_info(&src_id,&src_infos);
5684
5685 resp.ctrl_response=BAT_RES_UNS_PERCENT_CNIV;
5686 resp.response.ptr_res_percent_cniv=&cniv_data;
5687
5688 if ((mmr_info_ind->plmn.v_plmn) AND
5689 ((SIZE_MCC+SIZE_MNC) <= BAT_MAX_CNIV_NUM_OPER_LEN))
5690 {
5691 cniv_data.v_num_oper=TRUE;
5692 memcpy(cniv_data.num_oper,mmr_info_ind->plmn.mcc,SIZE_MCC);
5693 memcpy(cniv_data.num_oper+SIZE_MCC,mmr_info_ind->plmn.mnc,SIZE_MNC);
5694 cniv_data.c_num_oper=(U8)(SIZE_MCC+SIZE_MNC);
5695 }
5696 else
5697 {
5698 cniv_data.v_num_oper=FALSE;
5699 }
5700
5701 if (mmr_info_ind->short_name.v_name)
5702 {
5703 cniv_data.v_short_oper=TRUE;
5704 cniv_data.c_short_oper=mmr_info_ind->short_name.c_text;
5705 cniv_data.dcs_short_oper = mmr_info_ind->short_name.dcs;
5706 memcpy(cniv_data.short_oper,mmr_info_ind->short_name.text,mmr_info_ind->short_name.c_text);
5707
5708 /* Extend BAT to included add_ci parameter */
5709 cniv_data.add_ci = mmr_info_ind->short_name.add_ci;
5710 }
5711 else
5712 {
5713 cniv_data.v_short_oper=FALSE;
5714 }
5715
5716 if (mmr_info_ind->full_name.v_name)
5717 {
5718 cniv_data.v_long_oper=TRUE;
5719 cniv_data.c_long_oper=mmr_info_ind->full_name.c_text;
5720 cniv_data.dcs_long_oper = mmr_info_ind->full_name.dcs;
5721 memcpy(cniv_data.long_oper,mmr_info_ind->full_name.text,mmr_info_ind->full_name.c_text);
5722
5723 /* Extend BAT to included add_ci parameter */
5724 cniv_data.add_ci = mmr_info_ind->full_name.add_ci;
5725 }
5726 else
5727 {
5728 cniv_data.v_long_oper=FALSE;
5729 }
5730
5731 aci_bat_send(src_infos,&resp);
5732 }
5733
5734 #ifdef GPRS
5735 /*
5736 +--------------------------------------------------------------------+
5737 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5738 | STATE : code ROUTINE : rBAT_PercentCGEV |
5739 +--------------------------------------------------------------------+
5740
5741 PURPOSE :
5742 */
5743 GLOBAL void rBAT_PercentCGEV (T_CGEREP_EVENT event, T_CGEREP_EVENT_REP_PARAM *param)
5744 {
5745 T_ACI_CMD_SRC src_id;
5746 T_ACI_DTI_PRC_PSI *src_infos;
5747 T_BAT_cmd_response resp;
5748 T_BAT_res_uns_percent_cgev cgev_data;
5749 U8 len;
5750
5751 TRACE_FUNCTION ("rBAT_PercentCGEV()");
5752
5753 if (event EQ CGEREP_EVENT_INVALID)
5754 {
5755 return;
5756 }
5757 /*
5758 * Get the source ID and a pointer to the PSI source information.
5759 */
5760 aci_bat_src_info(&src_id,&src_infos);
5761
5762 #ifdef _SIMULATION_
5763 if (ati_user_output_cfg[src_id].Percent_CGEREP_stat EQ 0)
5764 {
5765 return; /* don't indicate %CGEV to a source on which AT%CGEREP was not set up */
5766 }
5767 #endif
5768
5769 resp.ctrl_response=BAT_RES_UNS_PERCENT_CGEV;
5770 resp.response.ptr_res_percent_cgev=&cgev_data;
5771
5772 /*
5773 * This relies on T_CGEREP_EVENT being identical to
5774 * T_BAT_percent_cgev_evt, which it is apart from the additional
5775 * 'invalid' value in the ACI which we dealt with earlier.
5776 */
5777 cgev_data.evt=(T_BAT_percent_cgev_evt)event;
5778 cgev_data.pdp_type=BAT_PDP_TYPE_NOT_PRESENT;
5779 cgev_data.v_pdp_addr=FALSE;
5780 cgev_data.cid=BAT_PDP_CID_NOT_PRESENT;
5781 cgev_data.p_mobile_class=BAT_P_MOBILE_CLASS_NOT_PRESENT;
5782
5783 if (param NEQ NULL)
5784 {
5785 switch (event)
5786 {
5787 case CGEREP_EVENT_REJECT:
5788 {
5789 switch(param->reject.pdp_addr.ctrl_ip_address)
5790 {
5791 case NAS_is_ipv4:
5792 len = sizeof(param->reject.pdp_addr.ip_address.ipv4_addr.a4);
5793 cgev_data.pdp_type = BAT_PDP_TYPE_IPV4;
5794 if ((len > 0) AND (len <= BAT_MAX_PDP_ADD))
5795 {
5796 cgev_data.v_pdp_addr = TRUE;
5797 cgev_data.c_pdp_addr = (U8)len;
5798 memcpy(cgev_data.pdp_addr,param->reject.pdp_addr.ip_address.ipv4_addr.a4,len);
5799 }
5800 break;
5801 case NAS_is_ipv6:
5802 len = sizeof(param->reject.pdp_addr.ip_address.ipv6_addr.a6);
5803 cgev_data.pdp_type = BAT_PDP_TYPE_IPV6;
5804 if ((len > 0) AND (len <= BAT_MAX_PDP_ADD))
5805 {
5806 cgev_data.v_pdp_addr = TRUE;
5807 cgev_data.c_pdp_addr = (U8)len;
5808 memcpy(cgev_data.pdp_addr,param->reject.pdp_addr.ip_address.ipv6_addr.a6,len);
5809 }
5810 break;
5811 default:
5812 break;
5813 }
5814 }
5815 break;
5816
5817
5818 case CGEREP_EVENT_NW_CLASS:
5819 case CGEREP_EVENT_ME_CLASS:
5820 /*
5821 * This relies on T_PERCENT_CGCLASS being identical to
5822 * T_BAT_p_mobile_class.
5823 */
5824 cgev_data.p_mobile_class=(T_BAT_p_mobile_class)param->mobile_class;
5825 break;
5826
5827 case CGEREP_EVENT_NW_REACT:
5828 case CGEREP_EVENT_NW_DEACT:
5829 case CGEREP_EVENT_ME_DEACT:
5830 case CGEREP_EVENT_NW_ACT:
5831 case CGEREP_EVENT_ME_ACT:
5832 cgev_data.cid=(T_BAT_pdp_cid)param->act.cid;
5833 switch(param->act.pdp_addr.ctrl_ip_address)
5834 {
5835 case NAS_is_ipv4:
5836 len = sizeof(param->act.pdp_addr.ip_address.ipv4_addr.a4);
5837 cgev_data.pdp_type = BAT_PDP_TYPE_IPV4;
5838 if ((len > 0) AND (len <= BAT_MAX_PDP_ADD))
5839 {
5840 cgev_data.v_pdp_addr = TRUE;
5841 cgev_data.c_pdp_addr = (U8)len;
5842 memcpy(cgev_data.pdp_addr,param->act.pdp_addr.ip_address.ipv4_addr.a4,len);
5843 }
5844 break;
5845 case NAS_is_ipv6:
5846 len = sizeof(param->act.pdp_addr.ip_address.ipv6_addr.a6);
5847 cgev_data.pdp_type = BAT_PDP_TYPE_IPV6;
5848 if ((len > 0) AND (len <= BAT_MAX_PDP_ADD))
5849 {
5850 cgev_data.v_pdp_addr = TRUE;
5851 cgev_data.c_pdp_addr = (U8)len;
5852 memcpy(cgev_data.pdp_addr,param->act.pdp_addr.ip_address.ipv6_addr.a6,len);
5853 }
5854 break;
5855 default:
5856 break;
5857 }
5858 break;
5859
5860 default:
5861 break;
5862 }
5863 }
5864
5865 aci_bat_send(src_infos,&resp);
5866 }
5867 #endif /* GPRS */
5868
5869 /*
5870 +--------------------------------------------------------------------+
5871 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5872 | STATE : code ROUTINE : rBAT_PercentCPRI |
5873 +--------------------------------------------------------------------+
5874
5875 PURPOSE :
5876 */
5877 GLOBAL void rBAT_PercentCPRI(
5878 UBYTE gsm_ciph,
5879 UBYTE gprs_ciph)
5880 {
5881 T_ACI_CMD_SRC src_id;
5882 T_ACI_DTI_PRC_PSI *src_infos;
5883 T_BAT_cmd_response resp;
5884 T_BAT_res_uns_percent_cpri cpri_data;
5885
5886 TRACE_FUNCTION ("rBAT_PercentCPRI()");
5887
5888 /*
5889 * Get the source ID and a pointer to the PSI source information.
5890 */
5891 aci_bat_src_info(&src_id,&src_infos);
5892
5893 resp.ctrl_response=BAT_RES_UNS_PERCENT_CPRI;
5894 resp.response.ptr_res_percent_cpri=&cpri_data;
5895
5896 cpri_data.gsm_ciph=(T_BAT_percent_cpri_gsm_ciph)gsm_ciph;
5897 cpri_data.gprs_ciph=(T_BAT_percent_cpri_gprs_ciph)gprs_ciph;
5898
5899 aci_bat_send(src_infos,&resp);
5900 }
5901
5902
5903
5904 #ifdef FF_FAX
5905 /*
5906 +--------------------------------------------------------------------+
5907 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5908 | STATE : code ROUTINE : rBAT_PlusFIS |
5909 +--------------------------------------------------------------------+
5910
5911 PURPOSE : ITU-T.32
5912 */
5913 GLOBAL void rBAT_PlusFIS( T_ACI_F_VR vr,
5914 T_ACI_F_BR br,
5915 T_ACI_F_WD wd,
5916 T_ACI_F_LN ln,
5917 T_ACI_F_DF df,
5918 T_ACI_F_EC ec,
5919 T_ACI_F_BF bf,
5920 T_ACI_F_ST st,
5921 T_ACI_F_JP jp)
5922 {
5923 T_ACI_CMD_SRC src_id;
5924 T_ACI_DTI_PRC_PSI *src_infos;
5925 T_BAT_cmd_response resp;
5926 T_BAT_res_que_plus_fis fis;
5927
5928 TRACE_FUNCTION ("rBAT_PlusFIS()");
5929
5930 aci_bat_src_info(&src_id, &src_infos);
5931
5932 resp.ctrl_response = BAT_RES_QUE_PLUS_FIS;
5933 resp.response.ptr_que_plus_fis = &fis;
5934
5935 fis.vr = (T_BAT_fax_vr)vr;
5936 fis.br = (T_BAT_fax_br)br;
5937 fis.wd = (T_BAT_fax_wd)wd;
5938 fis.ln = (T_BAT_fax_ln)ln;
5939 fis.df = (T_BAT_fax_df)df;
5940 fis.ec = (T_BAT_fax_ec)ec;
5941 fis.bf = (T_BAT_fax_bf)bf;
5942 fis.st = (T_BAT_fax_st)st;
5943 fis.jp = (T_BAT_fax_jp)jp;
5944
5945 aci_bat_send(src_infos, &resp);
5946 }
5947
5948 /*
5949 +--------------------------------------------------------------------+
5950 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5951 | STATE : code ROUTINE : rBAT_PlusFCS |
5952 +--------------------------------------------------------------------+
5953
5954 PURPOSE : ITU-T.32
5955 */
5956 GLOBAL void rBAT_PlusFCS( T_ACI_F_VR vr,
5957 T_ACI_F_BR br,
5958 T_ACI_F_WD wd,
5959 T_ACI_F_LN ln,
5960 T_ACI_F_DF df,
5961 T_ACI_F_EC ec,
5962 T_ACI_F_BF bf,
5963 T_ACI_F_ST st,
5964 T_ACI_F_JP jp)
5965 {
5966 T_ACI_CMD_SRC src_id;
5967 T_ACI_DTI_PRC_PSI *src_infos;
5968 T_BAT_cmd_response resp;
5969 T_BAT_res_que_plus_fcs fcs;
5970
5971 TRACE_FUNCTION ("rBAT_PlusFCS()");
5972
5973 aci_bat_src_info(&src_id, &src_infos);
5974
5975 resp.ctrl_response = BAT_RES_QUE_PLUS_FCS;
5976 resp.response.ptr_que_plus_fcs = &fcs;
5977
5978 fcs.vr = (T_BAT_fax_vr)vr;
5979 fcs.br = (T_BAT_fax_br)br;
5980 fcs.wd = (T_BAT_fax_wd)wd;
5981 fcs.ln = (T_BAT_fax_ln)ln;
5982 fcs.df = (T_BAT_fax_df)df;
5983 fcs.ec = (T_BAT_fax_ec)ec;
5984 fcs.bf = (T_BAT_fax_bf)bf;
5985 fcs.st = (T_BAT_fax_st)st;
5986 fcs.jp = (T_BAT_fax_jp)jp;
5987
5988 aci_bat_send(src_infos, &resp);
5989 }
5990
5991 /*
5992 +--------------------------------------------------------------------+
5993 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
5994 | STATE : code ROUTINE : rBAT_PlusFSA |
5995 +--------------------------------------------------------------------+
5996
5997 PURPOSE : ITU-T.32
5998 */
5999 GLOBAL void rBAT_PlusFSA(U8 c_sub_str, U8 *sub_str)
6000 {
6001 T_ACI_CMD_SRC src_id;
6002 T_ACI_DTI_PRC_PSI *src_infos;
6003 T_BAT_cmd_response resp;
6004 T_BAT_res_que_plus_fsa fsa;
6005
6006 TRACE_FUNCTION ("rBAT_PlusFSA()");
6007
6008 aci_bat_src_info(&src_id, &src_infos);
6009
6010 resp.ctrl_response = BAT_RES_QUE_PLUS_FSA;
6011 resp.response.ptr_que_plus_fsa = &fsa;
6012 fsa.c_sub_str = c_sub_str;
6013 memcpy(fsa.sub_str, sub_str, c_sub_str);
6014
6015 aci_bat_send(src_infos, &resp);
6016 }
6017
6018 /*
6019 +--------------------------------------------------------------------+
6020 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6021 | STATE : code ROUTINE : rBAT_PlusFPA |
6022 +--------------------------------------------------------------------+
6023
6024 PURPOSE : ITU-T.32
6025 */
6026 GLOBAL void rBAT_PlusFPA(U8 c_spa_str, U8 *spa_str)
6027 {
6028 T_ACI_CMD_SRC src_id;
6029 T_ACI_DTI_PRC_PSI *src_infos;
6030 T_BAT_cmd_response resp;
6031 T_BAT_res_que_plus_fpa fpa;
6032
6033 TRACE_FUNCTION ("rBAT_PlusFPA()");
6034
6035 aci_bat_src_info(&src_id, &src_infos);
6036
6037 resp.ctrl_response = BAT_RES_QUE_PLUS_FPA;
6038 resp.response.ptr_que_plus_fpa = &fpa;
6039 fpa.c_spa_str = c_spa_str;
6040 memcpy(fpa.spa_str, spa_str, c_spa_str);
6041
6042 aci_bat_send(src_infos, &resp);
6043 }
6044
6045 /*
6046 +--------------------------------------------------------------------+
6047 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6048 | STATE : code ROUTINE : rBAT_PlusFPW |
6049 +--------------------------------------------------------------------+
6050
6051 PURPOSE : ITU-T.32
6052 */
6053 GLOBAL void rBAT_PlusFPW(U8 c_pw_str, U8 *pw_str)
6054 {
6055 T_ACI_CMD_SRC src_id;
6056 T_ACI_DTI_PRC_PSI *src_infos;
6057 T_BAT_cmd_response resp;
6058 T_BAT_res_que_plus_fpw fpw;
6059
6060 TRACE_FUNCTION ("rBAT_PlusFPW()");
6061
6062 aci_bat_src_info(&src_id, &src_infos);
6063
6064 resp.ctrl_response = BAT_RES_QUE_PLUS_FPW;
6065 resp.response.ptr_que_plus_fpw = &fpw;
6066 fpw.c_pw_str = c_pw_str;
6067 memcpy(fpw.pw_str, pw_str, c_pw_str);
6068
6069 aci_bat_send(src_infos, &resp);
6070 }
6071
6072 /*
6073 +--------------------------------------------------------------------+
6074 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6075 | STATE : code ROUTINE : rBAT_PlusFPI |
6076 +--------------------------------------------------------------------+
6077
6078 PURPOSE : ITU-T.32
6079 */
6080 GLOBAL void rBAT_PlusFPI(U8 c_id_str, U8 *id_str)
6081 {
6082 T_ACI_CMD_SRC src_id;
6083 T_ACI_DTI_PRC_PSI *src_infos;
6084 T_BAT_cmd_response resp;
6085 T_BAT_res_que_plus_fpi fpi;
6086
6087 TRACE_FUNCTION ("rBAT_PlusFPI()");
6088
6089 aci_bat_src_info(&src_id, &src_infos);
6090
6091 resp.ctrl_response = BAT_RES_QUE_PLUS_FPI;
6092 resp.response.ptr_que_plus_fpi = &fpi;
6093 fpi.c_id_str = c_id_str;
6094 memcpy(fpi.id_str, id_str, c_id_str);
6095
6096 aci_bat_send(src_infos, &resp);
6097 }
6098
6099 /*
6100 +--------------------------------------------------------------------+
6101 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6102 | STATE : code ROUTINE : rBAT_PlusFNS |
6103 +--------------------------------------------------------------------+
6104
6105 PURPOSE : ITU-T.32
6106 */
6107 GLOBAL void rBAT_PlusFNS(U8 c_nsf, U8 *nsf)
6108 {
6109 T_ACI_CMD_SRC src_id;
6110 T_ACI_DTI_PRC_PSI *src_infos;
6111 T_BAT_cmd_response resp;
6112 T_BAT_res_que_plus_fns fns;
6113
6114 TRACE_FUNCTION ("rBAT_PlusFNS()");
6115
6116 aci_bat_src_info(&src_id, &src_infos);
6117
6118 resp.ctrl_response = BAT_RES_QUE_PLUS_FNS;
6119 resp.response.ptr_que_plus_fns = &fns;
6120 fns.c_nsf = c_nsf;
6121 memcpy(fns.nsf, nsf, c_nsf);
6122
6123 aci_bat_send(src_infos, &resp);
6124 }
6125
6126 /*
6127 +--------------------------------------------------------------------+
6128 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6129 | STATE : code ROUTINE : rBAT_PlusFHS |
6130 +--------------------------------------------------------------------+
6131
6132 PURPOSE : ITU-T.32
6133 */
6134 GLOBAL void rBAT_PlusFHS(T_BAT_plus_fhs_status status)
6135 {
6136 T_ACI_CMD_SRC src_id;
6137 T_ACI_DTI_PRC_PSI *src_infos;
6138 T_BAT_cmd_response resp;
6139 T_BAT_res_que_plus_fhs fhs;
6140
6141 TRACE_FUNCTION ("rBAT_PlusFHS()");
6142
6143 aci_bat_src_info(&src_id, &src_infos);
6144
6145 resp.ctrl_response = BAT_RES_QUE_PLUS_FHS;
6146 resp.response.ptr_que_plus_fhs = &fhs;
6147 fhs.status = status;
6148
6149 aci_bat_send(src_infos, &resp);
6150 }
6151
6152 /*
6153 +--------------------------------------------------------------------+
6154 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6155 | STATE : code ROUTINE : rBAT_PlusFPS |
6156 +--------------------------------------------------------------------+
6157
6158 PURPOSE : ITU-T.32
6159 */
6160 GLOBAL void rBAT_PlusFPS(T_BAT_plus_fps_ppr ppr)
6161 {
6162 T_ACI_CMD_SRC src_id;
6163 T_ACI_DTI_PRC_PSI *src_infos;
6164 T_BAT_cmd_response resp;
6165 T_BAT_res_que_plus_fps fps;
6166
6167 TRACE_FUNCTION ("rBAT_PlusFPS()");
6168
6169 aci_bat_src_info(&src_id, &src_infos);
6170
6171 resp.ctrl_response = BAT_RES_QUE_PLUS_FPS;
6172 resp.response.ptr_que_plus_fps = &fps;
6173 fps.ppr = ppr;
6174
6175 aci_bat_send(src_infos, &resp);
6176 }
6177
6178 /*
6179 +--------------------------------------------------------------------+
6180 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6181 | STATE : code ROUTINE : rBAT_PlusFCO |
6182 +--------------------------------------------------------------------+
6183
6184 PURPOSE : ITU-T.32
6185 */
6186 GLOBAL void rBAT_PlusFCO(void)
6187 {
6188 /*
6189 T_ACI_CMD_SRC src_id;
6190 T_ACI_DTI_PRC_PSI *src_infos;
6191 T_BAT_cmd_response resp;
6192 T_BAT_res_que_plus_fco fco;
6193
6194 TRACE_FUNCTION ("rBAT_PlusFCO()");
6195
6196 aci_bat_src_info(&src_id, &src_infos);
6197
6198 resp.ctrl_response = BAT_RES_QUE_PLUS_FCO;
6199 resp.response.ptr_que_plus_fco = &fco;
6200
6201 aci_bat_send(src_infos, &resp);
6202 */
6203 }
6204
6205 /*
6206 +--------------------------------------------------------------------+
6207 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6208 | STATE : code ROUTINE : rBAT_PlusFTI |
6209 +--------------------------------------------------------------------+
6210
6211 PURPOSE : ITU-T.32
6212 */
6213 GLOBAL void rBAT_PlusFTI(CHAR *tsi)
6214 {
6215 /*
6216 T_ACI_CMD_SRC src_id;
6217 T_ACI_DTI_PRC_PSI *src_infos;
6218 T_BAT_cmd_response resp;
6219 T_BAT_res_que_plus_fti fti;
6220
6221 TRACE_FUNCTION ("rBAT_PlusFTI()");
6222
6223 aci_bat_src_info(&src_id, &src_infos);
6224
6225 resp.ctrl_response = BAT_RES_QUE_PLUS_FTI;
6226 resp.response.ptr_que_plus_fti = &fti;
6227
6228 aci_bat_send(src_infos, &resp);
6229 */
6230 }
6231
6232 /*
6233 +--------------------------------------------------------------------+
6234 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6235 | STATE : code ROUTINE : rBAT_PlusFCI |
6236 +--------------------------------------------------------------------+
6237
6238 PURPOSE : ITU-T.32
6239 */
6240 GLOBAL void rBAT_PlusFCI(CHAR *rmtId)
6241 {
6242 /*
6243 T_ACI_CMD_SRC src_id;
6244 T_ACI_DTI_PRC_PSI *src_infos;
6245 T_BAT_cmd_response resp;
6246 T_BAT_res_que_plus_fci fci;
6247
6248 TRACE_FUNCTION ("rBAT_PlusFCI()");
6249
6250 aci_bat_src_info(&src_id, &src_infos);
6251
6252 resp.ctrl_response = BAT_RES_QUE_PLUS_FCI;
6253 resp.response.ptr_que_plus_fci = &fci;
6254
6255 aci_bat_send(src_infos, &resp);
6256 */
6257 }
6258
6259 /*
6260 +--------------------------------------------------------------------+
6261 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6262 | STATE : code ROUTINE : rBAT_PlusFHT |
6263 +--------------------------------------------------------------------+
6264
6265 PURPOSE : ITU-T.32
6266 */
6267 GLOBAL void rBAT_PlusFHT(U16 len, U8 *hdlc)
6268 {
6269 /*
6270 T_ACI_CMD_SRC src_id;
6271 T_ACI_DTI_PRC_PSI *src_infos;
6272 T_BAT_cmd_response resp;
6273 T_BAT_res_que_plus_fht fht;
6274
6275 TRACE_FUNCTION ("rBAT_PlusFHT()");
6276
6277 aci_bat_src_info(&src_id, &src_infos);
6278
6279 resp.ctrl_response = BAT_RES_QUE_PLUS_FHT;
6280 resp.response.ptr_que_plus_fht = &fht;
6281
6282 aci_bat_send(src_infos, &resp);
6283 */
6284 }
6285
6286 /*
6287 +--------------------------------------------------------------------+
6288 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6289 | STATE : code ROUTINE : rBAT_PlusFHR |
6290 +--------------------------------------------------------------------+
6291
6292 PURPOSE : ITU-T.32
6293 */
6294 GLOBAL void rBAT_PlusFHR(U16 len, U8 *hdlc)
6295 {
6296 /*
6297 T_ACI_CMD_SRC src_id;
6298 T_ACI_DTI_PRC_PSI *src_infos;
6299 T_BAT_cmd_response resp;
6300 T_BAT_res_que_plus_fhr fhr;
6301
6302 TRACE_FUNCTION ("rBAT_PlusFHR()");
6303
6304 aci_bat_src_info(&src_id, &src_infos);
6305
6306 resp.ctrl_response = BAT_RES_QUE_PLUS_FHR;
6307 resp.response.ptr_que_plus_fhr = &fhr;
6308
6309 aci_bat_send(src_infos, &resp);
6310 */
6311 }
6312
6313 /*
6314 +--------------------------------------------------------------------+
6315 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6316 | STATE : code ROUTINE : rBAT_PlusFET |
6317 +--------------------------------------------------------------------+
6318
6319 PURPOSE : ITU-T.32
6320 */
6321 GLOBAL void rBAT_PlusFET(T_ACI_FET_PPM ppm)
6322 {
6323 /*
6324 T_ACI_CMD_SRC src_id;
6325 T_ACI_DTI_PRC_PSI *src_infos;
6326 T_BAT_cmd_response resp;
6327 T_BAT_res_que_plus_fet fet;
6328
6329 TRACE_FUNCTION ("rBAT_PlusFET()");
6330
6331 aci_bat_src_info(&src_id, &src_infos);
6332
6333 resp.ctrl_response = BAT_RES_QUE_PLUS_FET;
6334 resp.response.ptr_que_plus_fet = &fet;
6335
6336 aci_bat_send(src_infos, &resp);
6337 */
6338 }
6339
6340 /*
6341 +--------------------------------------------------------------------+
6342 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6343 | STATE : code ROUTINE : rBAT_PlusFVO |
6344 +--------------------------------------------------------------------+
6345
6346 PURPOSE : ITU-T.32
6347 */
6348 GLOBAL void rBAT_PlusFVO(void)
6349 {
6350 /*
6351 T_ACI_CMD_SRC src_id;
6352 T_ACI_DTI_PRC_PSI *src_infos;
6353 T_BAT_cmd_response resp;
6354 T_BAT_res_que_plus_fvo fvo;
6355
6356 TRACE_FUNCTION ("rBAT_PlusFVO()");
6357
6358 aci_bat_src_info(&src_id, &src_infos);
6359
6360 resp.ctrl_response = BAT_RES_QUE_PLUS_FVO;
6361 resp.response.ptr_que_plus_fvo = &fvo;
6362
6363 aci_bat_send(src_infos, &resp);
6364 */
6365 }
6366
6367 /*
6368 +--------------------------------------------------------------------+
6369 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6370 | STATE : code ROUTINE : rBAT_PlusFPO |
6371 +--------------------------------------------------------------------+
6372
6373 PURPOSE : ITU-T.32
6374 */
6375 GLOBAL void rBAT_PlusFPO(void)
6376 {
6377 /*
6378 T_ACI_CMD_SRC src_id;
6379 T_ACI_DTI_PRC_PSI *src_infos;
6380 T_BAT_cmd_response resp;
6381 T_BAT_res_que_plus_fpo fpo;
6382
6383 TRACE_FUNCTION ("rBAT_PlusFPO()");
6384
6385 aci_bat_src_info(&src_id, &src_infos);
6386
6387 resp.ctrl_response = BAT_RES_QUE_PLUS_FPO;
6388 resp.response.ptr_que_plus_fpo = &fpo;
6389
6390 aci_bat_send(src_infos, &resp);
6391 */
6392 }
6393
6394 /*
6395 +--------------------------------------------------------------------+
6396 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6397 | STATE : code ROUTINE : rBAT_PlusFNF |
6398 +--------------------------------------------------------------------+
6399
6400 PURPOSE : ITU-T.32
6401 */
6402 GLOBAL void rBAT_PlusFNF(U16 len, U8 *nsf)
6403 {
6404 /*
6405 T_ACI_CMD_SRC src_id;
6406 T_ACI_DTI_PRC_PSI *src_infos;
6407 T_BAT_cmd_response resp;
6408 T_BAT_res_que_plus_fnf fnf;
6409
6410 TRACE_FUNCTION ("rBAT_PlusFNF()");
6411
6412 aci_bat_src_info(&src_id, &src_infos);
6413
6414 resp.ctrl_response = BAT_RES_QUE_PLUS_FNF;
6415 resp.response.ptr_que_plus_fnf = &fnf;
6416
6417 aci_bat_send(src_infos, &resp);
6418 */
6419 }
6420
6421 /*
6422 +--------------------------------------------------------------------+
6423 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6424 | STATE : code ROUTINE : rBAT_PlusFNC |
6425 +--------------------------------------------------------------------+
6426
6427 PURPOSE : ITU-T.32
6428 */
6429 GLOBAL void rBAT_PlusFNC(U16 len, U8 *nsc)
6430 {
6431 /*
6432 T_ACI_CMD_SRC src_id;
6433 T_ACI_DTI_PRC_PSI *src_infos;
6434 T_BAT_cmd_response resp;
6435 T_BAT_res_que_plus_fnc fnc;
6436
6437 TRACE_FUNCTION ("rBAT_PlusFNC()");
6438
6439 aci_bat_src_info(&src_id, &src_infos);
6440
6441 resp.ctrl_response = BAT_RES_QUE_PLUS_FNC;
6442 resp.response.ptr_que_plus_fnc = &fnc;
6443
6444 aci_bat_send(src_infos, &resp);
6445 */
6446 }
6447
6448 /*
6449 +--------------------------------------------------------------------+
6450 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6451 | STATE : code ROUTINE : rBAT_PlusFTC |
6452 +--------------------------------------------------------------------+
6453
6454 PURPOSE : ITU-T.32
6455 */
6456 GLOBAL void rBAT_PlusFTC( T_ACI_F_VR vr,
6457 T_ACI_F_BR br,
6458 T_ACI_F_WD wd,
6459 T_ACI_F_LN ln,
6460 T_ACI_F_DF df,
6461 T_ACI_F_EC ec,
6462 T_ACI_F_BF bf,
6463 T_ACI_F_ST st,
6464 T_ACI_F_JP jp)
6465 {
6466 /*
6467 T_ACI_CMD_SRC src_id;
6468 T_ACI_DTI_PRC_PSI *src_infos;
6469 T_BAT_cmd_response resp;
6470 T_BAT_res_que_plus_ftc ftc;
6471
6472 TRACE_FUNCTION ("rBAT_PlusFTC()");
6473
6474 aci_bat_src_info(&src_id, &src_infos);
6475
6476 resp.ctrl_response = BAT_RES_QUE_PLUS_FTC;
6477 resp.response.ptr_que_plus_ftc = &ftc;
6478
6479 aci_bat_send(src_infos, &resp);
6480 */
6481 }
6482
6483 #endif /* FF_FAX */
6484
6485 /*
6486 +--------------------------------------------------------------------+
6487 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6488 | STATE : code ROUTINE : rBAT_PercentSIMEF |
6489 +--------------------------------------------------------------------+
6490
6491 PURPOSE :
6492 */
6493 GLOBAL void rBAT_PercentSIMEF(T_SIM_FILE_UPDATE_IND *sim_file_update_ind)
6494 {
6495 T_ACI_CMD_SRC src_id;
6496 T_ACI_DTI_PRC_PSI *src_infos;
6497 T_BAT_cmd_response resp;
6498 T_BAT_res_uns_percent_simef simef_data;
6499 UBYTE n;
6500
6501 TRACE_FUNCTION ("rBAT_PercentSIMEF()");
6502
6503 /*
6504 * Get the source ID and a pointer to the PSI source information.
6505 */
6506 aci_bat_src_info(&src_id, &src_infos);
6507
6508 resp.ctrl_response = BAT_RES_UNS_PERCENT_SIMEF;
6509 resp.response.ptr_res_percent_simef = &simef_data;
6510
6511 for (n=0; ((n<sim_file_update_ind->val_nr) AND (n<BAT_MAX_SIMEF_EF_LEN)); n++)
6512 {
6513 memcpy(&(simef_data.ef[n]), &(sim_file_update_ind->file_info[n]), sizeof(T_BAT_file_info));
6514 }
6515
6516 simef_data.c_ef = (U8)sim_file_update_ind->val_nr;
6517
6518 aci_bat_send(src_infos,&resp);
6519 }
6520
6521
6522 #ifdef REL99
6523 GLOBAL void rBAT_PercentCMGRS (UBYTE mode,
6524 T_MNSMS_RETRANS_CNF * mnsms_retrans_cnf,
6525 T_MNSMS_SEND_PROG_IND * mnsms_send_prog_ind)
6526 {
6527 T_ACI_CMD_SRC src_id;
6528 T_ACI_DTI_PRC_PSI *src_infos;
6529 T_BAT_cmd_response resp;
6530 T_BAT_res_uns_percent_cmgrs cmgrs_data;
6531
6532 TRACE_FUNCTION ("rBAT_PercentSIMEF()");
6533
6534 /*
6535 * Get the source ID and a pointer to the PSI source information.
6536 */
6537 aci_bat_src_info(&src_id,&src_infos);
6538
6539 resp.ctrl_response = BAT_RES_UNS_PERCENT_CMGRS;
6540 resp.response.ptr_res_percent_cmgrs = &cmgrs_data;
6541
6542 if (mode EQ BAT_CMGRS_MODE_MANUAL_RETRANS AND mnsms_retrans_cnf NEQ NULL)
6543 {
6544 cmgrs_data.mode = (T_BAT_percent_cmgrs_mode)mode;
6545 cmgrs_data.tp_mr = mnsms_retrans_cnf->tp_mr;
6546 }
6547 else if (mode EQ BAT_CMGRS_MODE_ENABLE_AUTO_RETRANS AND mnsms_send_prog_ind NEQ NULL)
6548 {
6549 cmgrs_data.mode = (T_BAT_percent_cmgrs_mode)mode;
6550 cmgrs_data.resend_count = mnsms_send_prog_ind->resend_count;
6551 cmgrs_data.max_retrans = mnsms_send_prog_ind->max_retrans;
6552 }
6553 else
6554 {
6555 TRACE_ERROR("%CMGRS: wrong combination of parameters");
6556 return;
6557 }
6558 aci_bat_send(src_infos,&resp);
6559 }
6560 #endif
6561
6562
6563 #ifdef REL99
6564 /*
6565 +--------------------------------------------------------------------+
6566 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT |
6567 | STATE : code ROUTINE : rBAT_PlusCGCMOD |
6568 +--------------------------------------------------------------------+
6569
6570 PURPOSE :
6571 */
6572
6573 GLOBAL void rBAT_PlusCGCMOD ( void )
6574 {
6575 TRACE_FUNCTION("rBAT_PlusCGCMOD()");
6576 return;
6577 }
6578 #endif /* REL99 */
6579
6580
6581