FreeCalypso > hg > fc-magnetite
comparison src/g23m-aci/aci/aci_bat_cc.c @ 162:53929b40109c
src/g23m-aci: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 11 Oct 2016 02:02:43 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
161:4557e2a9c18e | 162:53929b40109c |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-F&D (8411) | |
4 | Modul : ACI_BAT | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : This BAT wrapper modul is ... | |
18 | | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #include "aci_all.h" | |
23 #undef FF_ATI | |
24 #include "aci_cmh.h" | |
25 #include "aci_cmd.h" | |
26 #include "aci.h" | |
27 #include "aci_bat_cmh.h" /* prototypes of sBAT_,qBAT_,tBAT_ */ | |
28 #include "aci_bat.h" | |
29 #ifdef _SIMULATION_ | |
30 #pragma message(__TODO__"aci_prs.h: EXTERN char *parse(char *b,char *f, ...); of ati_prs.c !") | |
31 #endif | |
32 #include "aci_prs.h" | |
33 | |
34 /* implemented in aci_util.c, but prototype in ati_int.h ! Header file cleanup needed ! */ | |
35 EXTERN CHAR *strupper (CHAR *s); | |
36 | |
37 /*================== local functions prototypes =============================*/ | |
38 | |
39 LOCAL T_ACI_BAT_RSLT aci_bat_call_from_phonebook(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
40 T_BAT_cmd_send *cmd); | |
41 | |
42 LOCAL T_ACI_BAT_RSLT aci_bat_call_with_number (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
43 T_BAT_cmd_send *cmd); | |
44 | |
45 LOCAL void aci_bat_chld_mode_mapping (T_BAT_cmd_set_percent_chld* bat_chld_param, | |
46 T_ACI_CHLD_MOD *mode); | |
47 /*================== local functions ========================================*/ | |
48 | |
49 /* | |
50 * special hint: | |
51 * There is hard coded the definition of NO_ASCIIZ (see phb.h, aci.h and aci_cmh.h), | |
52 * which means it is always defined regardless what busybe configures. | |
53 * So, we never work with NULL terminated strings, | |
54 * but with character arrays, which have a length information in addition | |
55 * to know how many characters to process. | |
56 * In this code there is several times this #ifdef NO_ASCIIZ | |
57 * just to go with the current implementation of ACI. | |
58 * But NULL terminated strings are not covered ! | |
59 */ | |
60 | |
61 LOCAL void aci_bat_clean_dial_str (char *dial_str, int dial_len) | |
62 { | |
63 #define VALID_CHARS "*#+-PpWw" | |
64 int i,j,k = 0; | |
65 int charLen = sizeof(VALID_CHARS); | |
66 char *valChrs = VALID_CHARS; | |
67 int match = FALSE; | |
68 | |
69 for (i=0; i<dial_len; i++) | |
70 { | |
71 match = FALSE; | |
72 if ((dial_str[i] < '0') || (dial_str[i] > 'D')) | |
73 { | |
74 for (j=0; j<charLen; j++) | |
75 { | |
76 if (dial_str[i] == valChrs[j]) /* "*#+-PpWw" */ | |
77 { | |
78 match = TRUE; | |
79 break; | |
80 } | |
81 } | |
82 } | |
83 else /* "0123456789ABCD" */ | |
84 { | |
85 match = TRUE; | |
86 } | |
87 if (match) | |
88 { | |
89 dial_str[k] = dial_str[i]; | |
90 k++; | |
91 } | |
92 } | |
93 if (k < dial_len) | |
94 { | |
95 dial_str[k] = 0x0; /* is there always 1 byte space for the '\0' ? */ | |
96 } | |
97 } | |
98 | |
99 | |
100 | |
101 LOCAL void aci_bat_check_clir_cug_type (U8 *dial_string, | |
102 T_ACI_D_CLIR_OVRD *clir_ovrd, | |
103 T_ACI_D_CUG_CTRL *cug_ctrl, | |
104 T_ACI_D_TOC *call_type) | |
105 { | |
106 if (*dial_string EQ 'i') | |
107 { | |
108 *clir_ovrd = D_CLIR_OVRD_Supp; | |
109 dial_string++; | |
110 } | |
111 if (*dial_string EQ 'I') | |
112 { | |
113 *clir_ovrd = D_CLIR_OVRD_Invoc; | |
114 dial_string++; | |
115 } | |
116 if (*dial_string EQ 'g'OR *dial_string EQ 'G') | |
117 { | |
118 *cug_ctrl = D_CUG_CTRL_Present; | |
119 dial_string++; | |
120 } | |
121 if (*dial_string EQ ';') | |
122 { | |
123 *call_type = D_TOC_Voice; | |
124 } | |
125 } | |
126 | |
127 #define NAME_BUF_LEN 32 | |
128 | |
129 LOCAL T_ACI_BAT_RSLT aci_bat_call_from_phonebook(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
130 T_BAT_cmd_send *cmd) | |
131 { | |
132 T_bat_aci_client_maintain *bat_client; | |
133 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
134 CHAR *dial_string = NULL; | |
135 int i; | |
136 S16 index = -1; | |
137 S16 pos; | |
138 char alpha[NAME_BUF_LEN] = {'\0'}; | |
139 U16 lenAlpha = 0; | |
140 char cvtdAlpha[NAME_BUF_LEN] = {'\0'}; | |
141 U16 lenCvtdAlpha = 0; | |
142 char t[MAX_DIAL_LEN-1] = {'\0'}; | |
143 char *t_p = NULL; | |
144 | |
145 T_ACI_PB_STOR mem_stor = PB_STOR_NotPresent; | |
146 T_ACI_D_CLIR_OVRD clir_ovrd = D_CLIR_OVRD_Default; | |
147 T_ACI_D_CUG_CTRL cug_ctrl = D_CUG_CTRL_NotPresent; | |
148 T_ACI_D_TOC call_type = D_TOC_Data; | |
149 | |
150 #ifdef NO_ASCIIZ | |
151 T_ACI_PB_TEXT pbText; | |
152 #endif | |
153 | |
154 TRACE_FUNCTION ("aci_bat_call_from_phonebook()"); | |
155 | |
156 dial_string = (CHAR*)cmd->params.ptr_at_d->dial_string; | |
157 dial_string++; /* skip the already parsed '>'; */ | |
158 | |
159 if (*dial_string EQ '"') | |
160 { | |
161 /* call with a given name of phonebook e.g.: ATD>"Doe Joe" */ | |
162 dial_string = parse(dial_string,"z", | |
163 (LONG)NAME_BUF_LEN, | |
164 strlen(dial_string), | |
165 dial_string, | |
166 &lenAlpha, | |
167 alpha); | |
168 if (dial_string EQ NULL) | |
169 { | |
170 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow); | |
171 return (ACI_BAT_FAIL); | |
172 } | |
173 else if (strcspn(dial_string,"iIgG;") NEQ 0) | |
174 { | |
175 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow); | |
176 return (ACI_BAT_FAIL); | |
177 } | |
178 #ifdef NO_ASCIIZ | |
179 utl_chsetToSim ((UBYTE*)alpha, lenAlpha, (UBYTE*)cvtdAlpha, &lenCvtdAlpha, GSM_ALPHA_Def); | |
180 #else | |
181 TRACE_ERROR("NO_ASCIIZ is defined in aci.h, phb.c and aci_cmh.h, so NO support for NULL terminated strings"); | |
182 #endif | |
183 t_p = cvtdAlpha; | |
184 } | |
185 else | |
186 { | |
187 /* call from a specific phonebook entry e.g.: ATD>MT7 */ | |
188 if ((toupper(*dial_string)) >= 'A' AND (toupper(*dial_string)) <= 'Z') | |
189 { | |
190 for (i=0;phb_mem_names[i].name NEQ 0;i++) | |
191 { | |
192 strupper(dial_string); | |
193 if (strncmp(dial_string,phb_mem_names[i].name,2) EQ 0) | |
194 { | |
195 mem_stor=phb_mem_names[i].stor; | |
196 break; | |
197 } | |
198 else | |
199 { | |
200 mem_stor=PB_STOR_NotPresent; | |
201 } | |
202 } | |
203 if (mem_stor < 0) | |
204 { | |
205 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow); | |
206 return (ACI_BAT_FAIL); | |
207 } | |
208 dial_string=dial_string+2; | |
209 } | |
210 pos=strcspn(dial_string,"iIgG;"); /* determine index */ | |
211 if (pos EQ 0 OR pos >= (MAX_DIAL_LEN-1)) | |
212 { | |
213 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow); | |
214 return (ACI_BAT_FAIL); | |
215 } | |
216 strncpy(t,dial_string,pos); | |
217 dial_string=dial_string+pos; | |
218 index =(SHORT)atoi(t); | |
219 | |
220 if(!index OR index > 300) | |
221 { | |
222 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow); | |
223 return (ACI_BAT_FAIL); | |
224 } | |
225 t_p = NULL; | |
226 } | |
227 | |
228 aci_bat_check_clir_cug_type ((U8*)dial_string, &clir_ovrd, &cug_ctrl, &call_type); | |
229 | |
230 #ifdef NO_ASCIIZ | |
231 if ( t_p NEQ NULL ) | |
232 { | |
233 pbText.cs = CS_Sim; | |
234 pbText.len = (UBYTE)lenCvtdAlpha; | |
235 memcpy(pbText.data, t_p, pbText.len); | |
236 } | |
237 else | |
238 { | |
239 pbText.cs = CS_NotPresent; | |
240 pbText.len = 0; | |
241 } | |
242 | |
243 /* | |
244 * Get a pointer to the client information for convenience. | |
245 */ | |
246 bat_client=&src_infos_psi->bat_client[src_infos_psi->active_client]; | |
247 | |
248 /* | |
249 * Set the flag that indicates that we are waiting for a final | |
250 * response to the ATD. | |
251 */ | |
252 bat_client->atd_live=TRUE; | |
253 | |
254 ret = (T_ACI_BAT_RSLT)sAT_Dm((T_ACI_CMD_SRC)src_infos_psi->srcId, &pbText, mem_stor, index, clir_ovrd, cug_ctrl, call_type); | |
255 | |
256 /* | |
257 * If the command isn't executing, we can't still be waiting for a | |
258 * final response, so clear the flag. | |
259 */ | |
260 if (ret NEQ ACI_BAT_EXCT) | |
261 { | |
262 bat_client->atd_live=FALSE; | |
263 } | |
264 | |
265 #else | |
266 TRACE_ERROR("NO_ASCIIZ is defined in aci.h, phb.c and aci_cmh.h, so NO support for NULL terminated strings"); | |
267 #endif | |
268 return (ret); | |
269 } | |
270 | |
271 LOCAL T_ACI_BAT_RSLT aci_bat_call_with_number (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
272 T_BAT_cmd_send *cmd) | |
273 { | |
274 T_bat_aci_client_maintain *bat_client; | |
275 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
276 CHAR *dial_string = NULL; | |
277 S16 pos; | |
278 char t[MAX_DIAL_LEN-1] = {'\0'}; | |
279 | |
280 T_ACI_D_CLIR_OVRD clir_ovrd = D_CLIR_OVRD_Default; | |
281 T_ACI_D_CUG_CTRL cug_ctrl = D_CUG_CTRL_NotPresent; | |
282 T_ACI_D_TOC call_type = D_TOC_Data; | |
283 | |
284 TRACE_FUNCTION ("aci_bat_call_with_number()"); | |
285 | |
286 dial_string = (CHAR*)cmd->params.ptr_at_d->dial_string; | |
287 | |
288 pos = strcspn(dial_string,"iIgG;"); /* CLIR, CUG and call type are passed separately to sAT_Dn */ | |
289 if (pos >= MAX_DIAL_LEN-1) | |
290 { | |
291 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow); | |
292 return (ACI_BAT_FAIL); | |
293 } | |
294 if (pos) | |
295 { | |
296 strncpy(t, dial_string, pos); | |
297 dial_string = dial_string + pos; | |
298 t[pos]='\0'; | |
299 } | |
300 else | |
301 { | |
302 strcpy(t,dial_string); | |
303 } | |
304 | |
305 aci_bat_clean_dial_str (t, sizeof(t)); | |
306 | |
307 aci_bat_check_clir_cug_type ((U8*)dial_string, &clir_ovrd, &cug_ctrl, &call_type); | |
308 | |
309 /* | |
310 * Get a pointer to the client information for convenience. | |
311 */ | |
312 bat_client=&src_infos_psi->bat_client[src_infos_psi->active_client]; | |
313 | |
314 /* | |
315 * Set the flag that indicates that we are waiting for a final | |
316 * response to the ATD. | |
317 */ | |
318 bat_client->atd_live=TRUE; | |
319 | |
320 ret = (T_ACI_BAT_RSLT)sAT_Dn((T_ACI_CMD_SRC)src_infos_psi->srcId, t, clir_ovrd, cug_ctrl, call_type); | |
321 | |
322 /* | |
323 * If the command isn't executing, we can't still be waiting for a | |
324 * final response, so clear the flag. | |
325 */ | |
326 if (ret NEQ ACI_BAT_EXCT) | |
327 { | |
328 bat_client->atd_live=FALSE; | |
329 } | |
330 | |
331 return (ret); | |
332 } | |
333 | |
334 /* | |
335 +-------------------------------------------------------------------------+ | |
336 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
337 | STATE : code ROUTINE : aci_bat_chld_mode_mapping | | |
338 +-------------------------------------------------------------------------+ | |
339 | |
340 PURPOSE : Maps the CHLD mode passed by BAT application to | |
341 appropriate ENUM value | |
342 */ | |
343 | |
344 LOCAL void aci_bat_chld_mode_mapping (T_BAT_cmd_set_percent_chld* bat_chld_param, | |
345 T_ACI_CHLD_MOD *mode) | |
346 { | |
347 TRACE_FUNCTION("aci_bat_chld_mode_mapping()"); | |
348 | |
349 switch(bat_chld_param->n) | |
350 { | |
351 case (BAT_P_CHLD_N_RELHLDORUDUB): | |
352 *mode = CHLD_MOD_RelHldOrUdub; | |
353 break; | |
354 | |
355 case (BAT_P_CHLD_N_RELACTANDACPT): | |
356 if ( bat_chld_param->x EQ ((S16)BAT_PARAMETER_NOT_PRESENT) ) | |
357 { | |
358 *mode = CHLD_MOD_RelActAndAcpt; | |
359 } | |
360 else | |
361 { | |
362 *mode = CHLD_MOD_RelActSpec; | |
363 } | |
364 break; | |
365 | |
366 case(BAT_P_CHLD_N_HLDACTANDACPT): | |
367 if ( bat_chld_param->x EQ ((S16)BAT_PARAMETER_NOT_PRESENT) ) | |
368 { | |
369 *mode = CHLD_MOD_HldActAndAcpt; | |
370 } | |
371 else | |
372 { | |
373 *mode = CHLD_MOD_HldActExc; | |
374 } | |
375 break; | |
376 | |
377 case(BAT_P_CHLD_N_ADDHLD): | |
378 *mode = CHLD_MOD_AddHld; | |
379 break; | |
380 | |
381 case(BAT_P_CHLD_N_ECT): | |
382 *mode = CHLD_MOD_Ect; | |
383 break; | |
384 | |
385 case(BAT_P_CHLD_N_CCBS): | |
386 *mode = CHLD_MOD_Ccbs; | |
387 break; | |
388 | |
389 case(BAT_P_CHLD_N_SWAP): | |
390 if ( bat_chld_param->x EQ ((S16)BAT_PARAMETER_NOT_PRESENT) ) | |
391 { | |
392 *mode = CHLD_MOD_RetrieveHoldCall; | |
393 } | |
394 else | |
395 { | |
396 *mode = CHLD_MOD_RetrieveHoldCallSpec; | |
397 } | |
398 break; | |
399 | |
400 case(BAT_P_CHLD_N_RELANYSPEC): | |
401 *mode = CHLD_MOD_RelAnySpec; | |
402 break; | |
403 | |
404 case(BAT_P_CHLD_N_ONLYHOLD): | |
405 /* FTA requires an extra mode: Put on hold (without | |
406 * accepting automatically waiting or held calls) | |
407 */ | |
408 *mode = CHLD_MOD_OnlyHold; | |
409 break; | |
410 | |
411 case(BAT_P_CHLD_N_RELDIALCALL): | |
412 /* Release dialing call, without dropping current call. */ | |
413 *mode = CHLD_MOD_RelDialCall; | |
414 break; | |
415 | |
416 default: | |
417 break; | |
418 } | |
419 } | |
420 | |
421 /*================== global functions ========================================*/ | |
422 | |
423 /* | |
424 +--------------------------------------------------------------------+ | |
425 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
426 | STATE : code ROUTINE : BAT_D | | |
427 +--------------------------------------------------------------------+ | |
428 | |
429 PURPOSE : dial command for voice, data or USSD | |
430 | |
431 1. call from phone book ? --> ATD>"Doe Joe" | |
432 1.a with CUG ON/OFF and/or CLIP ? --> ATD>"Doe Joe"G | |
433 1.b what character set ? | |
434 2 call from specific phone book ? --> ATD>MT7 | |
435 2.a with CUG ON/OFF and/or CLIP ? --> ATD>MT7I | |
436 3. call with number ? --> ATD1234567 | |
437 3.a with CUG ON/OFF and/or CLIP ? --> ATD1234567g | |
438 4. is the call a voice call ? --> ATDxxxxxxxx; <-- semicolon ? | |
439 | |
440 up to here in general voice or data call is distinguished. | |
441 whether the data call is CSD, GPRS or USSD (checked by ksd_xxx() within cmhCC_Dial()) | |
442 is handled on CMH level. see cmhCC_Dial() | |
443 | |
444 */ | |
445 GLOBAL T_ACI_BAT_RSLT BAT_D (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
446 T_BAT_cmd_send *cmd) | |
447 { | |
448 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
449 U8 *dial_string = NULL; | |
450 TRACE_FUNCTION ("BAT_D()"); | |
451 | |
452 if (cmd->params.ptr_at_d->c_dial_string) | |
453 { | |
454 if (cmd->params.ptr_at_d->c_dial_string > MAX_DIAL_LEN-1) | |
455 { | |
456 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow); | |
457 return (ACI_BAT_FAIL); | |
458 } | |
459 dial_string = cmd->params.ptr_at_d->dial_string; | |
460 if (*dial_string EQ '>') | |
461 { | |
462 ret = aci_bat_call_from_phonebook(src_infos_psi, cmd); | |
463 } | |
464 else | |
465 { | |
466 ret = aci_bat_call_with_number(src_infos_psi, cmd); | |
467 } | |
468 } | |
469 else | |
470 { | |
471 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown); /* No dial string, so unknown error */ | |
472 } | |
473 return(ret); | |
474 } | |
475 | |
476 /* | |
477 +--------------------------------------------------------------------+ | |
478 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
479 | STATE : code ROUTINE : BAT_A | | |
480 +--------------------------------------------------------------------+ | |
481 | |
482 PURPOSE : ATA on binary level there is just a cmd.ctrl_params = BAT_CMD_AT_A | |
483 no additional parameter needed. | |
484 */ | |
485 GLOBAL T_ACI_BAT_RSLT BAT_A (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
486 T_BAT_cmd_send *cmd) | |
487 { | |
488 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
489 TRACE_FUNCTION ("BAT_A()"); | |
490 ret = (T_ACI_BAT_RSLT)sAT_A((T_ACI_CMD_SRC)src_infos_psi->srcId); | |
491 if (ret EQ ACI_BAT_FAIL) | |
492 { | |
493 if (!(ACI_BAT_VALID_ERR_DESC())) /* has sAT_A already set an error value ? */ | |
494 { | |
495 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown); /* No, so unknown error */ | |
496 } | |
497 } | |
498 return(ret); | |
499 } | |
500 | |
501 /* | |
502 +--------------------------------------------------------------------+ | |
503 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
504 | STATE : code ROUTINE : sBAT_H | | |
505 +--------------------------------------------------------------------+ | |
506 | |
507 PURPOSE : | |
508 */ | |
509 GLOBAL T_ACI_BAT_RSLT BAT_H (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
510 T_BAT_cmd_send *cmd) | |
511 { | |
512 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
513 TRACE_FUNCTION ("BAT_H()"); | |
514 ret = (T_ACI_BAT_RSLT)sAT_H((T_ACI_CMD_SRC)src_infos_psi->srcId); | |
515 if (ret EQ ACI_BAT_FAIL) | |
516 { | |
517 if (!(ACI_BAT_VALID_ERR_DESC())) /* has sAT_H already set an error value ? */ | |
518 { | |
519 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown); /* No, so unknown error */ | |
520 } | |
521 } | |
522 return(ret); | |
523 } | |
524 | |
525 #ifdef FAX_AND_DATA | |
526 /* | |
527 +--------------------------------------------------------------------+ | |
528 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
529 | STATE : code ROUTINE : sBAT_PlusCBST | | |
530 +--------------------------------------------------------------------+ | |
531 | |
532 PURPOSE : | |
533 */ | |
534 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCBST (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
535 T_BAT_cmd_send *cmd) | |
536 { | |
537 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
538 | |
539 TRACE_FUNCTION ("sBAT_PlusCBST()"); | |
540 | |
541 ret = (T_ACI_BAT_RSLT)sAT_PlusCBST((T_ACI_CMD_SRC)src_infos_psi->srcId,(T_ACI_BS_SPEED)cmd->params.ptr_set_plus_cbst->speed, | |
542 (T_ACI_CBST_NAM)cmd->params.ptr_set_plus_cbst->name, | |
543 (T_ACI_CBST_CE)cmd->params.ptr_set_plus_cbst->ce); | |
544 return(ret); | |
545 } | |
546 | |
547 /* | |
548 +--------------------------------------------------------------------+ | |
549 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
550 | STATE : code ROUTINE : qBAT_PlusCBST | | |
551 +--------------------------------------------------------------------+ | |
552 | |
553 PURPOSE : | |
554 */ | |
555 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCBST (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
556 T_BAT_cmd_send *cmd) | |
557 { | |
558 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
559 T_BAT_plus_cbst_speed speed = BAT_CBST_SPD_NOT_PRESENT; | |
560 T_BAT_plus_cbst_name name = BAT_CBST_NAM_NOT_PRESENT ; | |
561 T_BAT_plus_cbst_ce ce = BAT_CBST_CE_NOT_PRESENT; | |
562 T_BAT_cmd_response resp; | |
563 T_BAT_res_que_plus_cbst que_cbst_buffer; | |
564 | |
565 TRACE_FUNCTION ("qBAT_PlusCBST()"); | |
566 resp.ctrl_response = BAT_RES_QUE_PLUS_CBST; | |
567 resp.response.ptr_que_plus_cbst = &que_cbst_buffer; | |
568 | |
569 ret = (T_ACI_BAT_RSLT)qAT_PlusCBST((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
570 (T_ACI_BS_SPEED*)&speed,(T_ACI_CBST_NAM*)&name,(T_ACI_CBST_CE*)&ce); | |
571 if(ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
572 { | |
573 resp.response.ptr_que_plus_cbst->ce = ce; | |
574 resp.response.ptr_que_plus_cbst->speed = speed; | |
575 resp.response.ptr_que_plus_cbst->name = name; | |
576 aci_bat_send(src_infos_psi,&resp); | |
577 return ACI_BAT_CMPL; | |
578 } | |
579 else | |
580 { | |
581 return ACI_BAT_FAIL; | |
582 } | |
583 } | |
584 #endif /* FAX_AND_DATA */ | |
585 /* | |
586 +--------------------------------------------------------------------+ | |
587 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
588 | STATE : code ROUTINE : sBAT_PercentCTTY | | |
589 +--------------------------------------------------------------------+ | |
590 | |
591 PURPOSE : | |
592 */ | |
593 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCTTY (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
594 T_BAT_cmd_send *cmd) | |
595 { | |
596 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
597 | |
598 TRACE_FUNCTION ("sBAT_PercentCTTY()"); | |
599 | |
600 ret = (T_ACI_BAT_RSLT)sAT_PercentCTTY ((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
601 CTTY_MOD_Enable, (T_ACI_CTTY_REQ)cmd->params.ptr_set_percent_ctty->req); | |
602 /*sending hardcoded enable mode for sAT_XXXX */ | |
603 | |
604 return(ret); | |
605 } | |
606 | |
607 /* | |
608 +--------------------------------------------------------------------+ | |
609 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
610 | STATE : code ROUTINE : qBAT_PercentCTTY | | |
611 +--------------------------------------------------------------------+ | |
612 | |
613 PURPOSE : | |
614 */ | |
615 GLOBAL T_ACI_BAT_RSLT qBAT_PercentCTTY (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
616 T_BAT_cmd_send *cmd) | |
617 { | |
618 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
619 T_BAT_percent_ctty_req req ; | |
620 UBYTE mode; | |
621 T_BAT_cmd_response resp; | |
622 T_BAT_res_que_percent_ctty que_tty_buffer; | |
623 T_BAT_trx trx; | |
624 T_BAT_percent_ctty_m state; | |
625 | |
626 TRACE_FUNCTION ("qBAT_PercentCTTY()"); | |
627 | |
628 resp.ctrl_response = BAT_RES_QUE_PERCENT_CTTY ; | |
629 resp.response.ptr_que_percent_ctty = &que_tty_buffer; | |
630 | |
631 ret = (T_ACI_BAT_RSLT)qAT_PercentCTTY ((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
632 (T_ACI_CTTY_MOD *)&mode,(T_ACI_CTTY_REQ *)&req,(T_ACI_CTTY_STAT *)&state,(T_ACI_CTTY_TRX *)&trx); | |
633 resp.response.ptr_que_percent_ctty->m= state ; | |
634 resp.response.ptr_que_percent_ctty->req = req; | |
635 resp.response.ptr_que_percent_ctty->trx = trx; | |
636 | |
637 aci_bat_send(src_infos_psi,&resp); | |
638 return(ret); | |
639 } | |
640 | |
641 /* | |
642 +--------------------------------------------------------------------+ | |
643 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
644 | STATE : code ROUTINE : sBAT_PlusCSTA | | |
645 +--------------------------------------------------------------------+ | |
646 | |
647 PURPOSE : | |
648 */ | |
649 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCSTA (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
650 T_BAT_cmd_send *cmd) | |
651 { | |
652 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
653 T_ACI_TOA type, | |
654 *p_type; | |
655 | |
656 TRACE_FUNCTION ("sBAT_PlusCSTA()"); | |
657 | |
658 p_type=&type; | |
659 if (cmd->params.ptr_set_plus_csta->type EQ ((S16)BAT_PARAMETER_NOT_PRESENT)) | |
660 { | |
661 p_type = NULL; | |
662 } | |
663 else | |
664 { | |
665 type = toa_demerge(cmd->params.ptr_set_plus_csta->type); | |
666 if (type.ton < 0 OR type.npi < 0) | |
667 { | |
668 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_OpNotAllow); | |
669 return (ACI_BAT_FAIL); | |
670 } | |
671 } | |
672 ret = (T_ACI_BAT_RSLT)sAT_PlusCSTA((T_ACI_CMD_SRC)src_infos_psi->srcId,p_type); | |
673 return(ret); | |
674 } | |
675 | |
676 /* | |
677 +--------------------------------------------------------------------+ | |
678 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
679 | STATE : code ROUTINE : qBAT_PlusCSTA | | |
680 +--------------------------------------------------------------------+ | |
681 | |
682 PURPOSE : | |
683 */ | |
684 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCSTA (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
685 T_BAT_cmd_send *cmd) | |
686 { | |
687 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
688 T_ACI_TOA type; | |
689 T_BAT_cmd_response resp; | |
690 T_BAT_res_que_plus_csta que_csta_buffer; | |
691 | |
692 TRACE_FUNCTION ("qBAT_PlusCSTA()"); | |
693 resp.ctrl_response = BAT_RES_QUE_PLUS_CSTA; | |
694 resp.response.ptr_que_plus_csta = &que_csta_buffer; | |
695 | |
696 ret = (T_ACI_BAT_RSLT)qAT_PlusCSTA((T_ACI_CMD_SRC)src_infos_psi->srcId,&type); | |
697 if (ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
698 { | |
699 resp.response.ptr_que_plus_csta->type = toa_merge (type); | |
700 aci_bat_send(src_infos_psi, &resp); | |
701 } | |
702 return(ret); | |
703 } | |
704 | |
705 /* | |
706 +--------------------------------------------------------------------+ | |
707 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
708 | STATE : code ROUTINE : sBAT_PercentCHLD | | |
709 +--------------------------------------------------------------------+ | |
710 | |
711 PURPOSE : | |
712 */ | |
713 GLOBAL T_ACI_BAT_RSLT sBAT_PercentCHLD (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
714 T_BAT_cmd_send *cmd) | |
715 { | |
716 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
717 T_ACI_CHLD_MOD mode = CHLD_MOD_NotPresent; | |
718 CHAR X_prm[2]; | |
719 CHAR* p_X_prm; | |
720 | |
721 TRACE_FUNCTION ("sBAT_PercentCHLD()"); | |
722 | |
723 X_prm[0] = (CHAR)NOT_PRESENT_8BIT; | |
724 p_X_prm = X_prm; | |
725 | |
726 /* | |
727 * Map the mode from BAT application to appropriate ENUM values | |
728 * present in ACI | |
729 */ | |
730 aci_bat_chld_mode_mapping (cmd->params.ptr_set_percent_chld, &mode); | |
731 | |
732 if(cmd->params.ptr_set_percent_chld->x NEQ ((S16)BAT_PARAMETER_NOT_PRESENT)) | |
733 { | |
734 X_prm[0] = (char)(cmd->params.ptr_set_percent_chld->x + 0x30); /* 0x30 = '0' */ | |
735 X_prm[1] = '\0'; | |
736 } | |
737 else | |
738 { | |
739 p_X_prm = NULL; | |
740 } | |
741 ret = (T_ACI_BAT_RSLT)sAT_PercentCHLD((T_ACI_CMD_SRC)src_infos_psi->srcId, mode, p_X_prm ); | |
742 return(ret); | |
743 } | |
744 | |
745 /* | |
746 +--------------------------------------------------------------------+ | |
747 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
748 | STATE : code ROUTINE : qBAT_PlusCLIP | | |
749 +--------------------------------------------------------------------+ | |
750 | |
751 PURPOSE : | |
752 */ | |
753 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCLIP (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
754 T_BAT_cmd_send *cmd) | |
755 { | |
756 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
757 T_ACI_CLIP_STAT stat = CLIP_STAT_NotPresent; | |
758 T_BAT_cmd_response resp; | |
759 T_BAT_res_que_plus_clip que_clip_buffer; | |
760 | |
761 TRACE_FUNCTION ("qBAT_PlusCLIP()"); | |
762 | |
763 resp.ctrl_response = BAT_RES_QUE_PLUS_CLIP; | |
764 resp.response.ptr_que_plus_clip = &que_clip_buffer; | |
765 | |
766 ret = (T_ACI_BAT_RSLT)qAT_PlusCLIP((T_ACI_CMD_SRC)src_infos_psi->srcId,&stat); | |
767 if (ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
768 { | |
769 resp.response.ptr_que_plus_clip->m = (T_BAT_plus_clip_m)stat ; | |
770 aci_bat_send(src_infos_psi, &resp); | |
771 } | |
772 return(ret); | |
773 } | |
774 | |
775 /* | |
776 +--------------------------------------------------------------------+ | |
777 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
778 | STATE : code ROUTINE : qBAT_PlusCDIP | | |
779 +--------------------------------------------------------------------+ | |
780 | |
781 PURPOSE : | |
782 */ | |
783 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCDIP (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
784 T_BAT_cmd_send *cmd) | |
785 { | |
786 T_ACI_BAT_RSLT ret = ACI_BAT_CMPL; | |
787 T_ACI_CDIP_STAT stat = CDIP_STAT_Unknown; | |
788 T_BAT_cmd_response resp; | |
789 T_BAT_res_que_plus_cdip que_cdip_buffer; | |
790 | |
791 TRACE_FUNCTION ("qBAT_PlusCDIP()"); | |
792 | |
793 resp.ctrl_response = BAT_RES_QUE_PLUS_CDIP; | |
794 resp.response.ptr_que_plus_cdip = &que_cdip_buffer; | |
795 | |
796 resp.response.ptr_que_plus_cdip->m = (T_BAT_plus_cdip_m)stat ; | |
797 aci_bat_send(src_infos_psi, &resp); | |
798 | |
799 return(ret); | |
800 } | |
801 | |
802 /* | |
803 +--------------------------------------------------------------------+ | |
804 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
805 | STATE : code ROUTINE : qBAT_PlusCOLP | | |
806 +--------------------------------------------------------------------+ | |
807 | |
808 PURPOSE : | |
809 */ | |
810 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCOLP (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
811 T_BAT_cmd_send *cmd) | |
812 { | |
813 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
814 T_ACI_COLP_STAT stat = COLP_STAT_NotPresent; | |
815 T_BAT_cmd_response resp; | |
816 T_BAT_res_que_plus_colp que_colp_buffer; | |
817 | |
818 TRACE_FUNCTION ("qBAT_PlusCOLP()"); | |
819 | |
820 resp.ctrl_response = BAT_RES_QUE_PLUS_COLP; | |
821 resp.response.ptr_que_plus_colp = &que_colp_buffer; | |
822 | |
823 ret = (T_ACI_BAT_RSLT)qAT_PlusCOLP((T_ACI_CMD_SRC)src_infos_psi->srcId,&stat); | |
824 if (ret EQ (T_ACI_BAT_RSLT)AT_CMPL) | |
825 { | |
826 resp.response.ptr_que_plus_colp->m = (T_BAT_plus_colp_m)stat ; | |
827 aci_bat_send(src_infos_psi, &resp); | |
828 } | |
829 return(ret); | |
830 } | |
831 | |
832 /* | |
833 +--------------------------------------------------------------------+ | |
834 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
835 | STATE : code ROUTINE : sBAT_PlusCLIR | | |
836 +--------------------------------------------------------------------+ | |
837 | |
838 PURPOSE : | |
839 */ | |
840 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCLIR (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
841 T_BAT_cmd_send *cmd) | |
842 { | |
843 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
844 | |
845 TRACE_FUNCTION ("sBAT_PlusCLIR()"); | |
846 | |
847 ret = (T_ACI_BAT_RSLT)sAT_PlusCLIR((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
848 (T_ACI_CLIR_MOD)cmd->params.ptr_set_plus_clir->n); | |
849 return(ret); | |
850 } | |
851 | |
852 /* | |
853 +--------------------------------------------------------------------+ | |
854 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
855 | STATE : code ROUTINE : qBAT_PlusCLIR | | |
856 +--------------------------------------------------------------------+ | |
857 | |
858 PURPOSE : | |
859 */ | |
860 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCLIR (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
861 T_BAT_cmd_send *cmd) | |
862 { | |
863 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
864 T_ACI_CLIR_STAT stat = CLIR_STAT_NotPresent; | |
865 T_ACI_CLIR_MOD mode = CLIR_MOD_NotPresent; | |
866 T_BAT_cmd_response resp; | |
867 T_BAT_res_que_plus_clir clir; | |
868 | |
869 TRACE_FUNCTION ("qBAT_PlusCLIR()"); | |
870 | |
871 resp.ctrl_response = BAT_RES_QUE_PLUS_CLIR; | |
872 resp.response.ptr_que_plus_clir = &clir; | |
873 | |
874 ret = (T_ACI_BAT_RSLT)qAT_PlusCLIR ((T_ACI_CMD_SRC)src_infos_psi->srcId,&mode,&stat); | |
875 | |
876 if(ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
877 { | |
878 resp.response.ptr_que_plus_clir->m = (T_BAT_plus_clir_m)stat; | |
879 resp.response.ptr_que_plus_clir->n = (T_BAT_plus_clir_n)mode; | |
880 aci_bat_send(src_infos_psi,&resp); | |
881 } | |
882 return(ret); | |
883 } | |
884 | |
885 /* | |
886 +--------------------------------------------------------------------+ | |
887 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
888 | STATE : code ROUTINE : sBAT_PlusCCUG | | |
889 +--------------------------------------------------------------------+ | |
890 | |
891 PURPOSE : | |
892 */ | |
893 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCCUG (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
894 T_BAT_cmd_send *cmd) | |
895 { | |
896 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
897 T_BAT_plus_ccug_n n = BAT_CCUG_N_NOT_PRESENT ; | |
898 T_BAT_plus_ccug_index index = BAT_CCUG_INDEX_NOT_PRESENT ; | |
899 T_BAT_plus_ccug_info info = BAT_CCUG_INFO_NOT_PRESENT ; | |
900 | |
901 TRACE_FUNCTION ("sBAT_PlusCCUG()"); | |
902 | |
903 n = cmd->params.ptr_set_plus_ccug->n; | |
904 index = cmd->params.ptr_set_plus_ccug->index; | |
905 info = cmd->params.ptr_set_plus_ccug->info; | |
906 | |
907 ret = (T_ACI_BAT_RSLT)sAT_PlusCCUG((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
908 (T_ACI_CCUG_MOD)n,(T_ACI_CCUG_IDX)index,(T_ACI_CCUG_INFO)info); | |
909 return(ret); | |
910 } | |
911 | |
912 /* | |
913 +--------------------------------------------------------------------+ | |
914 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
915 | STATE : code ROUTINE : qBAT_PlusCCUG | | |
916 +--------------------------------------------------------------------+ | |
917 | |
918 PURPOSE : | |
919 */ | |
920 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCCUG (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
921 T_BAT_cmd_send *cmd) | |
922 { | |
923 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
924 T_ACI_CCUG_MOD mode = CCUG_MOD_NotPresent; | |
925 T_ACI_CCUG_IDX idx = CCUG_IDX_NotPresent; | |
926 T_ACI_CCUG_INFO info = CCUG_INFO_NotPresent; | |
927 T_BAT_cmd_response resp; | |
928 T_BAT_res_que_plus_ccug que_ccug_buffer; | |
929 | |
930 TRACE_FUNCTION ("qBAT_PlusCCUG()"); | |
931 | |
932 resp.ctrl_response = BAT_RES_QUE_PLUS_CCUG; | |
933 resp.response.ptr_que_plus_ccug = &que_ccug_buffer; | |
934 | |
935 ret = (T_ACI_BAT_RSLT)qAT_PlusCCUG ((T_ACI_CMD_SRC)src_infos_psi->srcId,&mode,&idx,&info); | |
936 if(ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
937 { | |
938 resp.response.ptr_que_plus_ccug->n = (T_BAT_plus_ccug_n)mode; | |
939 resp.response.ptr_que_plus_ccug->index = (T_BAT_plus_ccug_index)idx; | |
940 resp.response.ptr_que_plus_ccug->info = (T_BAT_plus_ccug_info)info; | |
941 aci_bat_send(src_infos_psi,&resp); | |
942 } | |
943 return(ret); | |
944 } | |
945 | |
946 /* | |
947 +--------------------------------------------------------------------+ | |
948 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
949 | STATE : code ROUTINE : sBAT_PlusCMOD | | |
950 +--------------------------------------------------------------------+ | |
951 | |
952 PURPOSE : | |
953 */ | |
954 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCMOD (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
955 T_BAT_cmd_send *cmd) | |
956 { | |
957 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
958 T_BAT_plus_cmod_mode mode = BAT_CMOD_MODE_NOT_PRESENT; | |
959 | |
960 TRACE_FUNCTION ("sBAT_PlusCMOD()"); | |
961 | |
962 mode = cmd->params.ptr_set_plus_cmod->mode; | |
963 ret = (T_ACI_BAT_RSLT)sAT_PlusCMOD ((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
964 (T_ACI_CMOD_MOD)mode); | |
965 | |
966 return(ret); | |
967 } | |
968 | |
969 /* | |
970 +--------------------------------------------------------------------+ | |
971 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
972 | STATE : code ROUTINE : qBAT_PlusCMOD | | |
973 +--------------------------------------------------------------------+ | |
974 | |
975 PURPOSE : | |
976 */ | |
977 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCMOD (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
978 T_BAT_cmd_send *cmd) | |
979 { | |
980 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
981 T_ACI_CMOD_MOD mode = CMOD_MOD_NotPresent; | |
982 T_BAT_cmd_response resp; | |
983 T_BAT_res_que_plus_cmod que_cmod_buffer; | |
984 | |
985 TRACE_FUNCTION ("qBAT_PlusCMOD()"); | |
986 resp.ctrl_response = BAT_RES_QUE_PLUS_CMOD; | |
987 resp.response.ptr_que_plus_cmod = &que_cmod_buffer; | |
988 | |
989 ret = (T_ACI_BAT_RSLT)qAT_PlusCMOD ((T_ACI_CMD_SRC)src_infos_psi->srcId,&mode); | |
990 if (ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
991 { | |
992 resp.response.ptr_que_plus_cmod->mode = (T_BAT_plus_cmod_mode)mode; | |
993 aci_bat_send(src_infos_psi,&resp); | |
994 } | |
995 return(ret); | |
996 } | |
997 | |
998 /* | |
999 +--------------------------------------------------------------------+ | |
1000 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1001 | STATE : code ROUTINE : sBAT_PlusCR | | |
1002 +--------------------------------------------------------------------+ | |
1003 | |
1004 PURPOSE : | |
1005 */ | |
1006 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCR (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1007 T_BAT_cmd_send *cmd) | |
1008 { | |
1009 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1010 | |
1011 TRACE_FUNCTION ("sBAT_PlusCR()"); | |
1012 | |
1013 return(ret); | |
1014 } | |
1015 | |
1016 /* | |
1017 +--------------------------------------------------------------------+ | |
1018 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1019 | STATE : code ROUTINE : qBAT_PlusCR | | |
1020 +--------------------------------------------------------------------+ | |
1021 | |
1022 PURPOSE : | |
1023 */ | |
1024 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCR (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1025 T_BAT_cmd_send *cmd) | |
1026 { | |
1027 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1028 T_BAT_res_uns_plus_cr cr; | |
1029 | |
1030 TRACE_FUNCTION ("qBAT_PlusCR()"); | |
1031 | |
1032 memset(&cr,0x00,sizeof(T_BAT_res_uns_plus_cr)); | |
1033 | |
1034 /* Check This Out */ | |
1035 return(ret); | |
1036 } | |
1037 | |
1038 /* | |
1039 +--------------------------------------------------------------------+ | |
1040 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1041 | STATE : code ROUTINE : sBAT_PlusCAOC | | |
1042 +--------------------------------------------------------------------+ | |
1043 | |
1044 PURPOSE : | |
1045 */ | |
1046 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCAOC (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1047 T_BAT_cmd_send *cmd) | |
1048 { | |
1049 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1050 LONG ccm = 0L; | |
1051 SHORT mode = 0; | |
1052 T_BAT_cmd_response resp; | |
1053 T_BAT_res_set_plus_caoc caoc; | |
1054 | |
1055 TRACE_FUNCTION ("sBAT_PlusCAOC()"); | |
1056 | |
1057 resp.ctrl_response = BAT_RES_SET_PLUS_CAOC; | |
1058 resp.response.ptr_set_plus_caoc = &caoc; | |
1059 | |
1060 mode = cmd->params.ptr_set_plus_caoc->mode; | |
1061 if(mode EQ BAT_CAOC_MODE_QUERY) | |
1062 { | |
1063 ret = (T_ACI_BAT_RSLT)qAT_PlusCAOC((T_ACI_CMD_SRC)src_infos_psi->srcId,&ccm); | |
1064 } | |
1065 else | |
1066 { | |
1067 return(ACI_BAT_FAIL); | |
1068 } | |
1069 | |
1070 if (ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
1071 { | |
1072 resp.response.ptr_set_plus_caoc->ccm = ccm; | |
1073 aci_bat_send(src_infos_psi,&resp); | |
1074 } | |
1075 return(ret); | |
1076 } | |
1077 | |
1078 /* | |
1079 +--------------------------------------------------------------------+ | |
1080 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1081 | STATE : code ROUTINE : sBAT_PlusCACM | | |
1082 +--------------------------------------------------------------------+ | |
1083 | |
1084 PURPOSE : | |
1085 */ | |
1086 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCACM (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1087 T_BAT_cmd_send *cmd) | |
1088 { | |
1089 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1090 char pin2 [MAX_PWD_LENGTH] = {0} ; | |
1091 | |
1092 TRACE_FUNCTION ("sBAT_PlusCACM()"); | |
1093 | |
1094 memcpy(pin2,cmd->params.ptr_set_plus_cacm->passwd,cmd->params.ptr_set_plus_cacm->c_passwd); | |
1095 ret = (T_ACI_BAT_RSLT)sAT_PlusCACM((T_ACI_CMD_SRC)src_infos_psi->srcId,pin2); | |
1096 return(ret); | |
1097 } | |
1098 | |
1099 /* | |
1100 +--------------------------------------------------------------------+ | |
1101 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1102 | STATE : code ROUTINE : qBAT_PlusCACM | | |
1103 +--------------------------------------------------------------------+ | |
1104 | |
1105 PURPOSE : | |
1106 */ | |
1107 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCACM (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1108 T_BAT_cmd_send *cmd) | |
1109 { | |
1110 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1111 LONG acm = 0L; | |
1112 T_BAT_cmd_response resp; | |
1113 T_BAT_res_que_plus_cacm que_cacm_buffer; | |
1114 | |
1115 TRACE_FUNCTION ("qBAT_PlusCACM()"); | |
1116 | |
1117 resp.ctrl_response = BAT_RES_QUE_PLUS_CACM; | |
1118 resp.response.ptr_que_plus_cacm = &que_cacm_buffer; | |
1119 | |
1120 ret = (T_ACI_BAT_RSLT)qAT_PlusCACM((T_ACI_CMD_SRC)src_infos_psi->srcId,&acm); | |
1121 if (ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
1122 { | |
1123 resp.response.ptr_que_plus_cacm->acm = acm; | |
1124 aci_bat_send(src_infos_psi,&resp); | |
1125 } | |
1126 return(ret); | |
1127 } | |
1128 | |
1129 /* | |
1130 +--------------------------------------------------------------------+ | |
1131 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1132 | STATE : code ROUTINE : sBAT_PlusCAMM | | |
1133 +--------------------------------------------------------------------+ | |
1134 | |
1135 PURPOSE : | |
1136 */ | |
1137 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCAMM (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1138 T_BAT_cmd_send *cmd) | |
1139 { | |
1140 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1141 char pin2 [MAX_PWD_LENGTH] = {0}; | |
1142 char* p_pin2; | |
1143 | |
1144 TRACE_FUNCTION ("sBAT_PlusCAMM()"); | |
1145 | |
1146 p_pin2 = pin2; | |
1147 if(cmd->params.ptr_set_plus_camm->v_passwd) | |
1148 { | |
1149 memcpy(pin2,cmd->params.ptr_set_plus_camm->passwd,cmd->params.ptr_set_plus_camm->c_passwd); | |
1150 } | |
1151 /* else | |
1152 { | |
1153 p_pin2 = NULL; | |
1154 } */ | |
1155 ret = (T_ACI_BAT_RSLT)sAT_PlusCAMM((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
1156 cmd->params.ptr_set_plus_camm->acmmax,p_pin2); | |
1157 switch ((T_ACI_RETURN)ret) | |
1158 { | |
1159 case AT_BUSY: | |
1160 { | |
1161 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_SimBusy); | |
1162 break; | |
1163 } | |
1164 default: | |
1165 { | |
1166 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_OpNotAllow); | |
1167 break; | |
1168 } | |
1169 } | |
1170 return(ret); | |
1171 } | |
1172 | |
1173 /* | |
1174 +--------------------------------------------------------------------+ | |
1175 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1176 | STATE : code ROUTINE : qBAT_PlusCAMM | | |
1177 +--------------------------------------------------------------------+ | |
1178 | |
1179 PURPOSE : | |
1180 */ | |
1181 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCAMM (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1182 T_BAT_cmd_send *cmd) | |
1183 { | |
1184 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1185 LONG acmmax = 0L; | |
1186 T_BAT_cmd_response resp; | |
1187 T_BAT_res_que_plus_camm que_camm_buffer; | |
1188 | |
1189 TRACE_FUNCTION ("qBAT_PlusCAMM()"); | |
1190 | |
1191 resp.ctrl_response = BAT_RES_QUE_PLUS_CAMM; | |
1192 resp.response.ptr_que_plus_camm = &que_camm_buffer; | |
1193 ret = (T_ACI_BAT_RSLT)qAT_PlusCAMM((T_ACI_CMD_SRC)src_infos_psi->srcId,&acmmax); | |
1194 if (ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
1195 { | |
1196 resp.response.ptr_que_plus_camm->acmmax = acmmax; | |
1197 aci_bat_send(src_infos_psi,&resp); | |
1198 } | |
1199 return(ret); | |
1200 } | |
1201 | |
1202 | |
1203 /* | |
1204 +--------------------------------------------------------------------+ | |
1205 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1206 | STATE : code ROUTINE : sBAT_PlusCPUC | | |
1207 +--------------------------------------------------------------------+ | |
1208 | |
1209 PURPOSE : | |
1210 */ | |
1211 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCPUC (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1212 T_BAT_cmd_send *cmd) | |
1213 { | |
1214 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1215 char currency [MAX_CUR_LEN] = {0x00}; | |
1216 char cvtdCurrency [2*MAX_CUR_LEN] = {0x00}; | |
1217 USHORT lenCvtdCurrency = 0; | |
1218 char ppu [MAX_PPU_LENGTH] = {0x00}; | |
1219 char pin2 [MAX_PWD_LENGTH] = {0x00}; | |
1220 char* p_pin2; | |
1221 | |
1222 TRACE_FUNCTION ("sBAT_PlusCPUC()"); | |
1223 | |
1224 p_pin2 = pin2; | |
1225 | |
1226 memcpy(currency,cmd->params.ptr_set_plus_cpuc->currency,cmd->params.ptr_set_plus_cpuc->c_currency); | |
1227 memcpy(ppu,cmd->params.ptr_set_plus_cpuc->ppu,cmd->params.ptr_set_plus_cpuc->c_ppu); | |
1228 if(cmd->params.ptr_set_plus_cpuc->v_passwd) | |
1229 { | |
1230 memcpy(pin2,cmd->params.ptr_set_plus_cpuc->passwd,cmd->params.ptr_set_plus_cpuc->c_passwd); | |
1231 } | |
1232 else | |
1233 { | |
1234 p_pin2 = NULL; | |
1235 } | |
1236 utl_chsetToGsm ((UBYTE*)currency, | |
1237 cmd->params.ptr_set_plus_cpuc->c_currency, | |
1238 (UBYTE*)cvtdCurrency, | |
1239 &lenCvtdCurrency, | |
1240 #ifdef REL99 | |
1241 sizeof(cvtdCurrency), | |
1242 #endif /* REL99 */ | |
1243 GSM_ALPHA_Int); | |
1244 ret = (T_ACI_BAT_RSLT)sAT_PlusCPUC((T_ACI_CMD_SRC)src_infos_psi->srcId,cvtdCurrency,ppu,p_pin2); | |
1245 switch ((T_ACI_RETURN)ret) | |
1246 { | |
1247 case AT_BUSY: | |
1248 { | |
1249 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_SimBusy); | |
1250 break; | |
1251 } | |
1252 default: | |
1253 { | |
1254 ACI_ERR_DESC(ACI_ERR_CLASS_Cme,CME_ERR_OpNotAllow); | |
1255 break; | |
1256 } | |
1257 } | |
1258 return(ret); | |
1259 } | |
1260 | |
1261 /* | |
1262 +--------------------------------------------------------------------+ | |
1263 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1264 | STATE : code ROUTINE : qBAT_PlusCPUC | | |
1265 +--------------------------------------------------------------------+ | |
1266 | |
1267 PURPOSE : | |
1268 */ | |
1269 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCPUC (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1270 T_BAT_cmd_send *cmd) | |
1271 { | |
1272 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1273 char currency [MAX_CUR_LEN] = {0x00}; | |
1274 char cvtdCurrency [2*MAX_CUR_LEN] = {0x00}; | |
1275 USHORT lenCvtdCurrency = 0; | |
1276 char ppu [MAX_PPU_LENGTH] = {0x00}; | |
1277 T_BAT_cmd_response resp; | |
1278 T_BAT_res_que_plus_cpuc que_cpuc_buffer; | |
1279 | |
1280 | |
1281 TRACE_FUNCTION ("qBAT_PlusCPUC()"); | |
1282 resp.ctrl_response = BAT_RES_QUE_PLUS_CPUC; | |
1283 resp.response.ptr_que_plus_cpuc = &que_cpuc_buffer; | |
1284 | |
1285 ret = (T_ACI_BAT_RSLT)qAT_PlusCPUC((T_ACI_CMD_SRC)src_infos_psi->srcId,currency, ppu); | |
1286 if( ret NEQ ((T_ACI_BAT_RSLT)AT_CMPL) ) | |
1287 { | |
1288 return (ACI_BAT_FAIL); | |
1289 } | |
1290 utl_chsetFromGsm((UBYTE*)currency, | |
1291 (USHORT)strlen(currency), | |
1292 (UBYTE*)cvtdCurrency, | |
1293 sizeof(cvtdCurrency), | |
1294 &lenCvtdCurrency, | |
1295 GSM_ALPHA_Def); | |
1296 | |
1297 resp.response.ptr_que_plus_cpuc->c_currency = (U8)lenCvtdCurrency; | |
1298 resp.response.ptr_que_plus_cpuc->c_ppu = strlen(ppu); | |
1299 memcpy(resp.response.ptr_que_plus_cpuc->currency,cvtdCurrency,lenCvtdCurrency); | |
1300 memcpy(resp.response.ptr_que_plus_cpuc->ppu,ppu,strlen(ppu)); | |
1301 aci_bat_send(src_infos_psi,&resp); | |
1302 return(ret); | |
1303 } | |
1304 | |
1305 /* | |
1306 +--------------------------------------------------------------------+ | |
1307 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1308 | STATE : code ROUTINE : qBAT_PlusCLCC | | |
1309 +--------------------------------------------------------------------+ | |
1310 | |
1311 PURPOSE : | |
1312 */ | |
1313 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCLCC (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1314 T_BAT_cmd_send *cmd) | |
1315 { | |
1316 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1317 T_ACI_CLCC_CALDESC *calLst = NULL; | |
1318 UBYTE lstIdx = 0; | |
1319 T_BAT_cmd_response resp; | |
1320 T_BAT_res_que_plus_clcc que_clcc_buffer; | |
1321 | |
1322 | |
1323 TRACE_FUNCTION ("qBAT_PlusCLCC()"); | |
1324 resp.ctrl_response = BAT_RES_QUE_PLUS_CLCC; | |
1325 resp.response.ptr_que_plus_clcc = &que_clcc_buffer; | |
1326 | |
1327 MALLOC (calLst, MAX_CALL_NR * sizeof (T_ACI_CLCC_CALDESC)); | |
1328 ret = (T_ACI_BAT_RSLT)qAT_PlusCLCC((T_ACI_CMD_SRC)src_infos_psi->srcId, calLst); | |
1329 | |
1330 if( ret NEQ ((T_ACI_BAT_RSLT)AT_CMPL) ) | |
1331 { | |
1332 return (ACI_BAT_FAIL); | |
1333 } | |
1334 | |
1335 /* BAT has only one instance of this, so send one call info at a time */ | |
1336 for( lstIdx = 0; lstIdx < MAX_CALL_NR; lstIdx++ ) | |
1337 { | |
1338 if( calLst[lstIdx].idx EQ ACI_NumParmNotPresent ) | |
1339 break; | |
1340 | |
1341 /* Reset before sending data for each call id */ | |
1342 memset(resp.response.ptr_que_plus_clcc,0x00,sizeof(T_BAT_res_que_plus_clcc)); | |
1343 | |
1344 resp.response.ptr_que_plus_clcc->idx = (S16)calLst[lstIdx].idx; | |
1345 resp.response.ptr_que_plus_clcc->dir = (T_BAT_plus_clcc_dir)calLst[lstIdx].dir; | |
1346 resp.response.ptr_que_plus_clcc->stat = (T_BAT_plus_clcc_stat)calLst[lstIdx].stat; | |
1347 resp.response.ptr_que_plus_clcc->mode = (T_BAT_plus_clcc_mode)calLst[lstIdx].mode; | |
1348 resp.response.ptr_que_plus_clcc->mpty = (T_BAT_plus_clcc_mpty)calLst[lstIdx].mpty; | |
1349 | |
1350 if (calLst[lstIdx].number[0] NEQ 0x0) | |
1351 { | |
1352 resp.response.ptr_que_plus_clcc->v_number = TRUE; | |
1353 resp.response.ptr_que_plus_clcc->c_number = strlen(calLst[lstIdx].number); | |
1354 | |
1355 if (resp.response.ptr_que_plus_clcc->c_number > BAT_MAX_CLCC_NUMBER_LEN) | |
1356 resp.response.ptr_que_plus_clcc->c_number = (BAT_MAX_CLCC_NUMBER_LEN - 1); | |
1357 | |
1358 memcpy(resp.response.ptr_que_plus_clcc->number, | |
1359 calLst[lstIdx].number, | |
1360 resp.response.ptr_que_plus_clcc->c_number + 1); /* Include Null terminator */ | |
1361 | |
1362 if (calLst[lstIdx].type.ton NEQ TON_NotPresent) | |
1363 { | |
1364 S16 type = toa_merge(calLst[lstIdx].type); | |
1365 resp.response.ptr_que_plus_clcc->type = type; | |
1366 } | |
1367 #ifdef NO_ASCIIZ | |
1368 if (calLst[lstIdx].alpha.len NEQ 0x0) | |
1369 { | |
1370 resp.response.ptr_que_plus_clcc->v_alpha = TRUE; | |
1371 resp.response.ptr_que_plus_clcc->c_alpha = (U8)calLst[lstIdx].alpha.len; | |
1372 | |
1373 /* Limit alpha length to BAT size */ | |
1374 if (resp.response.ptr_que_plus_clcc->c_alpha > BAT_MAX_PHB_NUM_LEN) | |
1375 resp.response.ptr_que_plus_clcc->c_alpha = BAT_MAX_PHB_NUM_LEN; | |
1376 | |
1377 memcpy(resp.response.ptr_que_plus_clcc->alpha, | |
1378 calLst[lstIdx].alpha.data, | |
1379 resp.response.ptr_que_plus_clcc->c_alpha); | |
1380 } | |
1381 #else /* #ifdef NO_ASCIIZ */ | |
1382 if (calLst[lstIdx].alpha[0] NEQ 0x0) | |
1383 { | |
1384 resp.response.ptr_que_plus_clcc->v_alpha = TRUE; | |
1385 | |
1386 /* Limit alpha length to BAT size */ | |
1387 resp.response.ptr_que_plus_clcc->c_alpha = strlen(calLst[lstIdx].alpha); | |
1388 if (resp.response.ptr_que_plus_clcc->c_alpha > MAX_ALPHA_LEN) /* Has to be BAT_MAX..*/ | |
1389 resp.response.ptr_que_plus_clcc->c_alpha = (MAX_ALPHA_LEN - 1); | |
1390 | |
1391 memcpy(resp.response.ptr_que_plus_clcc->alpha, | |
1392 calLst[lstIdx].alpha, | |
1393 (resp.response.ptr_que_plus_clcc->c_alpha)+1); /* Include the NULL terminator */ | |
1394 } | |
1395 #endif /* #ifdef NO_ASCIIZ */ | |
1396 } | |
1397 | |
1398 aci_bat_send(src_infos_psi,&resp); | |
1399 } | |
1400 | |
1401 MFREE (calLst); | |
1402 return(ret); | |
1403 } | |
1404 | |
1405 /* | |
1406 +--------------------------------------------------------------------+ | |
1407 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1408 | STATE : code ROUTINE : sBAT_PlusCCWA | | |
1409 +--------------------------------------------------------------------+ | |
1410 | |
1411 PURPOSE : | |
1412 */ | |
1413 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCCWA (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1414 T_BAT_cmd_send *cmd) | |
1415 { | |
1416 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1417 T_BAT_plus_ccwa_mode mode = BAT_CCWA_MODE_NOT_PRESENT ; | |
1418 T_ACI_CLASS class_type = CLASS_NotPresent; | |
1419 | |
1420 TRACE_FUNCTION ("sBAT_PlusCCWA()"); | |
1421 | |
1422 mode = cmd->params.ptr_set_plus_ccwa->mode; | |
1423 class_type = (T_ACI_CLASS)cmd->params.ptr_set_plus_ccwa->bearer_class; | |
1424 if (mode EQ BAT_CCWA_MODE_QUERY) | |
1425 { | |
1426 ret = (T_ACI_BAT_RSLT)qAT_PlusCCWA ((T_ACI_CMD_SRC)src_infos_psi->srcId,class_type); | |
1427 } | |
1428 else | |
1429 { | |
1430 ret = (T_ACI_BAT_RSLT)sAT_PlusCCWA ((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
1431 (T_ACI_CCWA_MOD)mode,class_type); | |
1432 } | |
1433 | |
1434 return(ret); | |
1435 } | |
1436 | |
1437 /* | |
1438 +--------------------------------------------------------------------+ | |
1439 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1440 | STATE : code ROUTINE : sBAT_PlusVTS | | |
1441 +--------------------------------------------------------------------+ | |
1442 | |
1443 PURPOSE : | |
1444 */ | |
1445 GLOBAL T_ACI_BAT_RSLT sBAT_PlusVTS (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1446 T_BAT_cmd_send *cmd) | |
1447 { | |
1448 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1449 CHAR dtmf = '\0'; | |
1450 | |
1451 TRACE_FUNCTION ("sBAT_PlusVTS()"); | |
1452 | |
1453 dtmf = cmd->params.ptr_set_plus_vts->dtmf; | |
1454 ret = (T_ACI_BAT_RSLT)sAT_PlusVTS((T_ACI_CMD_SRC)src_infos_psi->srcId,dtmf,VTS_MOD_Auto); | |
1455 return(ret); | |
1456 } | |
1457 | |
1458 /* | |
1459 +--------------------------------------------------------------------+ | |
1460 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1461 | STATE : code ROUTINE : sBAT_PercentRDL | | |
1462 +--------------------------------------------------------------------+ | |
1463 | |
1464 PURPOSE : | |
1465 */ | |
1466 GLOBAL T_ACI_BAT_RSLT sBAT_PercentRDL (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1467 T_BAT_cmd_send *cmd) | |
1468 { | |
1469 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1470 T_BAT_percent_rdl_mode rdlmode = BAT_P_RDL_MODE_NOT_PRESENT ; | |
1471 | |
1472 TRACE_FUNCTION ("sBAT_PercentRDL()"); | |
1473 | |
1474 rdlmode = cmd->params.ptr_set_percent_rdl->mode; | |
1475 ret = (T_ACI_BAT_RSLT)sAT_PercentRDL ((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
1476 (T_ACI_CC_REDIAL_MODE)rdlmode, NOTIF_USER); | |
1477 return(ret); | |
1478 } | |
1479 | |
1480 /* | |
1481 +--------------------------------------------------------------------+ | |
1482 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1483 | STATE : code ROUTINE : qBAT_PercentRDL | | |
1484 +--------------------------------------------------------------------+ | |
1485 | |
1486 PURPOSE : | |
1487 */ | |
1488 GLOBAL T_ACI_BAT_RSLT qBAT_PercentRDL (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1489 T_BAT_cmd_send *cmd) | |
1490 { | |
1491 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1492 T_ACI_CC_REDIAL_MODE rdlmode = AUTOM_REP_NOT_PRESENT; | |
1493 T_ACI_CC_REDIAL_NOTIF usr_notif = NOTIF_NO_PRESENT; | |
1494 T_BAT_cmd_response resp; | |
1495 T_BAT_res_que_percent_rdl que_rdl_buffer; | |
1496 | |
1497 TRACE_FUNCTION ("qBAT_PercentRDL()"); | |
1498 | |
1499 resp.ctrl_response = BAT_RES_QUE_PERCENT_RDL; | |
1500 resp.response.ptr_que_percent_rdl = &que_rdl_buffer; | |
1501 ret = (T_ACI_BAT_RSLT)qAT_PercentRDL((T_ACI_CMD_SRC)src_infos_psi->srcId,&rdlmode, &usr_notif); | |
1502 if(ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
1503 { | |
1504 resp.response.ptr_que_percent_rdl->mode = (T_BAT_percent_rdl_mode)rdlmode; | |
1505 aci_bat_send(src_infos_psi,&resp); | |
1506 } | |
1507 return(ret); | |
1508 } | |
1509 | |
1510 #ifdef TI_PS_FF_AT_P_CMD_RDLB | |
1511 /* | |
1512 +--------------------------------------------------------------------+ | |
1513 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1514 | STATE : code ROUTINE : sBAT_PercentRDLB | | |
1515 +--------------------------------------------------------------------+ | |
1516 | |
1517 PURPOSE : | |
1518 */ | |
1519 GLOBAL T_ACI_BAT_RSLT sBAT_PercentRDLB (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1520 T_BAT_cmd_send *cmd) | |
1521 { | |
1522 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1523 T_BAT_percent_rdlb_mode rdlmode = BAT_P_RDLB_MODE_NOT_PRESENT ; | |
1524 | |
1525 TRACE_FUNCTION ("sBAT_PercentRDLB()"); | |
1526 | |
1527 rdlmode = cmd->params.ptr_set_percent_rdlb->mode; | |
1528 ret = (T_ACI_BAT_RSLT)sAT_PercentRDLB((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
1529 (T_ACI_CC_REDIAL_BLMODE)rdlmode,NOTIF_USER); | |
1530 return(ret); | |
1531 } | |
1532 | |
1533 /* | |
1534 +--------------------------------------------------------------------+ | |
1535 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1536 | STATE : code ROUTINE : qBAT_PercentRDLB | | |
1537 +--------------------------------------------------------------------+ | |
1538 | |
1539 PURPOSE : | |
1540 */ | |
1541 GLOBAL T_ACI_BAT_RSLT qBAT_PercentRDLB (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1542 T_BAT_cmd_send *cmd) | |
1543 { | |
1544 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1545 T_ACI_CC_REDIAL_BLACKL blackl; | |
1546 T_ACI_CC_REDIAL_NOTIF usr_notif= NOTIF_NO_PRESENT; | |
1547 UBYTE i,j; | |
1548 T_BAT_cmd_response resp; | |
1549 T_BAT_res_que_percent_rdlb que_rdlb_buffer; | |
1550 | |
1551 TRACE_FUNCTION ("qBAT_PercentRDLB()"); | |
1552 | |
1553 memset(&blackl, 0, sizeof(T_ACI_CC_REDIAL_BLACKL)); | |
1554 resp.ctrl_response = BAT_RES_QUE_PERCENT_RDLB; | |
1555 resp.response.ptr_que_percent_rdlb = &que_rdlb_buffer; | |
1556 | |
1557 ret = (T_ACI_BAT_RSLT)qAT_PercentRDLB ((T_ACI_CMD_SRC)src_infos_psi->srcId,&blackl,&usr_notif); | |
1558 if(ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
1559 { | |
1560 for(i=0; i<blackl.blCount; i++) /* output black list */ | |
1561 { | |
1562 memset(resp.response.ptr_que_percent_rdlb->number,0,BAT_MAX_RDLB_NUMBER_LEN); | |
1563 resp.response.ptr_que_percent_rdlb->type = (UBYTE)toa_merge(blackl.blNum[i].type); | |
1564 resp.response.ptr_que_percent_rdlb->c_number = blackl.blNum[i].numb_len; | |
1565 for(j=0; j<blackl.blNum[i].numb_len; j++) | |
1566 { | |
1567 blackl.blNum[i].number[j] = (blackl.blNum[i].number[j] | 0x30); | |
1568 /* dont know why we do this ! */ | |
1569 } | |
1570 memcpy(resp.response.ptr_que_percent_rdlb->number,blackl.blNum[i].number,blackl.blNum[i].numb_len); | |
1571 aci_bat_send(src_infos_psi,&resp); | |
1572 } | |
1573 } | |
1574 return(ret); | |
1575 } | |
1576 #endif /* TI_PS_FF_AT_P_CMD_RDLB */ | |
1577 /* | |
1578 +--------------------------------------------------------------------+ | |
1579 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1580 | STATE : code ROUTINE : sBAT_PercentVTS | | |
1581 +--------------------------------------------------------------------+ | |
1582 | |
1583 PURPOSE : | |
1584 */ | |
1585 GLOBAL T_ACI_BAT_RSLT sBAT_PercentVTS (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1586 T_BAT_cmd_send *cmd) | |
1587 { | |
1588 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1589 T_BAT_dtmf dtmf; | |
1590 T_BAT_percent_vts_mode mode; | |
1591 | |
1592 TRACE_FUNCTION ("sBAT_PercentVTS()"); | |
1593 | |
1594 dtmf = cmd->params.ptr_set_percent_vts->dtmf; | |
1595 mode = cmd->params.ptr_set_percent_vts->mode; | |
1596 if (mode EQ ((T_BAT_percent_vts_mode)VTS_MOD_NotPresent)) | |
1597 { | |
1598 mode = (T_BAT_percent_vts_mode)VTS_MOD_Auto; | |
1599 } | |
1600 ret = (T_ACI_BAT_RSLT)sAT_PlusVTS((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
1601 (char)dtmf,(T_ACI_VTS_MOD)mode); | |
1602 return(ret); | |
1603 } | |
1604 | |
1605 /* | |
1606 +--------------------------------------------------------------------+ | |
1607 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1608 | STATE : code ROUTINE : sBAT_PlusCSNS | | |
1609 +--------------------------------------------------------------------+ | |
1610 | |
1611 PURPOSE : | |
1612 */ | |
1613 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCSNS (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1614 T_BAT_cmd_send *cmd) | |
1615 { | |
1616 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1617 T_BAT_plus_csns_mode mode ; | |
1618 | |
1619 TRACE_FUNCTION ("sBAT_PlusCSNS()"); | |
1620 | |
1621 mode = cmd->params.ptr_set_plus_csns->mode; | |
1622 ret = (T_ACI_BAT_RSLT)sAT_PlusCSNS ((T_ACI_CMD_SRC)src_infos_psi->srcId, (T_ACI_CSNS_MOD)mode); | |
1623 return(ret); | |
1624 } | |
1625 | |
1626 /* | |
1627 +--------------------------------------------------------------------+ | |
1628 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1629 | STATE : code ROUTINE : qBAT_PlusCSNS | | |
1630 +--------------------------------------------------------------------+ | |
1631 | |
1632 PURPOSE : | |
1633 */ | |
1634 GLOBAL T_ACI_BAT_RSLT qBAT_PlusCSNS (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1635 T_BAT_cmd_send *cmd) | |
1636 { | |
1637 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1638 T_ACI_CSNS_MOD mode = CSNS_MOD_NotPresent; | |
1639 T_BAT_cmd_response resp; | |
1640 T_BAT_res_que_plus_csns que_csns_buffer; | |
1641 | |
1642 TRACE_FUNCTION ("qBAT_PlusCSNS()"); | |
1643 | |
1644 resp.ctrl_response = BAT_RES_QUE_PLUS_CSNS; | |
1645 resp.response.ptr_que_plus_csns = &que_csns_buffer; | |
1646 | |
1647 ret = (T_ACI_BAT_RSLT)qAT_PlusCSNS ((T_ACI_CMD_SRC)src_infos_psi->srcId,&mode); | |
1648 if(ret EQ ((T_ACI_BAT_RSLT)AT_CMPL)) | |
1649 { | |
1650 resp.response.ptr_que_plus_csns->mode = (T_BAT_plus_csns_mode)mode; | |
1651 aci_bat_send(src_infos_psi,&resp); | |
1652 } | |
1653 return(ret); | |
1654 } | |
1655 | |
1656 #ifdef TI_PS_FF_AT_CMD_P_ECC | |
1657 /* | |
1658 +--------------------------------------------------------------------+ | |
1659 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1660 | STATE : code ROUTINE : sBAT_PercentECC | | |
1661 +--------------------------------------------------------------------+ | |
1662 | |
1663 PURPOSE : setting of additional ECC numbers by external applications | |
1664 */ | |
1665 GLOBAL T_ACI_BAT_RSLT sBAT_PercentECC(T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1666 T_BAT_cmd_send *cmd) | |
1667 { | |
1668 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1669 | |
1670 TRACE_FUNCTION ("sBAT_PercentECC()"); | |
1671 | |
1672 ret = (T_ACI_BAT_RSLT)sAT_PercentECC((T_ACI_CMD_SRC)src_infos_psi->srcId, | |
1673 cmd->params.ptr_set_percent_ecc->index, | |
1674 (char *)cmd->params.ptr_set_percent_ecc->number); | |
1675 return (ret); | |
1676 } | |
1677 #endif /* TI_PS_FF_AT_CMD_P_ECC */ | |
1678 /* | |
1679 +--------------------------------------------------------------------+ | |
1680 | PROJECT : GSM-F&D (8411) MODULE : ACI_BAT | | |
1681 | STATE : code ROUTINE : sBAT_PlusCHUP | | |
1682 +--------------------------------------------------------------------+ | |
1683 | |
1684 PURPOSE : +CHUP command (Hangs up call) | |
1685 */ | |
1686 GLOBAL T_ACI_BAT_RSLT sBAT_PlusCHUP (T_ACI_DTI_PRC_PSI *src_infos_psi, | |
1687 T_BAT_cmd_send *cmd) | |
1688 { | |
1689 T_ACI_BAT_RSLT ret = ACI_BAT_FAIL; | |
1690 TRACE_FUNCTION ("sBAT_PlusCHUP()"); | |
1691 ret = (T_ACI_BAT_RSLT)sAT_PlusCHUP((T_ACI_CMD_SRC)src_infos_psi->srcId); | |
1692 return(ret); | |
1693 } | |
1694 | |
1695 | |
1696 |