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