FreeCalypso > hg > fc-magnetite
comparison src/ui3/mfw/mfw_ss.c @ 420:e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 21 Jan 2018 03:09:00 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
419:59143cd42ec7 | 420:e8ddbb0837ed |
---|---|
1 /* | |
2 +--------------------------------------------------------------------+ | |
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_ss.c $| | |
4 | $Author:: Vo $Revision:: 1 $| | |
5 | CREATED: 25.1.99 $Modtime:: 24.03.00 9:48 $| | |
6 | STATE : code | | |
7 +--------------------------------------------------------------------+ | |
8 | |
9 MODULE : MFW_SS | |
10 | |
11 PURPOSE : This modul contains the functions for supplementary management. | |
12 | |
13 | |
14 $History:: mfw_ss.c $ | |
15 | |
16 Feb 27, 2007 ER: OMAPS00113891 x0pleela | |
17 Description:[ACI] MTC related call forwarded SS notification not differentiable on | |
18 BAT/ATI level | |
19 Solution: In function ss_cvtCssuCodes(), new enum CSSU_CODE_IncCallForwarded | |
20 from ACI is handled and typecasted to MFW_SS_MT_CALL_FORWARDED | |
21 for MMI to handle this event | |
22 | |
23 Aug 28, 2006 DR: OMAPS00083503 x0pleela | |
24 Description: Result of ss_check_ss_string may be ignored | |
25 Solution: rat_percentKSIR(): Removed the hardcoded dcs value "MFW_ASCII" | |
26 and sending ss signal E_SS_USSD_REQ or E_SS_USSD_CNF based on user | |
27 action required or not | |
28 | |
29 Jul 04, 2006 REF: OMAPS00079722 x0023848 | |
30 Description: MS displays garbage instead of appropriate user indication when network | |
31 release with problem code "unrecognized operation" or a cause "facility rejected". | |
32 Solution: Added a NULL Check for the result string of the USSD command that is being received. | |
33 | |
34 Jun 30, 2006 REF : OMAPS00083503 R.Prabakar | |
35 Description : When USSD string is sent, MMI shows requesting screen forever | |
36 Solution : Some cases in rAT_PlusCUSD weren't handled. They are handled now. | |
37 | |
38 Dec 16, 2005 REF: OMAPS00053316 x0018858 | |
39 Description: E-Sample 2.58 compiler code crashes when accessing the Voicemail service in the Messages | |
40 Solution: Added a NULL Check for the USSD pointer that is being received. | |
41 | |
42 Jul 05, 2005 REF: CRR 22565 a0876501 | |
43 Description: IMEI display on handset through atd*#06# was swapped. | |
44 Solution: Byte swapping corrected for IMEI decoding. | |
45 | |
46 Mar 30, 2005 REF: CRR 29986 xpradipg | |
47 Description: Optimisation 1: Removal of unused variables and dynamically | |
48 allocate/ deallocate mbndata | |
49 Solution: unused variables are removed | |
50 | |
51 Apr 06 2005 REF: CRR 29989 xpradipg | |
52 Description: Optimisation 3: replace the static global data with dynamic | |
53 allocation / deallocation | |
54 Solution: The static global variables are dynamically allocated and | |
55 deallocated | |
56 | |
57 Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
58 Bug:Clenup of sprintf used for tracing | |
59 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX | |
60 | |
61 Jul 15, 2004 REF: CRR 13873 xkundadu | |
62 Description: Make an incoming call, the end user pressing 0+send will | |
63 pick up the call. Instead, 0+send should reject the incoming | |
64 call. | |
65 Solution: Added the handling of 0/1/2 SEND for a waiting call. | |
66 Modified the ss_decode() function in the | |
67 mfw_ss.c file to search the sequential table in the case of | |
68 waiting call also. Made changes in mfw_cm.c file also | |
69 * | |
70 * ***************** Version 24 ***************** | |
71 * User: Vo Date: 24.03.00 Time: 10:18 | |
72 * Updated in $/GSM/Condat/MS/SRC/MFW | |
73 * Bug fix: result of IMEI | |
74 * New: notice PIN type of SS string for PIN change/PIN unblock | |
75 * | |
76 * ***************** Version 23 ***************** | |
77 * User: Vo Date: 10.01.00 Time: 16:09 | |
78 * Updated in $/GSM/Condat/MS/SRC/MFW | |
79 * new function ss_exit() | |
80 * | |
81 * ***************** Version 22 ***************** | |
82 * User: Vo Date: 10.01.00 Time: 13:32 | |
83 * Updated in $/GSM/Condat/MS/SRC/MFW | |
84 * | |
85 * ***************** Version 21 ***************** | |
86 * User: Ak Date: 10.01.00 Time: 13:14 | |
87 * Updated in $/GSM/Condat/MS/SRC/MFW | |
88 * | |
89 * ***************** Version 20 ***************** | |
90 * User: Ak Date: 21.10.99 Time: 11:56 | |
91 * Updated in $/GSM/Condat/MS/SRC/MFW | |
92 * Why: Improvement | |
93 * What: Passing of network basic service codes instead of GSM 2.30 | |
94 * codes for SS control string results and invocations | |
95 * | |
96 * ***************** Version 19 ***************** | |
97 * User: Ak Date: 29.09.99 Time: 8:37 | |
98 * Updated in $/GSM/DEV/MS/SRC/MFW | |
99 * Why: bug fix | |
100 * What: strcpy do not check a NULL pointer argument, corrected | |
101 * | |
102 * ***************** Version 18 ***************** | |
103 * User: Ak Date: 28.09.99 Time: 14:16 | |
104 * Updated in $/GSM/DEV/MS/SRC/MFW | |
105 * Why: bug fix | |
106 * What: strcpy do not check a NULL pointer argument, corrected | |
107 * | |
108 * ***************** Version 17 ***************** | |
109 * User: Es Date: 16.09.99 Time: 17:25 | |
110 * Updated in $/GSM/DEV/MS/SRC/MFW | |
111 * include SENSEI patch 13/09/99 | |
112 * two minor fixes | |
113 * | |
114 * ***************** Version 16 ***************** | |
115 * User: Vo Date: 12.09.99 Time: 14:16 | |
116 * Updated in $/GSM/DEV/MS/SRC/MFW | |
117 * New: USSD handle | |
118 * | |
119 * ***************** Version 15 ***************** | |
120 * User: Vo Date: 30.08.99 Time: 12:08 | |
121 * Updated in $/GSM/DEV/MS/SRC/MFW | |
122 * SS string for PIN unblock | |
123 * | |
124 * ***************** Version 14 ***************** | |
125 * User: Vo Date: 9.08.99 Time: 16:53 | |
126 * Updated in $/GSM/DEV/MS/SRC/MFW | |
127 * SS result from network | |
128 * present IMEI | |
129 * different handling of network password and PIN1/PIN2 password | |
130 * | |
131 * ***************** Version 13 ***************** | |
132 * User: Vo Date: 21.07.99 Time: 14:44 | |
133 * Updated in $/GSM/DEV/MS/SRC/MFW | |
134 * | |
135 * ***************** Version 12 ***************** | |
136 * User: Vo Date: 16.07.99 Time: 10:39 | |
137 * Updated in $/GSM/DEV/MS/SRC/MFW | |
138 * | |
139 * ***************** Version 11 ***************** | |
140 * User: Vo Date: 9.07.99 Time: 14:56 | |
141 * Updated in $/GSM/DEV/MS/SRC/MFW | |
142 * | |
143 * ***************** Version 1 ***************** | |
144 * User: Vo Date: 10.02.99 Time: 12:41 | |
145 * Created in $/GSM/DEV/MS/SRC/MFW | |
146 | |
147 */ | |
148 #define ENTITY_MFW | |
149 | |
150 #include <string.h> | |
151 #include <stdio.h> | |
152 #include <stdlib.h> | |
153 | |
154 #if defined (NEW_FRAME) | |
155 | |
156 #include "typedefs.h" | |
157 #include "vsi.h" | |
158 #include "custom.h" | |
159 #include "gsm.h" | |
160 | |
161 #else | |
162 | |
163 #include "STDDEFS.H" | |
164 #include "custom.h" | |
165 #include "gsm.h" | |
166 #include "vsi.h" | |
167 | |
168 #endif | |
169 | |
170 #include "message.h" | |
171 #include "prim.h" | |
172 #include "aci_cmh.h" | |
173 | |
174 #include "cus_aci.h" | |
175 #include "ksd.h" | |
176 #include "prim.h" | |
177 #ifndef PCM_2_FFS | |
178 #include "pcm.h" | |
179 #else | |
180 #include "prim.h" | |
181 #include "Gsm.h" | |
182 #endif | |
183 | |
184 | |
185 #include "psa.h" | |
186 #include "psa_sim.h" | |
187 | |
188 #include "mfw_mfw.h" | |
189 #include "mfw_nm.h" | |
190 #include "mfw_sim.h" | |
191 #include "mfw_sima.h" | |
192 #include "mfw_nmi.h" | |
193 #include "mfw_simi.h" | |
194 #include "mfw_nma.h" | |
195 #include "mfw_phb.h" | |
196 #include "mfw_cm.h" | |
197 #include "mfw_cmi.h" | |
198 #include "mfw_ss.h" | |
199 #include "mfw_ssi.h" | |
200 #include "mfw_win.h" | |
201 #include "mfw_phbi.h" | |
202 | |
203 #include <string.h> | |
204 | |
205 | |
206 /*************** Variables ******************************************/ | |
207 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
208 // remove unused variables | |
209 #ifndef FF_MMI_OPTIM | |
210 static T_MFW_SS_SUPORT ss_suport; | |
211 #endif | |
212 // Apr 06 2005 REF: CRR 29989 xpradipg | |
213 // This scope of the variable lies within a function hence it is made as local | |
214 #ifndef FF_MMI_OPTIM | |
215 static T_MFW_SS_NOTIFY notify; | |
216 #endif | |
217 | |
218 // Apr 06 2005 REF: CRR 29989 xpradipg | |
219 // The below static globals are dynamically allocated in rAT_PercentKSIR where | |
220 // the data is populated for the supplementary services response and | |
221 // deallocated once the ss_signal function is executed where in the contents | |
222 // are copied onto another variable | |
223 #ifdef FF_MMI_OPTIM | |
224 T_MFW_SS_CF_CNF *cf_cnf = NULL; | |
225 T_MFW_SS_CB_CNF *cb_cnf = NULL; | |
226 T_MFW_SS_CLI_CNF *cli_cnf = NULL; | |
227 T_MFW_SS_CW_CNF *cw_cnf = NULL; | |
228 T_MFW_SS_PW_CNF *pw_cnf = NULL; | |
229 T_MFW_IMEI *imei_info = NULL; | |
230 #else | |
231 static T_MFW_SS_CF_CNF cf_cnf; | |
232 static T_MFW_SS_CB_CNF cb_cnf; | |
233 static T_MFW_SS_CLI_CNF cli_cnf; | |
234 static T_MFW_SS_CW_CNF cw_cnf; | |
235 static T_MFW_SS_PW_CNF pw_cnf; | |
236 static T_MFW_SS_RES ss_res; | |
237 static T_MFW_IMEI imei_info; | |
238 #endif | |
239 static T_MFW_SS_USSD ussd_info; | |
240 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
241 // remove unused variables | |
242 #ifndef FF_MMI_OPTIM | |
243 static U8 clip_status; | |
244 static U8 colp_status; | |
245 static U8 clir_status; | |
246 static U8 clir_prefix; | |
247 static U8 colr_status; | |
248 #endif | |
249 static U8 clck_flag; | |
250 static U8 pwd_flag; /* 1 for change PIN */ | |
251 | |
252 | |
253 | |
254 #define CF_LST_SIZE (sizeof(T_MFW_FEATURE) *MFW_MAX_FEAT_NR) | |
255 #define CB_LST_SIZE (sizeof(T_MFW_TELECOM) *MFW_MAX_TELE_NR) | |
256 #define CW_LST_SIZE (sizeof(T_MFW_SRV_GROUP)*MFW_MAX_SRV_NR) | |
257 | |
258 #define MAX_LST_BUF (MAXIMUM(MAXIMUM(CF_LST_SIZE,\ | |
259 CB_LST_SIZE),\ | |
260 CW_LST_SIZE)) | |
261 | |
262 #define LANG_RESET "*#0" /*mc, SPR 1111 beginning of language reset pseudo-SS string*/ | |
263 #define TTY_NEXTCALL_ON "*55#" /* SPR#1352 - SH - Pseudo-SS string to switch on TTY on next call */ | |
264 #define TTY_NEXTCALL_OFF "#55#" /* SPR#1352 - SH - Pseudo-SS string to switch off TTY on next call */ | |
265 | |
266 static ULONG ssLstBuf[MAX_LST_BUF/sizeof(ULONG)]; | |
267 EXTERN MfwHdr * current_mfw_elem; | |
268 | |
269 // July 09, 2005 REF : MMI-22565 - a0876501 | |
270 extern UBYTE cmhSS_getCdFromImei (T_ACI_IMEI* imei); | |
271 | |
272 /* | |
273 +--------------------------------------------------------------------+ | |
274 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
275 | STATE : code ROUTINE: ss_mfw_init | | |
276 +--------------------------------------------------------------------+ | |
277 | |
278 | |
279 PURPOSE : | |
280 | |
281 */ | |
282 | |
283 void ss_mfw_init(void) | |
284 { | |
285 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
286 // remove reundant code since the values assigned here are never referenced | |
287 | |
288 #ifndef PCM_2_FFS | |
289 | |
290 #ifndef FF_MMI_OPTIM | |
291 EF_MSCAP mscap; | |
292 EF_MSSUP mssup; | |
293 EF_MSSET msset; | |
294 UBYTE version; | |
295 | |
296 /* Read the Mobile Capabilities from EEPROM */ | |
297 | |
298 if (pcm_ReadFile((UBYTE *)EF_MSCAP_ID, | |
299 SIZE_EF_MSCAP, | |
300 (UBYTE *)&mscap, | |
301 &version) EQ PCM_OK) | |
302 { | |
303 ss_suport.speech = (UBYTE)FldGet(mscap.chnMode,spchSupV1); | |
304 ss_suport.data = (UBYTE)FldGet(mscap.datCap1,datSup); | |
305 ss_suport.asyn = (UBYTE)FldGet(mscap.datCap1,AsySup); | |
306 ss_suport.syn = (UBYTE)FldGet(mscap.datCap1,NTSynSup); | |
307 } | |
308 | |
309 if (pcm_ReadFile((UBYTE *)EF_MSSUP_ID, | |
310 SIZE_EF_MSSUP, | |
311 (UBYTE *)&mssup, | |
312 &version) EQ PCM_OK) | |
313 { | |
314 ss_suport.aoc = (UBYTE)FldGet(mssup.feat1,AoC); | |
315 ss_suport.dtmf = (UBYTE)FldGet(mssup.feat1,DTMF); | |
316 ss_suport.cf = (UBYTE)FldGet(mssup.feat1,CF); | |
317 ss_suport.cb = (UBYTE)FldGet(mssup.feat1,CB); | |
318 ss_suport.ussd = (UBYTE)FldGet(mssup.feat1,USSD); | |
319 ss_suport.etc = (UBYTE)FldGet(mssup.feat1,ETC); | |
320 } | |
321 | |
322 if (pcm_ReadFile((UBYTE *)EF_MSSET_ID, | |
323 SIZE_EF_MSSET, | |
324 (UBYTE *)&msset, | |
325 &version) EQ PCM_OK) | |
326 { | |
327 ss_suport.clire = (UBYTE)FldGet(msset.misc,clir); | |
328 ss_suport.clipr = (UBYTE)FldGet(msset.misc,clip); | |
329 } | |
330 #endif | |
331 #endif | |
332 pwd_flag = 0; | |
333 } | |
334 | |
335 /* | |
336 +--------------------------------------------------------------------+ | |
337 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
338 | STATE : code ROUTINE: ss_exit | | |
339 +--------------------------------------------------------------------+ | |
340 | |
341 | |
342 PURPOSE : | |
343 | |
344 */ | |
345 | |
346 void ss_exit(void) | |
347 { | |
348 TRACE_FUNCTION("ss_exit()"); | |
349 } | |
350 | |
351 /* | |
352 +--------------------------------------------------------------------+ | |
353 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
354 | STATE : code ROUTINE: ss_create | | |
355 +--------------------------------------------------------------------+ | |
356 | |
357 | |
358 PURPOSE : create event for supplementary management | |
359 | |
360 */ | |
361 | |
362 T_MFW_HND ss_create(T_MFW_HND hWin, T_MFW_EVENT event, T_MFW_CB cbfunc) | |
363 { | |
364 T_MFW_HDR *hdr; | |
365 T_MFW_SS *ss_para; | |
366 MfwHdr * insert_status =0; | |
367 | |
368 TRACE_FUNCTION("ss_create()"); | |
369 | |
370 hdr = (T_MFW_HDR *) mfwAlloc(sizeof (T_MFW_HDR)); | |
371 ss_para = (T_MFW_SS *) mfwAlloc(sizeof (T_MFW_SS)); | |
372 | |
373 if (!hdr OR !ss_para) | |
374 { | |
375 TRACE_ERROR("ERROR: ss_create() Mem Alloc Failed."); | |
376 | |
377 if(hdr) | |
378 mfwFree((U8*)hdr,sizeof(MfwHdr)); | |
379 | |
380 if(ss_para) | |
381 mfwFree((U8*)ss_para,sizeof(T_MFW_SS)); | |
382 | |
383 return FALSE; | |
384 } | |
385 | |
386 /* | |
387 * initialisation of the handler | |
388 */ | |
389 ss_para->emask = event; | |
390 ss_para->handler = cbfunc; | |
391 | |
392 hdr->data = ss_para; /* store parameter in node */ | |
393 hdr->type = MFW_TYP_SS; /* store type of event handler */ | |
394 | |
395 /* | |
396 * installation of the handler | |
397 */ | |
398 insert_status = mfwInsert((T_MFW_HDR *)hWin, hdr); | |
399 | |
400 if(!insert_status) | |
401 { | |
402 TRACE_ERROR("ERROR: ss_create() Failed to Install Handler. "); | |
403 mfwFree((U8*)hdr,sizeof(MfwHdr)); | |
404 mfwFree((U8*)ss_para,sizeof(T_MFW_SS)); | |
405 return 0; | |
406 } | |
407 return insert_status; | |
408 } | |
409 | |
410 | |
411 /* | |
412 +--------------------------------------------------------------------+ | |
413 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
414 | STATE : code ROUTINE: ss_delete | | |
415 +--------------------------------------------------------------------+ | |
416 | |
417 | |
418 PURPOSE : delete a event for supplementary management | |
419 | |
420 */ | |
421 | |
422 T_MFW_RES ss_delete(T_MFW_HND h) | |
423 { | |
424 TRACE_FUNCTION("ss_delete()"); | |
425 | |
426 if (!h OR !((T_MFW_HDR *)h)->data) | |
427 return MFW_RES_ILL_HND; | |
428 | |
429 if (!mfwRemove((T_MFW_HDR *)h)) | |
430 return MFW_RES_ILL_HND; | |
431 | |
432 mfwFree((U8 *)(((T_MFW_HDR *) h)->data),sizeof(T_MFW_SS)); | |
433 mfwFree((U8 *)h,sizeof(T_MFW_HDR)); | |
434 | |
435 return MFW_RES_OK; | |
436 } | |
437 | |
438 | |
439 /* | |
440 +--------------------------------------------------------------------+ | |
441 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
442 | STATE : code ROUTINE: ss_sign_exec | | |
443 +--------------------------------------------------------------------+ | |
444 | |
445 | |
446 PURPOSE : Send a signal if SS management handler. | |
447 | |
448 */ | |
449 | |
450 BOOL ss_sign_exec (T_MFW_HDR * cur_elem, T_MFW_EVENT event, T_MFW_SS_PARA * para) | |
451 { | |
452 TRACE_FUNCTION ("ss_sign_exec()"); | |
453 | |
454 while (cur_elem) | |
455 { | |
456 /* | |
457 * event handler is available | |
458 */ | |
459 if (cur_elem->type EQ MFW_TYP_SS) | |
460 { | |
461 T_MFW_SS * ss_data; | |
462 /* | |
463 * handler is SS management handler | |
464 */ | |
465 ss_data = (T_MFW_SS *)cur_elem->data; | |
466 if (ss_data->emask & event) | |
467 { | |
468 /* | |
469 * event is expected by the call back function | |
470 */ | |
471 ss_data->event = event; | |
472 switch (event) | |
473 { | |
474 case E_SS_NOTIFY: | |
475 memcpy (&ss_data->para.notify, para, sizeof (T_MFW_SS_NOTIFY)); | |
476 break; | |
477 | |
478 case E_SS_CF_CNF: | |
479 case E_SS_CF_ICN_UPD: | |
480 memcpy (&ss_data->para.cf_cnf, para, sizeof (T_MFW_SS_CF_CNF)); | |
481 break; | |
482 | |
483 case E_SS_CB_CNF: | |
484 memcpy (&ss_data->para.cb_cnf, para, sizeof (T_MFW_SS_CB_CNF)); | |
485 break; | |
486 | |
487 case E_SS_CW_CNF: | |
488 memcpy (&ss_data->para.cw_cnf, para, sizeof (T_MFW_SS_CW_CNF)); | |
489 break; | |
490 | |
491 case E_SS_CLI_CNF: | |
492 memcpy (&ss_data->para.cli_cnf, para, sizeof (T_MFW_SS_CLI_CNF)); | |
493 break; | |
494 | |
495 case E_SS_RES: | |
496 memcpy (&ss_data->para.ss_res, para, sizeof (T_MFW_SS_RES)); | |
497 break; | |
498 | |
499 case E_SS_GET_PW: | |
500 memcpy (&ss_data->para.pw_cnf, para, sizeof (T_MFW_SS_PW_CNF)); | |
501 break; | |
502 | |
503 case E_SS_IMEI: | |
504 memcpy (&ss_data->para.imei_info, para, sizeof (T_MFW_IMEI)); | |
505 break; | |
506 | |
507 case E_SS_USSD_REQ: | |
508 memcpy (&ss_data->para.ussd_info, para, sizeof (T_MFW_SS_USSD)); | |
509 break; | |
510 | |
511 case E_SS_USSD_CNF: | |
512 memcpy (&ss_data->para.ussd_info, para, sizeof (T_MFW_SS_USSD)); | |
513 break; | |
514 } | |
515 | |
516 /* | |
517 * if call back defined, call it | |
518 */ | |
519 if (ss_data->handler) | |
520 { | |
521 // PATCH LE 06.06.00 | |
522 // store current mfw elem | |
523 current_mfw_elem = cur_elem; | |
524 // END PATCH LE 06.06.00 | |
525 | |
526 if ((*(ss_data->handler)) (ss_data->event, (void *)&ss_data->para)) | |
527 return TRUE; | |
528 } | |
529 } | |
530 } | |
531 cur_elem = cur_elem->next; | |
532 } | |
533 return FALSE; | |
534 } | |
535 | |
536 /* | |
537 +--------------------------------------------------------------------+ | |
538 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
539 | STATE : code ROUTINE: ss_signal | | |
540 +--------------------------------------------------------------------+ | |
541 | |
542 PURPOSE : send a event signal. | |
543 | |
544 */ | |
545 | |
546 void ss_signal(T_MFW_EVENT event, void * para) | |
547 { | |
548 UBYTE temp; | |
549 TRACE_FUNCTION ("ss_signal()"); | |
550 | |
551 temp = dspl_Enable(0); | |
552 if (mfwSignallingMethod EQ 0) | |
553 { | |
554 /* | |
555 * focus is on a window | |
556 */ | |
557 if (mfwFocus) | |
558 /* | |
559 * send event to sim management | |
560 * handler if available | |
561 */ | |
562 if (ss_sign_exec (mfwFocus, event, para)) | |
563 { | |
564 dspl_Enable(temp); | |
565 return; | |
566 } | |
567 | |
568 /* | |
569 * acutal focussed window is not available | |
570 * or has no network management registration | |
571 * handler, then search all nodes from the root. | |
572 */ | |
573 if (mfwRoot) | |
574 ss_sign_exec (mfwRoot, event, para); | |
575 } | |
576 else | |
577 { | |
578 MfwHdr * h = 0; | |
579 | |
580 /* | |
581 * Focus set, then start here | |
582 */ | |
583 if (mfwFocus) | |
584 h = mfwFocus; | |
585 /* | |
586 * Focus not set, then start root | |
587 */ | |
588 if (!h) | |
589 h = mfwRoot; | |
590 | |
591 /* | |
592 * No elements available, return | |
593 */ | |
594 | |
595 while (h) | |
596 | |
597 | |
598 { | |
599 /* | |
600 * Signal consumed, then return | |
601 */ | |
602 if (ss_sign_exec (h, event, para)) | |
603 { | |
604 dspl_Enable(temp); | |
605 return; | |
606 } | |
607 | |
608 /* | |
609 * All windows tried inclusive root | |
610 */ | |
611 if (h == mfwRoot) | |
612 { | |
613 dspl_Enable(temp); | |
614 return; | |
615 } | |
616 /* | |
617 * get parent window | |
618 */ | |
619 h = mfwParent(mfwParent(h)); | |
620 if(h) | |
621 h = ((MfwWin * )(h->data))->elems; | |
622 } | |
623 ss_sign_exec (mfwRoot, event, para); | |
624 } | |
625 dspl_Enable(temp); | |
626 } | |
627 | |
628 | |
629 | |
630 /* | |
631 +--------------------------------------------------------------------+ | |
632 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
633 | STATE : code ROUTINE: ss_check_ss_string | | |
634 +--------------------------------------------------------------------+ | |
635 | |
636 | |
637 PURPOSE : Check SS string | |
638 | |
639 */ | |
640 | |
641 T_MFW_SS_RETURN ss_check_ss_string(UBYTE *string) | |
642 { | |
643 T_MFW_SS_RETURN ss_group; | |
644 T_KSD_SEQGRP grp; | |
645 CHAR *rest; | |
646 T_KSD_SEQPARAM para; | |
647 SHORT id; | |
648 int string_length; | |
649 UBYTE call_active=FALSE; | |
650 | |
651 TRACE_FUNCTION("ss_check_ss_string"); | |
652 | |
653 #define MFW_MAX_DIAL_SHORT_STRING_LEN 2 | |
654 | |
655 /* check the type of destination address */ | |
656 if ((cm_search_callId(CAL_STAT_Held, &id) == CM_OK) | |
657 OR (cm_search_callId(CAL_STAT_Active, &id) == CM_OK)) | |
658 { | |
659 call_active = TRUE; | |
660 ksd_decode((CHAR *)string, TRUE, &grp, &rest, ¶); | |
661 } | |
662 else | |
663 ksd_decode((CHAR *)string, FALSE, &grp, &rest, ¶); | |
664 | |
665 /* check short string */ | |
666 | |
667 string_length = strlen((char*)string); | |
668 | |
669 TRACE_EVENT_P2("ksd_decode(""%s"") returns -> %d",(char*)string,grp); | |
670 | |
671 | |
672 switch (grp) | |
673 { | |
674 case (SEQGRP_DIAL): /*JVJ CQ 6242 */ | |
675 if (string_length<=MFW_MAX_DIAL_SHORT_STRING_LEN) | |
676 { | |
677 /* If the call is active, the short string will be USSD in all the cases not described in ETSI 2.30*/ | |
678 if (call_active) | |
679 grp = SEQGRP_USSD; | |
680 /* If the call is not active, the short strings 1x will be DIAL, the rest USSD*/ | |
681 else if ((string_length EQ 1)||(*(string) NEQ '1')) | |
682 grp = SEQGRP_USSD; | |
683 } | |
684 break; | |
685 case (SEQGRP_SUP_CLIR): /* JGG/JVJ - CQ 6537 */ | |
686 case (SEQGRP_INV_CLIR): | |
687 if (strlen(rest)!=0) | |
688 { | |
689 T_MFW_SS_RETURN rest_ss_group; | |
690 | |
691 /*check to make sure that the number is a real dial string */ | |
692 rest_ss_group = ss_check_ss_string((UBYTE*)rest); | |
693 if (rest_ss_group EQ MFW_SS_DIAL) /*If rest is a dial string, then the whole string is dial */ | |
694 ss_group = MFW_SS_DIAL; | |
695 else | |
696 ss_group = MFW_SS_UNKNOWN; | |
697 | |
698 TRACE_EVENT_P2("ss_check_ss_string(""%s"") returns -> %d",(char*)string,ss_group); | |
699 return ss_group; | |
700 } | |
701 break; | |
702 default: | |
703 break; | |
704 } | |
705 | |
706 ss_group = ss_check_group(grp, para); | |
707 | |
708 TRACE_EVENT_P2("ss_check_ss_string(""%s"") returns -> %d",(char*)string,ss_group); | |
709 | |
710 return ss_group; | |
711 } | |
712 | |
713 | |
714 /* | |
715 +--------------------------------------------------------------------+ | |
716 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
717 | STATE : code ROUTINE: ss_decode | | |
718 +--------------------------------------------------------------------+ | |
719 | |
720 | |
721 PURPOSE : Decode SS string | |
722 | |
723 */ | |
724 | |
725 T_MFW_SS_RETURN ss_decode(UBYTE *string, CHAR **rt, T_KSD_SEQPARAM *p) | |
726 { | |
727 T_KSD_SEQGRP grp; | |
728 CHAR *rest; | |
729 T_KSD_SEQPARAM para; | |
730 SHORT id; | |
731 BOOL bRetVal; | |
732 | |
733 TRACE_FUNCTION("ss_decode()"); | |
734 | |
735 // Added the checking of wait call to solve the bug MMI-SPR 13873. | |
736 // If the call is a waiting also pass TRUE as the second parameter to the | |
737 // function ksd_decode() to decode the entered number. In ksd_decode only if | |
738 // the second parameter is TRUE the sequential table is searched to find out | |
739 // the group where the user entered string belongs to. | |
740 if ((cm_search_callId(CAL_STAT_Held, &id) == CM_OK) | |
741 OR (cm_search_callId(CAL_STAT_Active, &id) == CM_OK) | |
742 OR (cm_search_callId(CAL_STAT_Wait, &id) == CM_OK)) | |
743 { | |
744 bRetVal = ksd_decode((CHAR *)string, TRUE, &grp, &rest, ¶); | |
745 if (!bRetVal) | |
746 *rest = 0; | |
747 } | |
748 else | |
749 { | |
750 bRetVal = ksd_decode((CHAR *)string, FALSE, &grp, &rest, ¶); | |
751 if (!bRetVal) | |
752 *rest = 0; | |
753 } | |
754 | |
755 if (!bRetVal) | |
756 return MFW_SS_FAIL; | |
757 | |
758 *rt = rest; | |
759 | |
760 if (grp == SEQGRP_UNKNOWN) | |
761 return MFW_SS_UNKNOWN; | |
762 | |
763 memcpy(p, ¶, sizeof(T_KSD_SEQPARAM)); | |
764 return(ss_check_group(grp, para)); | |
765 } | |
766 | |
767 | |
768 | |
769 /* | |
770 +--------------------------------------------------------------------+ | |
771 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
772 | STATE : code ROUTINE: ss_check_group | | |
773 +--------------------------------------------------------------------+ | |
774 | |
775 | |
776 PURPOSE : returns the group of SS string | |
777 | |
778 */ | |
779 | |
780 T_MFW_SS_RETURN ss_check_group(T_KSD_SEQGRP grp, T_KSD_SEQPARAM para) | |
781 { | |
782 TRACE_EVENT_P1("ss_check_group: grp=%d", grp); | |
783 | |
784 switch (grp) | |
785 { | |
786 case SEQGRP_DIAL: | |
787 /*SPR#1352 - SH - Check for TTY On Next Call psuedo-ss strings*/ | |
788 if (!strncmp((char*)para.ussd.ussd, TTY_NEXTCALL_ON, strlen(TTY_NEXTCALL_ON))) | |
789 return MFW_SS_TTY_NEXTCALL_ON; | |
790 if (!strncmp((char*)para.ussd.ussd, TTY_NEXTCALL_OFF, strlen(TTY_NEXTCALL_OFF))) | |
791 return MFW_SS_TTY_NEXTCALL_OFF; | |
792 /*SH end*/ | |
793 return MFW_SS_DIAL; | |
794 | |
795 case SEQGRP_DIAL_IDX: | |
796 return MFW_SS_DIAL_IDX; | |
797 | |
798 case SEQGRP_DTMF: | |
799 return MFW_SS_DTMF; | |
800 | |
801 case SEQGRP_USSD: | |
802 /*MC, SPR 1111 check for LANGUAGE reset code*/ | |
803 | |
804 if (!strncmp((char*)para.ussd.ussd, LANG_RESET, strlen(LANG_RESET)) && para.ussd.ussd[6]=='#') | |
805 return MFW_SS_LANG_RESET; | |
806 /*MC end*/ | |
807 return MFW_SS_USSD; | |
808 | |
809 case SEQGRP_ACT_SIM_LOCK: /* lock SIM card */ | |
810 case SEQGRP_DEACT_SIM_LOCK: /* unlock SIM card */ | |
811 case SEQGRP_INTRGT_SIM_LOCK: | |
812 return MFW_SS_SIM_LOCK; | |
813 | |
814 case SEQGRP_CHANGE_REGISTER: | |
815 case SEQGRP_SET_REGISTER: | |
816 case SEQGRP_START_REGISTER: | |
817 return MFW_SS_REG_PW; | |
818 | |
819 case SEQGRP_CF: | |
820 return MFW_SS_CF; | |
821 | |
822 case SEQGRP_CB: /* barring services */ | |
823 return MFW_SS_CB; | |
824 | |
825 case SEQGRP_SUP_CLIR: | |
826 case SEQGRP_INV_CLIR: | |
827 return MFW_SS_CLIR; | |
828 | |
829 case SEQGRP_SUP_CLIP: | |
830 case SEQGRP_INV_CLIP: | |
831 return MFW_SS_CLIP; | |
832 | |
833 case SEQGRP_SUP_COLR: | |
834 case SEQGRP_INV_COLR: | |
835 return MFW_SS_COLR; | |
836 | |
837 case SEQGRP_SUP_COLP: | |
838 case SEQGRP_INV_COLP: | |
839 return MFW_SS_COLP; | |
840 | |
841 case SEQGRP_CL: | |
842 switch (para.cl.ssCd) | |
843 { | |
844 case KSD_SS_CLIP: | |
845 return MFW_SS_CLIP; | |
846 case KSD_SS_CLIR: | |
847 return MFW_SS_CLIR; | |
848 case KSD_SS_COLP: | |
849 return MFW_SS_COLP; | |
850 case KSD_SS_COLR: | |
851 return MFW_SS_COLR; | |
852 } | |
853 return MFW_SS_UNKNOWN; | |
854 | |
855 case SEQGRP_PWD: | |
856 switch(para.pwd.ssCd) | |
857 { | |
858 /* case KSD_SS_CCBS: CCBS has nothing to do with PWD! */ | |
859 case KSD_SS_ALL_CBSS: | |
860 case KSD_SS_BOC: | |
861 case KSD_SS_BAOC: | |
862 case KSD_SS_BOIC: | |
863 case KSD_SS_BOICXH: | |
864 case KSD_SS_BIC: | |
865 case KSD_SS_BAIC: | |
866 case KSD_SS_BICRM: | |
867 | |
868 /*NM 190602*/ | |
869 case KSD_SS_ALL_SERV: | |
870 | |
871 return MFW_SS_REG_PW; | |
872 | |
873 case KSD_SS_PIN1: | |
874 case KSD_SS_PIN2: | |
875 return MFW_SS_SIM_REG_PW; | |
876 } | |
877 return MFW_SS_UNKNOWN; | |
878 | |
879 case SEQGRP_UBLK: | |
880 return MFW_SS_SIM_UNBLCK_PIN; | |
881 | |
882 case SEQGRP_CW: | |
883 return MFW_SS_WAIT; | |
884 | |
885 case SEQGRP_CCBS: | |
886 return MFW_SS_CCBS; | |
887 | |
888 case SEQGRP_PRSNT_IMEI: | |
889 return MFW_SS_MMI; | |
890 | |
891 case SEQGRP_CHLD: | |
892 /*MC 11.04.02 */ | |
893 if (para.chld.mode == CHLD_MOD_Ect) | |
894 return MFW_SS_ECT; | |
895 else if (para.chld.mode == CHLD_MOD_Ccbs) | |
896 return MFW_SS_CCBS; | |
897 else | |
898 /*MC*/ | |
899 return MFW_SS_HOLD; | |
900 | |
901 case SEQGRP_UNKNOWN: | |
902 return MFW_SS_UNKNOWN; | |
903 | |
904 default: | |
905 return MFW_SS_UNKNOWN; | |
906 } | |
907 } | |
908 | |
909 /* | |
910 +-------------------------------------------------------------------+ | |
911 | PROJECT : MMI-Framework (8417) MODULE : MFW_SS | | |
912 | STATE : code ROUTINE : ss_execute_transaction | | |
913 +-------------------------------------------------------------------+ | |
914 | |
915 PURPOSE : Start a SS transaction | |
916 | |
917 */ | |
918 | |
919 T_MFW_SS_RETURN ss_execute_transaction(UBYTE *ss_string, | |
920 UBYTE ussd_mand) | |
921 { | |
922 T_ACI_RETURN res; | |
923 | |
924 TRACE_FUNCTION("ss_execute_transaction()"); | |
925 | |
926 res = sAT_Dn(CMD_SRC_LCL, (CHAR *)ss_string, D_CLIR_OVRD_Default, D_CUG_CTRL_NotPresent, D_TOC_Data); /*a0393213 compiler warnings removal - enum constants are used instead of int in parameters*/ | |
927 if( (res != AT_EXCT) AND (res != AT_CMPL)) | |
928 { | |
929 TRACE_EVENT("sAT_D error"); | |
930 return MFW_SS_FAIL; | |
931 } | |
932 | |
933 return ss_check_ss_string(ss_string); | |
934 } | |
935 | |
936 | |
937 /* | |
938 +--------------------------------------------------------------------+ | |
939 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
940 | STATE : code ROUTINE: ss_cvtCssuCodes | | |
941 +--------------------------------------------------------------------+ | |
942 | |
943 | |
944 PURPOSE : This function is used to convert the CSSU mode | |
945 used by ACI to the CSSU mode used by MFW. | |
946 | |
947 */ | |
948 | |
949 T_MFW_SS_NOTIFY_CODES ss_cvtCssuCodes(T_ACI_CSSU_CODE code) | |
950 { | |
951 switch (code) | |
952 { | |
953 case CSSU_CODE_ForwardedCall: return MFW_SS_MT_FORWARDED; | |
954 case CSSU_CODE_CUGCall: return MFW_SS_MT_CUG_CALL; | |
955 case CSSU_CODE_Multiparty: return MFW_SS_NOTIFY_MULTIPARTY; | |
956 case CSSU_CODE_HeldCallRel: return MFW_SS_NOTIFY_holdRELEASED; | |
957 case CSSU_CODE_FwrdCheckSS: return MFW_SS_NOTIFY_checkSS; | |
958 case CSSU_CODE_ECTAlert: return MFW_SS_NOTIFY_ectALERT; | |
959 case CSSU_CODE_ECTConnect: return MFW_SS_NOTIFY_ectCONNECT; | |
960 case CSSU_CODE_DeflectedCall: return MFW_SS_MT_DEFLECTED; | |
961 //x0pleela 22 Feb, 2007 ER: OMAPS00113891 | |
962 /* Adding the following new enum to differentiate the indications b/n the | |
963 subscriber who forwarded the call (CSSU_CODE_IncCallForwarded) and | |
964 to whom the call was forwarded(CSSU_CODE_ForwardedCall) */ | |
965 case CSSU_CODE_IncCallForwarded: return MFW_SS_MT_CALL_FORWARDED; | |
966 default: return MFW_SS_NOTIFY_UNKNOWN; | |
967 } | |
968 } | |
969 | |
970 | |
971 /* | |
972 +--------------------------------------------------------------------+ | |
973 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
974 | STATE : code ROUTINE: ss_cvtCssiCodes | | |
975 +--------------------------------------------------------------------+ | |
976 | |
977 | |
978 PURPOSE : This function is used to convert the CSSI mode | |
979 used by ACI to the CSSI mode used by MFW. | |
980 | |
981 */ | |
982 | |
983 T_MFW_SS_NOTIFY_CODES ss_cvtCssiCodes(T_ACI_CSSI_CODE code) | |
984 { | |
985 switch (code) | |
986 { | |
987 case CSSI_CODE_CFUActive: return MFW_SS_MO_unconFORWARD; | |
988 case CSSI_CODE_SomeCCFActive: return MFW_SS_MO_conFORWARD; | |
989 case CSSI_CODE_ForwardedCall: return MFW_SS_MO_FORWARDED; | |
990 case CSSI_CODE_CallWaiting: return MFW_SS_MO_WAITING; | |
991 case CSSI_CODE_CUGCall: return MFW_SS_MO_CUG_CALL; | |
992 case CSSI_CODE_OutCallsBarred: return MFW_SS_MO_moBARRED; | |
993 case CSSI_CODE_IncCallsBarred: return MFW_SS_MO_mtBARRED; | |
994 case CSSI_CODE_CLIRSupRej: return MFW_SS_MO_CLIR; | |
995 case CSSI_CODE_DeflectedCall: return MFW_SS_MO_DEFLECTED; | |
996 default: return MFW_SS_NOTIFY_UNKNOWN; | |
997 } | |
998 } | |
999 | |
1000 | |
1001 /* | |
1002 +--------------------------------------------------------------------+ | |
1003 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
1004 | STATE : code ROUTINE: ss_notify | | |
1005 +--------------------------------------------------------------------+ | |
1006 | |
1007 | |
1008 PURPOSE : Change of SS status from the network. | |
1009 | |
1010 */ | |
1011 | |
1012 void ss_notify(T_MFW_SS_NOTIFY_CODES code, | |
1013 SHORT index, | |
1014 UBYTE *number, | |
1015 UBYTE *subaddr) | |
1016 { | |
1017 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1018 // defined the variable locally since the scope lies within this function | |
1019 #ifdef FF_MMI_OPTIM | |
1020 T_MFW_SS_NOTIFY notify; | |
1021 #endif | |
1022 memset(¬ify, 0, sizeof(T_MFW_SS_NOTIFY)); | |
1023 | |
1024 notify.code = code; | |
1025 | |
1026 if(number) | |
1027 strcpy((char *)notify.number, (char *)number); | |
1028 if (subaddr) | |
1029 strcpy((char *)notify.subaddr, (char *)subaddr); | |
1030 | |
1031 //PATCH TB 1309: Wrong codes tested | |
1032 if ((code == MFW_SS_MO_CUG_CALL) OR | |
1033 (code == MFW_SS_MT_CUG_CALL)) | |
1034 notify.index = (UBYTE)index; | |
1035 /* END PATCH TB */ | |
1036 | |
1037 { | |
1038 /***************************Go-lite Optimization changes Start***********************/ | |
1039 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
1040 TRACE_EVENT_P1 ("SS notify code = %d", notify.code); | |
1041 /***************************Go-lite Optimization changes end***********************/ | |
1042 } | |
1043 | |
1044 ss_signal(E_SS_NOTIFY, ¬ify); | |
1045 } | |
1046 | |
1047 | |
1048 /* | |
1049 +--------------------------------------------------------------------+ | |
1050 | PROJECT: MMI-Framework (8417) MODULE : MFW_SS | | |
1051 | STATE : code ROUTINE : ss_cvtOCode | | |
1052 +--------------------------------------------------------------------+ | |
1053 | |
1054 | |
1055 PURPOSE : Convert operation codes | |
1056 | |
1057 */ | |
1058 | |
1059 T_MFW ss_cvtOCode(T_ACI_KSD_OP code) | |
1060 { | |
1061 switch (code) | |
1062 { | |
1063 case KSD_OP_IRGT: return SS_INTERROGATION; | |
1064 case KSD_OP_REG: return SS_REGISTRATION; | |
1065 case KSD_OP_ERS: return SS_ERASURE; | |
1066 case KSD_OP_ACT: return SS_ACTIVATION; | |
1067 case KSD_OP_DEACT: return SS_DEACTIVATION; | |
1068 default: return SS_CODES_UNKNOWN; | |
1069 } | |
1070 } | |
1071 | |
1072 | |
1073 /* | |
1074 +--------------------------------------------------------------------+ | |
1075 | PROJECT: MMI-Framework (8417) MODULE : MFW_SS | | |
1076 | STATE : code ROUTINE : ss_cvtSCodes | | |
1077 +--------------------------------------------------------------------+ | |
1078 | |
1079 | |
1080 PURPOSE : This function is used to convert the SS code | |
1081 used by ACI to the SS code used by MFW. | |
1082 | |
1083 */ | |
1084 | |
1085 T_MFW ss_cvtSCode(T_ACI_KSD_SS code) | |
1086 { | |
1087 switch (code) | |
1088 { | |
1089 case KSD_SS_CLIP: return SS_CLIP; | |
1090 case KSD_SS_CLIR: return SS_CLIR; | |
1091 case KSD_SS_COLP: return SS_COLP; | |
1092 case KSD_SS_COLR: return SS_COLR; | |
1093 case KSD_SS_CW: return SS_CW; | |
1094 case KSD_SS_BAIC: return SS_CB_BAIC; | |
1095 case KSD_SS_BAOC: return SS_CB_BAOC; | |
1096 case KSD_SS_ALL_CBSS: return SS_CB_ALL; | |
1097 case KSD_SS_BICRM: return SS_CB_BAICroam; | |
1098 case KSD_SS_BIC: return SS_CB_ALL_BAIC; | |
1099 case KSD_SS_BOICXH: return SS_CB_BAOICexH; | |
1100 case KSD_SS_BOIC: return SS_CB_BAOIC; | |
1101 case KSD_SS_BOC: return SS_CB_ALL_BAOC; | |
1102 case KSD_SS_CFB: return SS_CF_CFB; | |
1103 case KSD_SS_CFNRC: return SS_CF_CFNR; | |
1104 case KSD_SS_CFNRY: return SS_CF_CFNRy; | |
1105 case KSD_SS_CFU: return SS_CF_CFU; | |
1106 case KSD_SS_ALL_CFWSS: return SS_CF_ALL_COND; | |
1107 case KSD_SS_ALL_FWSS: return SS_CF_ALL; | |
1108 case KSD_SS_CCBS: return SS_CCBS; | |
1109 case KSD_SS_PIN1: return SS_PIN1; | |
1110 case KSD_SS_PIN2: return SS_PIN2; | |
1111 default: return SS_CODES_UNKNOWN; | |
1112 } | |
1113 } | |
1114 | |
1115 | |
1116 /* | |
1117 +--------------------------------------------------------------------+ | |
1118 | PROJECT: MMI-Framework (8417) MODULE : MFW_SS | | |
1119 | STATE : code ROUTINE : ss_cvtCLStatus | | |
1120 +--------------------------------------------------------------------+ | |
1121 | |
1122 | |
1123 PURPOSE : This function is used to convert the CL status | |
1124 used by ACI to the CL status used by MFW. | |
1125 | |
1126 */ | |
1127 | |
1128 T_MFW ss_cvtCLStatus(T_ACI_KSD_CLIR_OP stat) | |
1129 { | |
1130 switch (stat) | |
1131 { | |
1132 case KSD_CO_PERMANENT: return MFW_CL_PERM; | |
1133 case KSD_CO_TEMPORARY: return MFW_CL_TEMP_DEF_REST; | |
1134 case KSD_CO_ALLOWED: return MFW_CL_TEMP_DEF_ALLOWED; | |
1135 default: return MFW_CL_UNKNOWN; | |
1136 } | |
1137 } | |
1138 | |
1139 /* | |
1140 +--------------------------------------------------------------------+ | |
1141 | PROJECT: MMI-Framework (8417) MODULE : MFW_SS | | |
1142 | STATE : code ROUTINE : ss_cvtCLOvrd | | |
1143 +--------------------------------------------------------------------+ | |
1144 | |
1145 | |
1146 PURPOSE : This function is used to convert the override status of | |
1147 CLIR used by ACI to the override status of CLIR used by | |
1148 MFW. | |
1149 | |
1150 */ | |
1151 | |
1152 T_MFW ss_cvtCLOvrd(T_ACI_KSD_OVRD_CTG ovrd) | |
1153 { | |
1154 switch (ovrd) | |
1155 { | |
1156 case KSD_OVR_CAT_ENABLED: return MFW_OV_ENABLED; | |
1157 case KSD_OVR_CAT_DISABLED: return MFW_OV_DISABLED; | |
1158 default: return MFW_OV_UNKNOWN; | |
1159 } | |
1160 } | |
1161 | |
1162 /* | |
1163 +--------------------------------------------------------------------+ | |
1164 | PROJECT: MMI-Framework (8417) MODULE : MFW_SS | | |
1165 | STATE : code ROUTINE : ss_cvtErrCode | | |
1166 +--------------------------------------------------------------------+ | |
1167 | |
1168 | |
1169 PURPOSE : This function is used to convert the error code used | |
1170 by ACI to the error code used by MFW. | |
1171 | |
1172 */ | |
1173 | |
1174 T_MFW ss_cvtErrCode(T_ACI_KSD_ERR err) | |
1175 { | |
1176 switch (err) | |
1177 { | |
1178 case KSD_NO_ERROR: return MFW_SS_NO_ERROR; | |
1179 case KSD_ERR_UNKNOWN_SUBSCRIBER: return MFW_SS_ERR_UNKNOWN_SUBSCRIBER; | |
1180 case KSD_ERR_ILLEGAL_SUBSCRIBER: return MFW_SS_ERR_ILLEGAL_SUBSCRIBER; | |
1181 case KSD_ERR_BEARER_SVC_NOT_PROV: return MFW_SS_ERR_BEARER_SVC_NOT_PROV; | |
1182 case KSD_ERR_TELE_SVC_NOT_PROV: return MFW_SS_ERR_TELE_SVC_NOT_PROV; | |
1183 case KSD_ERR_ILLEGAL_EQUIPMENT: return MFW_SS_ERR_ILLEGAL_EQUIPMENT; | |
1184 case KSD_ERR_CALL_BARRED: return MFW_SS_ERR_CALL_BARRED; | |
1185 case KSD_ERR_ILLEGAL_SS_OPERATION: return MFW_SS_ERR_ILLEGAL_SS_OPERATION; | |
1186 case KSD_ERR_SS_ERR_STATUS: return MFW_SS_ERR_SS_ERR_STATUS; | |
1187 case KSD_ERR_SS_NOT_AVAIL: return MFW_SS_ERR_SS_NOT_AVAIL; | |
1188 case KSD_ERR_SS_SUBS_VIOLATION: return MFW_SS_ERR_SS_SUBS_VIOLATION; | |
1189 case KSD_ERR_SS_INCOMP: return MFW_SS_ERR_SS_INCOMP; | |
1190 case KSD_ERR_FAC_NOT_SUPPORTED: return MFW_SS_ERR_FAC_NOT_SUPPORTED; | |
1191 case KSD_ERR_ABSENT_SUBS: return MFW_SS_ERR_ABSENT_SUBS; | |
1192 case KSD_ERR_SYSTEM_FAIL: return MFW_SS_ERR_SYSTEM_FAIL; | |
1193 case KSD_ERR_DATA_MISSING: return MFW_SS_ERR_DATA_MISSING; | |
1194 case KSD_ERR_UNEXPECT_DATA: return MFW_SS_ERR_UNEXPECT_DATA; | |
1195 case KSD_ERR_PWD_REG_FAIL: return MFW_SS_ERR_PWD_REG_FAIL; | |
1196 case KSD_ERR_NEG_PWD_CHECK: return MFW_SS_ERR_NEG_PWD_CHECK; | |
1197 case KSD_ERR_NUM_PWD_VIOLATION: return MFW_SS_ERR_NUM_PWD_VIOLATION; | |
1198 case KSD_ERR_UNKNOWN_ALPHA: return MFW_SS_ERR_UNKNOWN_ALPHA; | |
1199 case KSD_ERR_USSD_BUSY: return MFW_SS_ERR_USSD_BUSY; | |
1200 case KSD_ERR_MAX_NUM_MPTY_EXCEED: return MFW_SS_ERR_MAX_NUM_MPTY_EXCEED; | |
1201 case KSD_ERR_RESOURCE_NOT_AVAIL: return MFW_SS_ERR_RESOURCE_NOT_AVAIL; | |
1202 case KSD_GEN_PROB_UNRECOG_CMP: return MFW_SS_GEN_PROB_UNRECOG_CMP; | |
1203 case KSD_GEN_PROB_MISTYPED_CMP: return MFW_SS_GEN_PROB_MISTYPED_CMP; | |
1204 case KSD_GEN_PROB_BAD_STRUCT_CMP: return MFW_SS_GEN_PROB_BAD_STRUCT_CMP; | |
1205 case KSD_INV_PROB_DUPL_INV_ID: return MFW_SS_INV_PROB_DUPL_INV_ID; | |
1206 case KSD_INV_PROB_UNRECOG_OP: return MFW_SS_INV_PROB_UNRECOG_OP; | |
1207 case KSD_INV_PROB_MISTYPED_PAR: return MFW_SS_INV_PROB_MISTYPED_PAR; | |
1208 case KSD_INV_PROB_RESOURCE_LIM: return MFW_SS_INV_PROB_RESOURCE_LIM; | |
1209 case KSD_INV_PROB_INIT_RELEASE: return MFW_SS_INV_PROB_INIT_RELEASE; | |
1210 case KSD_INV_PROB_UNRECOG_LNK_ID: return MFW_SS_INV_PROB_UNRECOG_LNK_ID; | |
1211 case KSD_INV_PROB_LNK_RES_UNEXP: return MFW_SS_INV_PROB_LNK_RES_UNEXP; | |
1212 case KSD_INV_PROB_UNEXP_LNK_OP: return MFW_SS_INV_PROB_UNEXP_LNK_OP; | |
1213 case KSD_RES_PROB_UNRECOG_INV_ID: return MFW_SS_RES_PROB_UNRECOG_INV_ID; | |
1214 case KSD_RES_PROB_RET_RES_UNEXP: return MFW_SS_RES_PROB_RET_RES_UNEXP; | |
1215 case KSD_RES_PROB_MISTYPED_PAR: return MFW_SS_RES_PROB_MISTYPED_PAR; | |
1216 case KSD_ERR_PROB_UNRECOG_INV_ID: return MFW_SS_ERR_PROB_UNRECOG_INV_ID; | |
1217 case KSD_ERR_PROB_RET_ERR_UNEXP: return MFW_SS_ERR_PROB_RET_ERR_UNEXP; | |
1218 case KSD_ERR_PROB_UNRECOG_ERR: return MFW_SS_ERR_PROB_UNRECOG_ERR; | |
1219 case KSD_ERR_PROB_UNEXP_ERR: return MFW_SS_ERR_PROB_UNEXP_ERR; | |
1220 case KSD_ERR_PROB_MISTYPED_PAR: return MFW_SS_ERR_PROB_MISTYPED_PAR; | |
1221 case KSD_ERR_FATAL_INV_RESULT: return MFW_SS_ERR_FATAL_INV_RESULT; | |
1222 case KSD_ERR_FATAL_CCD_DEC: return MFW_SS_ERR_FATAL_CCD_DEC; | |
1223 case KSD_ERR_FATAL_SS_ENT: return MFW_SS_ERR_FATAL_SS_ENT; | |
1224 default: return MFW_SS_ERR_UNKNOWN; | |
1225 } | |
1226 } | |
1227 | |
1228 | |
1229 /* | |
1230 +--------------------------------------------------------------------+ | |
1231 | PROJECT: MMI-Framework (8417) MODULE : MFW_SS | | |
1232 | STATE : code ROUTINE : ss_decode_imei | | |
1233 +--------------------------------------------------------------------+ | |
1234 | |
1235 | |
1236 PURPOSE : convert imei (packed bcd to ASCII) | |
1237 | |
1238 */ | |
1239 | |
1240 void ss_decode_imei(T_ACI_KSIR *ksStat) | |
1241 { | |
1242 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1243 #ifdef FF_MMI_OPTIM | |
1244 memset(imei_info, 0, sizeof(T_MFW_IMEI)); | |
1245 | |
1246 #ifdef NEPTUNE_BOARD /* OMAPS00059546 : BCD conversion has been Added for NEPTUNE Board */ | |
1247 | |
1248 imei_info.imei_number[0] = ( ksStat->ir.rKSIMEI.tac1 ) & 0x0F | 0x30; | |
1249 imei_info.imei_number[1] = ( ksStat->ir.rKSIMEI.tac1 & 0xF0 ) >> 4 | 0x30; | |
1250 imei_info.imei_number[2] = ( ksStat->ir.rKSIMEI.tac2 ) & 0x0F | 0x30; | |
1251 imei_info.imei_number[3] = ( ksStat->ir.rKSIMEI.tac2 & 0xF0 ) >> 4 | 0x30; | |
1252 imei_info.imei_number[4] = ( ksStat->ir.rKSIMEI.tac3 ) & 0x0F | 0x30; | |
1253 imei_info.imei_number[5] = ( ksStat->ir.rKSIMEI.tac3 & 0xF0 ) >> 4 | 0x30; | |
1254 imei_info.imei_number[6] = ( ksStat->ir.rKSIMEI.fac ) & 0x0F | 0x30; | |
1255 imei_info.imei_number[7] = ( ksStat->ir.rKSIMEI.fac & 0xF0 ) >> 4 | 0x30; | |
1256 imei_info.imei_number[8] = ( ksStat->ir.rKSIMEI.snr1 ) & 0x0F | 0x30; | |
1257 imei_info.imei_number[9] = ( ksStat->ir.rKSIMEI.snr1 & 0xF0 ) >> 4 | 0x30; | |
1258 imei_info.imei_number[10] = ( ksStat->ir.rKSIMEI.snr2 ) & 0x0F | 0x30; | |
1259 imei_info.imei_number[11] = ( ksStat->ir.rKSIMEI.snr2 & 0xF0 ) >> 4 | 0x30; | |
1260 imei_info.imei_number[12] = ( ksStat->ir.rKSIMEI.snr3 ) & 0x0F | 0x30; | |
1261 imei_info.imei_number[13] = ( ksStat->ir.rKSIMEI.snr3 & 0xF0 ) >> 4 | 0x30; | |
1262 imei_info.imei_number[14] = ( ksStat->ir.rKSIMEI.cd & 0x0F ) | 0x30; | |
1263 imei_info.imei_number[15] = ( ksStat->ir.rKSIMEI.svn ) & 0x0F | 0x30; | |
1264 imei_info.imei_number[16] = ( ksStat->ir.rKSIMEI.svn & 0xF0 ) >> 4 | 0x30; | |
1265 imei_info.imei_number[17] = '\0'; | |
1266 | |
1267 #else | |
1268 imei_info->imei_number[0] = ( ksStat->ir.rKSIMEI.tac1 & 0xF0 ) >> 4 | 0x30; | |
1269 imei_info->imei_number[1] = ( ksStat->ir.rKSIMEI.tac1 ) & 0x0F | 0x30; | |
1270 imei_info->imei_number[2] = ( ksStat->ir.rKSIMEI.tac2 & 0xF0 ) >> 4 | 0x30; | |
1271 imei_info->imei_number[3] = ( ksStat->ir.rKSIMEI.tac2 ) & 0x0F | 0x30; | |
1272 imei_info->imei_number[4] = ( ksStat->ir.rKSIMEI.tac3 & 0xF0 ) >> 4 | 0x30; | |
1273 imei_info->imei_number[5] = ( ksStat->ir.rKSIMEI.tac3 ) & 0x0F | 0x30; | |
1274 imei_info->imei_number[6] = ( ksStat->ir.rKSIMEI.fac & 0xF0 ) >> 4 | 0x30; | |
1275 imei_info->imei_number[7] = ( ksStat->ir.rKSIMEI.fac ) & 0x0F | 0x30; | |
1276 imei_info->imei_number[8] = ( ksStat->ir.rKSIMEI.snr1 & 0xF0 ) >> 4 | 0x30; | |
1277 imei_info->imei_number[9] = ( ksStat->ir.rKSIMEI.snr1 ) & 0x0F | 0x30; | |
1278 imei_info->imei_number[10] = ( ksStat->ir.rKSIMEI.snr2 & 0xF0 ) >> 4 | 0x30; | |
1279 imei_info->imei_number[11] = ( ksStat->ir.rKSIMEI.snr2 ) & 0x0F | 0x30; | |
1280 imei_info->imei_number[12] = ( ksStat->ir.rKSIMEI.snr3 & 0xF0 ) >> 4 | 0x30; | |
1281 imei_info->imei_number[13] = ( ksStat->ir.rKSIMEI.snr3 ) & 0x0F | 0x30; | |
1282 //a0876501 - Check byte comes before the Software version during display. | |
1283 imei_info->imei_number[14] = ( ksStat->ir.rKSIMEI.cd & 0x0F ) | 0x30; | |
1284 imei_info->imei_number[15] = ( ksStat->ir.rKSIMEI.svn & 0xF0 ) >> 4 | 0x30; | |
1285 imei_info->imei_number[16] = ( ksStat->ir.rKSIMEI.svn ) & 0x0F | 0x30; | |
1286 imei_info->imei_number[17] = '\0'; | |
1287 #endif | |
1288 #else | |
1289 memset(&imei_info, 0, sizeof(imei_info)); | |
1290 | |
1291 #ifdef NEPTUNE_BOARD /* OMAPS00059546 : BCD to conversion has been changed */ | |
1292 imei_info.imei_number[0] = ( ksStat->ir.rKSIMEI.tac1 ) & 0x0F | 0x30; | |
1293 imei_info.imei_number[1] = ( ksStat->ir.rKSIMEI.tac1 & 0xF0 ) >> 4 | 0x30; | |
1294 imei_info.imei_number[2] = ( ksStat->ir.rKSIMEI.tac2 ) & 0x0F | 0x30; | |
1295 imei_info.imei_number[3] = ( ksStat->ir.rKSIMEI.tac2 & 0xF0 ) >> 4 | 0x30; | |
1296 imei_info.imei_number[4] = ( ksStat->ir.rKSIMEI.tac3 ) & 0x0F | 0x30; | |
1297 imei_info.imei_number[5] = ( ksStat->ir.rKSIMEI.tac3 & 0xF0 ) >> 4 | 0x30; | |
1298 imei_info.imei_number[6] = ( ksStat->ir.rKSIMEI.fac ) & 0x0F | 0x30; | |
1299 imei_info.imei_number[7] = ( ksStat->ir.rKSIMEI.fac & 0xF0 ) >> 4 | 0x30; | |
1300 imei_info.imei_number[8] = ( ksStat->ir.rKSIMEI.snr1 ) & 0x0F | 0x30; | |
1301 imei_info.imei_number[9] = ( ksStat->ir.rKSIMEI.snr1 & 0xF0 ) >> 4 | 0x30; | |
1302 imei_info.imei_number[10] = ( ksStat->ir.rKSIMEI.snr2 ) & 0x0F | 0x30; | |
1303 imei_info.imei_number[11] = ( ksStat->ir.rKSIMEI.snr2 & 0xF0 ) >> 4 | 0x30; | |
1304 imei_info.imei_number[12] = ( ksStat->ir.rKSIMEI.snr3 ) & 0x0F | 0x30; | |
1305 imei_info.imei_number[13] = ( ksStat->ir.rKSIMEI.snr3 & 0xF0 ) >> 4 | 0x30; | |
1306 imei_info.imei_number[14] = ( ksStat->ir.rKSIMEI.cd & 0x0F ) | 0x30; | |
1307 imei_info.imei_number[15] = ( ksStat->ir.rKSIMEI.svn ) & 0x0F | 0x30; | |
1308 imei_info.imei_number[16] = ( ksStat->ir.rKSIMEI.svn & 0xF0 ) >> 4 | 0x30; | |
1309 imei_info.imei_number[17] = '\0'; | |
1310 | |
1311 #else | |
1312 // Jul 05 2005 REF: CRR 22565 a0876501 | |
1313 // Fixed the issue of byte swapping. | |
1314 | |
1315 imei_info.imei_number[0] = ( ksStat->ir.rKSIMEI.tac1 & 0xF0 ) >> 4 | 0x30; | |
1316 imei_info.imei_number[1] = ( ksStat->ir.rKSIMEI.tac1 ) & 0x0F | 0x30; | |
1317 imei_info.imei_number[2] = ( ksStat->ir.rKSIMEI.tac2 & 0xF0 ) >> 4 | 0x30; | |
1318 imei_info.imei_number[3] = ( ksStat->ir.rKSIMEI.tac2 ) & 0x0F | 0x30; | |
1319 imei_info.imei_number[4] = ( ksStat->ir.rKSIMEI.tac3 & 0xF0 ) >> 4 | 0x30; | |
1320 imei_info.imei_number[5] = ( ksStat->ir.rKSIMEI.tac3 ) & 0x0F | 0x30; | |
1321 imei_info.imei_number[6] = ( ksStat->ir.rKSIMEI.fac & 0xF0 ) >> 4 | 0x30; | |
1322 imei_info.imei_number[7] = ( ksStat->ir.rKSIMEI.fac ) & 0x0F | 0x30; | |
1323 imei_info.imei_number[8] = ( ksStat->ir.rKSIMEI.snr1 & 0xF0 ) >> 4 | 0x30; | |
1324 imei_info.imei_number[9] = ( ksStat->ir.rKSIMEI.snr1 ) & 0x0F | 0x30; | |
1325 imei_info.imei_number[10] = ( ksStat->ir.rKSIMEI.snr2 & 0xF0 ) >> 4 | 0x30; | |
1326 imei_info.imei_number[11] = ( ksStat->ir.rKSIMEI.snr2 ) & 0x0F | 0x30; | |
1327 imei_info.imei_number[12] = ( ksStat->ir.rKSIMEI.snr3 & 0xF0 ) >> 4 | 0x30; | |
1328 imei_info.imei_number[13] = ( ksStat->ir.rKSIMEI.snr3 ) & 0x0F | 0x30; | |
1329 //a0876501 - Check byte comes before the Software version during display. | |
1330 imei_info.imei_number[14] = ( ksStat->ir.rKSIMEI.cd & 0x0F ) | 0x30; | |
1331 imei_info.imei_number[15] = ( ksStat->ir.rKSIMEI.svn & 0xF0 ) >> 4 | 0x30; | |
1332 imei_info.imei_number[16] = ( ksStat->ir.rKSIMEI.svn ) & 0x0F | 0x30; | |
1333 imei_info.imei_number[17] = '\0'; | |
1334 | |
1335 #endif | |
1336 TRACE_EVENT_P8("ss_decode_imei IMEI: TAC %1c%1c%1c%1c%1c%1c%1c%1c", | |
1337 imei_info.imei_number[0], imei_info.imei_number[1], imei_info.imei_number[2], imei_info.imei_number[3], | |
1338 imei_info.imei_number[4], imei_info.imei_number[5], imei_info.imei_number[6], imei_info.imei_number[7]); | |
1339 TRACE_EVENT_P6("ss_decode_imei IMEI: SNR %1c%1c%1c%1c%1c%1c", | |
1340 imei_info.imei_number[8], imei_info.imei_number[9], imei_info.imei_number[10], imei_info.imei_number[11], | |
1341 imei_info.imei_number[12], imei_info.imei_number[13]); | |
1342 TRACE_EVENT_P4("ss_decode_imei IMEI: SV CD %1c%1c%1c%1c", | |
1343 imei_info.imei_number[14], imei_info.imei_number[15], imei_info.imei_number[16],imei_info.imei_number[17]); | |
1344 | |
1345 #endif | |
1346 } | |
1347 | |
1348 #ifdef NEPTUNE_BOARD | |
1349 | |
1350 | |
1351 /* ===========================================================*/ | |
1352 /** | |
1353 * mfw_getSumOf2Digits () is called when getting IMEI request from the used | |
1354 * | |
1355 * @param UBYTE digits - Byte to be added | |
1356 * | |
1357 * @return UBYTE - Sum of two digits | |
1358 * | |
1359 * @see | |
1360 */ | |
1361 /* =========================================================== */ | |
1362 LOCAL UBYTE mfw_getSumOf2Digits ( UBYTE idigits ) | |
1363 { | |
1364 UBYTE iDval; | |
1365 | |
1366 TRACE_FUNCTION( "mfw_getSumOf2Digits" ); | |
1367 /* compute odd labeled digit */ | |
1368 iDval = 2 * ( idigits & 0x0F ); | |
1369 iDval = iDval - ( iDval < 10 ? 0 : 9 ); | |
1370 | |
1371 /* | |
1372 return sum of even labeled digit and | |
1373 already processed odd labeled digit | |
1374 */ | |
1375 return iDval + ( ( idigits >> 4 ) & 0x0F ); | |
1376 } | |
1377 | |
1378 #endif | |
1379 | |
1380 /* | |
1381 +--------------------------------------------------------------------+ | |
1382 | PROJECT: MMI-Framework (8417) MODULE : MFW_SS | | |
1383 | STATE : code ROUTINE : mfw_getCdByteFromImei | | |
1384 +--------------------------------------------------------------------+ | |
1385 PURPOSE : Get CD byte from IMEI. | |
1386 */ | |
1387 UBYTE getCdByteFromImei(UBYTE *imei) | |
1388 { | |
1389 T_ACI_IMEI aci_imei; | |
1390 #ifdef NEPTUNE_BOARD | |
1391 UBYTE iSum = 0; /* sum of step 2 */ | |
1392 UBYTE iCd; /* Luhn Check Digit */ | |
1393 #endif | |
1394 | |
1395 TRACE_FUNCTION( "getCdByteFromImei" ); | |
1396 // For calculating the Cd byte, copy the buffer contents. | |
1397 aci_imei.tac1 = imei[0]; | |
1398 aci_imei.tac2 = imei[1]; | |
1399 aci_imei.tac3 = imei[2]; | |
1400 aci_imei.fac = imei[3]; | |
1401 aci_imei.snr1 = imei[4]; | |
1402 aci_imei.snr2 = imei[5]; | |
1403 aci_imei.snr3 = imei[6]; | |
1404 aci_imei.svn = imei[7]; | |
1405 #ifndef NEPTUNE_BOARD | |
1406 | |
1407 return(cmhSS_getCdFromImei(&aci_imei)); | |
1408 | |
1409 #else | |
1410 | |
1411 /* OMAPS00059546 : Calculating the CD bytes for IMEI */ | |
1412 iSum += mfw_getSumOf2Digits ( aci_imei.tac1 ); | |
1413 iSum += mfw_getSumOf2Digits ( aci_imei.tac2 ); | |
1414 iSum += mfw_getSumOf2Digits ( aci_imei.tac3 ); | |
1415 iSum += mfw_getSumOf2Digits ( aci_imei.fac ); | |
1416 iSum += mfw_getSumOf2Digits ( aci_imei.snr1 ); | |
1417 iSum += mfw_getSumOf2Digits ( aci_imei.snr2 ); | |
1418 iSum += mfw_getSumOf2Digits ( aci_imei.snr3 ); | |
1419 | |
1420 iCd = 10 - ( iSum % 10 ); | |
1421 iCd = ( iCd EQ 10 ? 0 : iCd ); | |
1422 return ( iCd ); | |
1423 #endif | |
1424 | |
1425 } | |
1426 | |
1427 /* | |
1428 +--------------------------------------------------------------------+ | |
1429 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
1430 | STATE : code ROUTINE: rAT_PercentKSIR | | |
1431 +--------------------------------------------------------------------+ | |
1432 | |
1433 | |
1434 PURPOSE : Network response for key sequences | |
1435 | |
1436 */ | |
1437 | |
1438 void rAT_PercentKSIR ( T_ACI_KSIR *ksStat) | |
1439 { | |
1440 UBYTE idx; | |
1441 T_MFW_TELECOM *p_tele; | |
1442 T_MFW_FEATURE *p_feat; | |
1443 T_MFW_SRV_GROUP *p_srv; | |
1444 | |
1445 TRACE_FUNCTION("rAT_PercentKSIR()"); | |
1446 TRACE_EVENT_P1("ksStat->ksdCmd %d", ksStat->ksdCmd); | |
1447 | |
1448 switch (ksStat->ksdCmd) | |
1449 { | |
1450 case KSD_CMD_CB: | |
1451 TRACE_EVENT("KSD_CMD_CB"); | |
1452 TRACE_EVENT_P1("ksStat->ir.rKSCB.ssCd %d", ksStat->ir.rKSCB.ssCd); | |
1453 TRACE_EVENT_P1("ksStat->ir.rKSCB.opCd %d", ksStat->ir.rKSCB.opCd); | |
1454 TRACE_EVENT_P1("ksStat->ir.rKSCB.ssErr %d", ksStat->ir.rKSCB.ssErr); | |
1455 TRACE_EVENT_P1("ksStat->ir.rKSCB.c_cbInfoLst %d", ksStat->ir.rKSCB.c_cbInfoLst); | |
1456 if (ksStat->ir.rKSCB.c_cbInfoLst) | |
1457 { | |
1458 int i; | |
1459 for (i = 0; i < ksStat->ir.rKSCB.c_cbInfoLst; i++) | |
1460 { | |
1461 TRACE_EVENT_P2("ksStat->ir.rKSCB.cbInfoLst[%d].bsTp %d", i, ksStat->ir.rKSCB.cbInfoLst[i].bsTp); | |
1462 TRACE_EVENT_P2("ksStat->ir.rKSCB.cbInfoLst[%d].bsCd %d", i, ksStat->ir.rKSCB.cbInfoLst[i].bsCd); | |
1463 TRACE_EVENT_P2("ksStat->ir.rKSCB.cbInfoLst[%d].ssSt %d", i, ksStat->ir.rKSCB.cbInfoLst[i].ssSt); | |
1464 } | |
1465 } | |
1466 p_tele = (T_MFW_TELECOM *) ssLstBuf; | |
1467 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1468 #ifdef FF_MMI_OPTIM | |
1469 cb_cnf = (T_MFW_SS_CB_CNF*)mfwAlloc(sizeof(T_MFW_SS_CB_CNF)); | |
1470 if(NULL != cb_cnf) | |
1471 { | |
1472 TRACE_EVENT_P2("Mem Aloc for cb_cnf = %x Size = %d",cb_cnf,sizeof(T_MFW_SS_CB_CNF)); | |
1473 cb_cnf->ss_code = (T_MFW_SS_CODES)ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSCB.ssCd); /*a0393213 compiler warnings removal - explicit type castingl*/ | |
1474 cb_cnf->ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSCB.opCd); /*a0393213 compiler warnings remova - explicit type castingl*/ | |
1475 cb_cnf->ss_error =(T_MFW_SS_ERROR) ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSCB.ssErr); /*a0393213 compiler warnings removal - explicit type casting*/ | |
1476 cb_cnf->ss_telecom_list = p_tele; | |
1477 } | |
1478 else | |
1479 return; | |
1480 #else | |
1481 cb_cnf.ss_code = (T_MFW_SS_CODES) ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSCB.ssCd); | |
1482 cb_cnf.ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSCB.opCd); | |
1483 cb_cnf.ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSCB.ssErr); | |
1484 cb_cnf.ss_telecom_list = p_tele; | |
1485 #endif | |
1486 | |
1487 for( idx = 0; | |
1488 idx < ksStat->ir.rKSCB.c_cbInfoLst AND | |
1489 idx < MFW_MAX_TELE_NR; | |
1490 idx++, p_tele++ ) | |
1491 { | |
1492 p_tele->ss_telecom_type = ksStat->ir.rKSCB. | |
1493 cbInfoLst[idx].bsTp; | |
1494 p_tele->ss_telecom_service = ksStat->ir.rKSCB. | |
1495 cbInfoLst[idx].bsCd; | |
1496 p_tele->ss_status = ksStat->ir.rKSCB. | |
1497 cbInfoLst[idx].ssSt; | |
1498 } | |
1499 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1500 #ifdef FF_MMI_OPTIM | |
1501 if(NULL != cb_cnf) | |
1502 cb_cnf->ss_telecom_count = idx; | |
1503 #else | |
1504 cb_cnf.ss_telecom_count = idx; | |
1505 #endif | |
1506 break; | |
1507 | |
1508 case KSD_CMD_CF: | |
1509 TRACE_EVENT("KSD_CMD_CF"); | |
1510 TRACE_EVENT_P1("ksStat->ir.rKSCF.ssCd %d", ksStat->ir.rKSCF.ssCd); | |
1511 TRACE_EVENT_P1("ksStat->ir.rKSCF.opCd %d", ksStat->ir.rKSCF.opCd); | |
1512 TRACE_EVENT_P1("ksStat->ir.rKSCF.ssErr %d", ksStat->ir.rKSCF.ssErr); | |
1513 TRACE_EVENT_P1("ksStat->ir.rKSCF.c_cfFeatLst %d", ksStat->ir.rKSCF.c_cfFeatLst); | |
1514 if (ksStat->ir.rKSCF.c_cfFeatLst) | |
1515 { | |
1516 int i; | |
1517 for (i = 0; i < ksStat->ir.rKSCF.c_cfFeatLst; i++) | |
1518 { | |
1519 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].bsTp %d", i, ksStat->ir.rKSCF.cfFeatLst[i].bsTp); | |
1520 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].bsCd %d", i, ksStat->ir.rKSCF.cfFeatLst[i].bsCd); | |
1521 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].ssSt %d", i, ksStat->ir.rKSCF.cfFeatLst[i].ssSt); | |
1522 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].num %s", i, ksStat->ir.rKSCF.cfFeatLst[i].num); | |
1523 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].ton 0x%02X", i, ksStat->ir.rKSCF.cfFeatLst[i].ton); | |
1524 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].npi 0x%02X", i, ksStat->ir.rKSCF.cfFeatLst[i].npi); | |
1525 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].sub %s", i, ksStat->ir.rKSCF.cfFeatLst[i].sub); | |
1526 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].tos 0x%02X", i, ksStat->ir.rKSCF.cfFeatLst[i].tos); | |
1527 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].oe 0x%02X", i, ksStat->ir.rKSCF.cfFeatLst[i].oe); | |
1528 TRACE_EVENT_P2("ksStat->ir.rKSCF.cfFeatLst[%d].time 0x%02X", i, ksStat->ir.rKSCF.cfFeatLst[i].time); | |
1529 } | |
1530 } | |
1531 p_feat = (T_MFW_FEATURE *) ssLstBuf; | |
1532 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1533 #ifdef FF_MMI_OPTIM | |
1534 cf_cnf = (T_MFW_SS_CF_CNF*)mfwAlloc(sizeof(T_MFW_SS_CF_CNF)); | |
1535 if(NULL != cf_cnf) | |
1536 { | |
1537 TRACE_EVENT_P2("Mem Loc = %x, allocates size = %d",cf_cnf,sizeof(T_MFW_SS_CF_CNF)); | |
1538 cf_cnf->ss_code = (T_MFW_SS_CODES)ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSCF.ssCd); | |
1539 cf_cnf->ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSCF.opCd); | |
1540 cf_cnf->ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSCF.ssErr); | |
1541 cf_cnf->ss_feature_list = p_feat; | |
1542 } | |
1543 #else | |
1544 cf_cnf.ss_code = (T_MFW_SS_CODES)ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSCF.ssCd); | |
1545 cf_cnf.ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSCF.opCd); | |
1546 cf_cnf.ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSCF.ssErr); | |
1547 | |
1548 cf_cnf.ss_feature_list = p_feat; | |
1549 #endif | |
1550 for( idx = 0; | |
1551 idx < ksStat->ir.rKSCF.c_cfFeatLst AND | |
1552 idx < MFW_MAX_FEAT_NR; | |
1553 idx++, p_feat++ ) | |
1554 { | |
1555 p_feat->ss_telecom_type = ksStat->ir.rKSCF. | |
1556 cfFeatLst[idx].bsTp; | |
1557 p_feat->ss_telecom_service = ksStat->ir.rKSCF. | |
1558 cfFeatLst[idx].bsCd; | |
1559 p_feat->ss_status = ksStat->ir.rKSCF.cfFeatLst[idx].ssSt; | |
1560 p_feat->ss_numbering_type = (UBYTE)phb_cvtTon((T_ACI_TOA_TON)ksStat->ir.rKSCF. | |
1561 cfFeatLst[idx].ton); /*a0393213 compiler warnings removal - explicit type casting done*/ | |
1562 p_feat->ss_numbering_plan = (UBYTE)phb_cvtNpi((T_ACI_TOA_NPI)ksStat->ir.rKSCF. | |
1563 cfFeatLst[idx].npi); /*a0393213 compiler warnings removal - explicit type casting done*/ | |
1564 strncpy((char *)p_feat->ss_forwarded_to_number, | |
1565 (char *)ksStat->ir.rKSCF.cfFeatLst[idx].num, | |
1566 MFW_SS_NUM_LEN); | |
1567 strncpy((char *)p_feat->ss_forwarded_to_subaddress, | |
1568 (char *)ksStat->ir.rKSCF.cfFeatLst[idx].sub, | |
1569 MFW_SS_SUBADR_LEN); | |
1570 p_feat->ss_no_reply_condition_time = ksStat->ir.rKSCF. | |
1571 cfFeatLst[idx].time; | |
1572 } | |
1573 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1574 #ifdef FF_MMI_OPTIM | |
1575 if(NULL != cf_cnf) | |
1576 cf_cnf->ss_feature_count = idx; | |
1577 #else | |
1578 cf_cnf.ss_feature_count = idx; | |
1579 #endif | |
1580 TRACE_EVENT("rat_percentksir->KSD_CMD_CF"); | |
1581 if (ksStat->srcId != CMD_SRC_LCL) | |
1582 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1583 #ifdef FF_MMI_OPTIM | |
1584 { | |
1585 | |
1586 ss_signal(E_SS_CF_ICN_UPD,cf_cnf); | |
1587 } | |
1588 #else | |
1589 ss_signal(E_SS_CF_ICN_UPD, &cf_cnf); | |
1590 #endif | |
1591 | |
1592 break; | |
1593 | |
1594 case KSD_CMD_CL: | |
1595 TRACE_EVENT("KSD_CMD_CL"); | |
1596 TRACE_EVENT_P1("ksStat->ir.rKSCL.ssCd %d", ksStat->ir.rKSCL.ssCd); | |
1597 TRACE_EVENT_P1("ksStat->ir.rKSCL.opCd %d", ksStat->ir.rKSCL.opCd); | |
1598 TRACE_EVENT_P1("ksStat->ir.rKSCL.ssErr %d", ksStat->ir.rKSCL.ssErr); | |
1599 TRACE_EVENT_P1("ksStat->ir.rKSCL.ssSt %d", ksStat->ir.rKSCL.ssSt); | |
1600 TRACE_EVENT_P1("ksStat->ir.rKSCL.mode %d", ksStat->ir.rKSCL.mode); | |
1601 TRACE_EVENT_P1("ksStat->ir.rKSCL.clirOpt %d", ksStat->ir.rKSCL.clirOpt); | |
1602 TRACE_EVENT_P1("ksStat->ir.rKSCL.ovrdCtg %d", ksStat->ir.rKSCL.ovrdCtg); | |
1603 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1604 #ifdef FF_MMI_OPTIM | |
1605 cli_cnf = (T_MFW_SS_CLI_CNF*)mfwAlloc(sizeof(T_MFW_SS_CLI_CNF)); | |
1606 if(NULL != cli_cnf) | |
1607 { | |
1608 cli_cnf->ss_code = (T_MFW_SS_CODES)ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSCL.ssCd); /*a0393213 compiler warning removal - explicit typecasting done*/ | |
1609 cli_cnf->ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSCL.opCd);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1610 cli_cnf->ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSCL.ssErr);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1611 cli_cnf->ss_status = ksStat->ir.rKSCL.ssSt; | |
1612 cli_cnf->ss_clir_option = (T_MFW_CL_STATUS)ss_cvtCLStatus((T_ACI_KSD_CLIR_OP)ksStat->ir.rKSCL.clirOpt);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1613 cli_cnf->ss_ovrd_ctgry = (T_MFW_OV_CTGRY)ss_cvtCLOvrd((T_ACI_KSD_OVRD_CTG)ksStat->ir.rKSCL.ovrdCtg);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1614 } | |
1615 #else | |
1616 cli_cnf.ss_code = (T_MFW_SS_CODES)ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSCL.ssCd); | |
1617 cli_cnf.ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSCL.opCd); | |
1618 cli_cnf.ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSCL.ssErr); | |
1619 | |
1620 cli_cnf.ss_status = ksStat->ir.rKSCL.ssSt; | |
1621 cli_cnf.ss_clir_option = (T_MFW_CL_STATUS)ss_cvtCLStatus((T_ACI_KSD_CLIR_OP)ksStat->ir.rKSCL.clirOpt);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1622 cli_cnf.ss_ovrd_ctgry = (T_MFW_OV_CTGRY)ss_cvtCLOvrd((T_ACI_KSD_OVRD_CTG)ksStat->ir.rKSCL.ovrdCtg); | |
1623 #endif | |
1624 break; | |
1625 | |
1626 case KSD_CMD_CW: | |
1627 TRACE_EVENT("KSD_CMD_CW"); | |
1628 TRACE_EVENT_P1("ksStat->ir.rKSCW.ssCd %d", ksStat->ir.rKSCW.ssCd); | |
1629 TRACE_EVENT_P1("ksStat->ir.rKSCW.opCd %d", ksStat->ir.rKSCW.opCd); | |
1630 TRACE_EVENT_P1("ksStat->ir.rKSCW.ssErr %d", ksStat->ir.rKSCW.ssErr); | |
1631 TRACE_EVENT_P1("ksStat->ir.rKSCW.ssSt %d", ksStat->ir.rKSCW.ssSt); | |
1632 TRACE_EVENT_P1("ksStat->ir.rKSCW.c_cwBSGLst %d", ksStat->ir.rKSCW.c_cwBSGLst); | |
1633 if (ksStat->ir.rKSCW.c_cwBSGLst) | |
1634 { | |
1635 int i; | |
1636 for (i = 0; i < ksStat->ir.rKSCW.c_cwBSGLst; i++) | |
1637 { | |
1638 TRACE_EVENT_P2("ksStat->ir.rKSCW.cwBSGLst[%d].bsTp %d", i, ksStat->ir.rKSCW.cwBSGLst[i].bsTp); | |
1639 TRACE_EVENT_P2("ksStat->ir.rKSCW.cwBSGLst[%d].bsCd %d", i, ksStat->ir.rKSCW.cwBSGLst[i].bsCd); | |
1640 } | |
1641 } | |
1642 p_srv = (T_MFW_SRV_GROUP *) ssLstBuf; | |
1643 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1644 #ifdef FF_MMI_OPTIM | |
1645 cw_cnf = (T_MFW_SS_CW_CNF*)mfwAlloc(sizeof(T_MFW_SS_CW_CNF)); | |
1646 if(cw_cnf != NULL) | |
1647 { | |
1648 cw_cnf->ss_code =(T_MFW_SS_CODES) ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSCW.ssCd);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1649 cw_cnf->ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSCW.opCd);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1650 cw_cnf->ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSCW.ssErr);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1651 cw_cnf->ss_status = ksStat->ir.rKSCW.ssSt; | |
1652 cw_cnf->ss_service_list = p_srv; | |
1653 } | |
1654 | |
1655 #else | |
1656 cw_cnf.ss_code = (T_MFW_SS_CODES)ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSCW.ssCd); | |
1657 cw_cnf.ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSCW.opCd); | |
1658 cw_cnf.ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSCW.ssErr); | |
1659 cw_cnf.ss_status = ksStat->ir.rKSCW.ssSt; | |
1660 | |
1661 cw_cnf.ss_service_list = p_srv; | |
1662 #endif | |
1663 for( idx = 0; | |
1664 idx < ksStat->ir.rKSCW.c_cwBSGLst AND | |
1665 idx < MFW_MAX_SRV_NR; | |
1666 idx++, p_srv++ ) | |
1667 { | |
1668 p_srv->ss_telecom_type = ksStat->ir.rKSCW. | |
1669 cwBSGLst[idx].bsTp; | |
1670 p_srv->ss_telecom_service = ksStat->ir.rKSCW. | |
1671 cwBSGLst[idx].bsCd; | |
1672 } | |
1673 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1674 #ifdef FF_MMI_OPTIM | |
1675 if(NULL != cw_cnf) | |
1676 cw_cnf->ss_service_count = idx; | |
1677 #else | |
1678 cw_cnf.ss_service_count = idx; | |
1679 #endif | |
1680 break; | |
1681 | |
1682 case KSD_CMD_PWD: | |
1683 TRACE_EVENT("KSD_CMD_PWD"); | |
1684 TRACE_EVENT_P1("ksStat->ir.rKSPW.ssCd %d", ksStat->ir.rKSPW.ssCd); | |
1685 TRACE_EVENT_P1("ksStat->ir.rKSPW.opCd %d", ksStat->ir.rKSPW.opCd); | |
1686 TRACE_EVENT_P1("ksStat->ir.rKSPW.ssErr %d", ksStat->ir.rKSPW.ssErr); | |
1687 TRACE_EVENT_P1("ksStat->ir.rKSPW.newPwd %s", ksStat->ir.rKSPW.newPwd); | |
1688 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1689 #ifdef FF_MMI_OPTIM | |
1690 pw_cnf = (T_MFW_SS_PW_CNF*)mfwAlloc(sizeof(T_MFW_SS_PW_CNF)); | |
1691 if( NULL != pw_cnf) | |
1692 { | |
1693 pw_cnf->ss_code = (T_MFW_SS_CODES)ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSPW.ssCd);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1694 pw_cnf->ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSPW.opCd);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1695 pw_cnf->ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSPW.ssErr);/*a0393213 compiler warning removal - explicit typecasting done*/ | |
1696 | |
1697 strncpy( (char *)pw_cnf->ss_new_pwd, (char *)ksStat->ir.rKSPW.newPwd, | |
1698 MFW_SS_PWD_LEN); | |
1699 } | |
1700 #else | |
1701 pw_cnf.ss_code = (T_MFW_SS_CODES)ss_cvtSCode((T_ACI_KSD_SS)ksStat->ir.rKSPW.ssCd); | |
1702 pw_cnf.ss_category = (T_MFW_SS_CATEGORY)ss_cvtOCode((T_ACI_KSD_OP)ksStat->ir.rKSPW.opCd); | |
1703 pw_cnf.ss_error = (T_MFW_SS_ERROR)ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSPW.ssErr); | |
1704 | |
1705 strncpy( (char *)pw_cnf.ss_new_pwd, (char *)ksStat->ir.rKSPW.newPwd, | |
1706 MFW_SS_PWD_LEN); | |
1707 #endif | |
1708 break; | |
1709 | |
1710 case KSD_CMD_IMEI: | |
1711 TRACE_EVENT("KSD_CMD_IMEI"); | |
1712 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.tac1 %d", ksStat->ir.rKSIMEI.tac1); | |
1713 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.tac2 %d", ksStat->ir.rKSIMEI.tac2); | |
1714 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.tac3 %d", ksStat->ir.rKSIMEI.tac3); | |
1715 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.fac %d", ksStat->ir.rKSIMEI.fac); | |
1716 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.snr1 %d", ksStat->ir.rKSIMEI.snr1); | |
1717 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.snr2 %d", ksStat->ir.rKSIMEI.snr2); | |
1718 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.snr3 %d", ksStat->ir.rKSIMEI.snr3); | |
1719 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.svn %d", ksStat->ir.rKSIMEI.svn); | |
1720 TRACE_EVENT_P1("ksStat->ir.rKSIMEI.cd %d", ksStat->ir.rKSIMEI.cd); | |
1721 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1722 #ifdef FF_MMI_OPTIM | |
1723 imei_info = (T_MFW_IMEI*)mfwAlloc(sizeof(T_MFW_IMEI)); | |
1724 if( NULL != imei_info) | |
1725 { | |
1726 #endif | |
1727 ss_decode_imei(ksStat); | |
1728 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1729 #ifdef FF_MMI_OPTIM | |
1730 imei_info->error = MFW_SS_NO_ERROR; | |
1731 ss_signal(E_SS_IMEI, imei_info); | |
1732 } | |
1733 #else | |
1734 imei_info.error = MFW_SS_NO_ERROR; | |
1735 ss_signal(E_SS_IMEI, &imei_info); | |
1736 #endif | |
1737 break; | |
1738 | |
1739 case KSD_CMD_USSD: | |
1740 TRACE_EVENT("KSD_CMD_USSD"); | |
1741 TRACE_EVENT_P1("ksStat->ir.rKSUS.dcs 0x%02X", ksStat->ir.rKSUS.dcs); | |
1742 TRACE_EVENT_P1("ksStat->ir.rKSUS.mode %d", ksStat->ir.rKSUS.mode); | |
1743 TRACE_EVENT_P1("ksStat->ir.rKSUS.ssErr %d", ksStat->ir.rKSUS.ssErr); | |
1744 memset(&ussd_info, 0, sizeof(ussd_info)); | |
1745 | |
1746 /* OMAPS00079722 - Null Check has been added */ | |
1747 if( ksStat->ir.rKSUS.ussd != NULL ) | |
1748 { | |
1749 TRACE_EVENT_P1("ksStat->ir.rKSUS.ussd %s", ksStat->ir.rKSUS.ussd); | |
1750 ussd_info.len = strlen((char *)ksStat->ir.rKSUS.ussd); | |
1751 strcpy((char*)ussd_info.ussd, (char *)ksStat->ir.rKSUS.ussd); | |
1752 } | |
1753 //x0pleela 28 Aug, 2006 DR: OMAPS00083503 | |
1754 //Removed the hardcoded dcs value "MFW_ASCII" | |
1755 ussd_info.dcs = (T_MFW_DCS)(ksStat->ir.rKSUS.dcs); | |
1756 ussd_info.error = ss_cvtErrCode((T_ACI_KSD_ERR)ksStat->ir.rKSUS.ssErr); | |
1757 | |
1758 //x0pleela 28 Aug, 2006 DR: OMAPS00083503 | |
1759 //sending ss signal E_SS_USSD_REQ or E_SS_USSD_CNF based on user action required or not | |
1760 if (ksStat->ir.rKSUS.mode == CUSD_MOD_YesActReq) | |
1761 ss_signal(E_SS_USSD_REQ, &ussd_info); | |
1762 if (ksStat->ir.rKSUS.mode == CUSD_MOD_NoActReq || ksStat->ir.rKSUS.mode==CUSD_MOD_TerminatedByNetwork || | |
1763 ksStat->ir.rKSUS.mode == CUSD_MOD_OperationNotSupported || ksStat->ir.rKSUS.mode ==CUSD_MOD_NetworkTimeout) | |
1764 ss_signal(E_SS_USSD_CNF, &ussd_info); | |
1765 | |
1766 break; | |
1767 | |
1768 default: | |
1769 TRACE_EVENT("default"); | |
1770 break; | |
1771 } | |
1772 } | |
1773 | |
1774 /* | |
1775 +--------------------------------------------------------------------+ | |
1776 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
1777 | STATE : code ROUTINE: ss_command_info | | |
1778 +--------------------------------------------------------------------+ | |
1779 | |
1780 | |
1781 PURPOSE : Notify for send a SS string from ACI | |
1782 | |
1783 */ | |
1784 | |
1785 void ss_command_info(T_ACI_CLOG* cmd) | |
1786 { | |
1787 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1788 // the variable is made local since the scope lies within this function | |
1789 #ifdef FF_MMI_OPTIM | |
1790 T_MFW_SS_RES ss_res; | |
1791 #endif | |
1792 TRACE_FUNCTION("ss_command_info()"); | |
1793 | |
1794 if (cmd->cmdPrm.sCFUN.srcId != CMD_SRC_LCL) | |
1795 return; | |
1796 | |
1797 switch ((int)(cmd->atCmd)) /*a0393213 - typecasting done to avoid lint warning*/ | |
1798 { | |
1799 case KSD_CMD_CB: | |
1800 ss_res.type = ss_cvtSCode((T_ACI_KSD_SS)cmd->cmdPrm.sKSCB.ssCd); | |
1801 ss_res.category = ss_cvtOCode((T_ACI_KSD_OP)cmd->cmdPrm.sKSCB.opCd); | |
1802 if( cmd->cmdPrm.sKSCB.pwd ) | |
1803 strncpy(ss_res.ppn, (char *)cmd->cmdPrm.sKSCB.pwd, | |
1804 MAX_PWD_LEN); | |
1805 else | |
1806 ss_res.ppn[0] = 0; | |
1807 ss_res.pwd[0] = 0; | |
1808 ss_res.bs = cmd->cmdPrm.sKSCB.bsCd; | |
1809 ss_res.time = 0; | |
1810 ss_signal(E_SS_RES, &ss_res); | |
1811 break; | |
1812 | |
1813 case KSD_CMD_CF: | |
1814 ss_res.type = ss_cvtSCode((T_ACI_KSD_SS)cmd->cmdPrm.sKSCF.ssCd); | |
1815 ss_res.category = ss_cvtOCode((T_ACI_KSD_OP)cmd->cmdPrm.sKSCF.opCd); | |
1816 ss_res.ppn[0] = 0; | |
1817 ss_res.pwd[0] = 0; | |
1818 ss_res.bs = cmd->cmdPrm.sKSCF.bsCd; | |
1819 ss_res.time = cmd->cmdPrm.sKSCF.time; | |
1820 ss_signal(E_SS_RES, &ss_res); | |
1821 break; | |
1822 | |
1823 case KSD_CMD_CW: | |
1824 ss_res.type = SS_CW; | |
1825 ss_res.category = ss_cvtOCode((T_ACI_KSD_OP)cmd->cmdPrm.sKSCW.opCd); | |
1826 ss_res.ppn[0] = 0; | |
1827 ss_res.pwd[0] = 0; | |
1828 ss_res.bs = cmd->cmdPrm.sKSCW.bsCd; | |
1829 ss_res.time = 0; | |
1830 ss_signal(E_SS_RES, &ss_res); | |
1831 break; | |
1832 | |
1833 case KSD_CMD_PWD: | |
1834 switch(cmd->cmdPrm.sKSPW.ssCd) | |
1835 { | |
1836 case KSD_SS_CCBS: | |
1837 case KSD_SS_ALL_CBSS: | |
1838 case KSD_SS_BOC: | |
1839 case KSD_SS_BAOC: | |
1840 case KSD_SS_BOIC: | |
1841 case KSD_SS_BOICXH: | |
1842 case KSD_SS_BIC: | |
1843 case KSD_SS_BAIC: | |
1844 case KSD_SS_BICRM: | |
1845 | |
1846 | |
1847 /*NM 190602*/ | |
1848 case KSD_SS_ALL_SERV : | |
1849 | |
1850 | |
1851 ss_res.type = ss_cvtSCode((T_ACI_KSD_SS)cmd->cmdPrm.sKSPW.ssCd); | |
1852 ss_res.category = SS_REGISTRATION; | |
1853 if( cmd->cmdPrm.sKSPW.oldPwd ) | |
1854 strncpy(ss_res.ppn, (char *)cmd->cmdPrm.sKSPW.oldPwd, | |
1855 MAX_PWD_LEN); | |
1856 else | |
1857 ss_res.ppn[0] = 0; | |
1858 if( cmd->cmdPrm.sKSPW.newPwd ) | |
1859 strncpy(ss_res.pwd, (char *)cmd->cmdPrm.sKSPW.newPwd, | |
1860 MAX_PWD_LEN); | |
1861 else | |
1862 ss_res.pwd[0] = 0; | |
1863 ss_res.bs = 0; | |
1864 ss_res.time = 0; | |
1865 ss_signal(E_SS_RES, &ss_res); | |
1866 break; | |
1867 | |
1868 case KSD_SS_PIN1: | |
1869 pwd_flag = 1; | |
1870 sim_pin_ident(MFW_SIM_PIN1); | |
1871 break; | |
1872 case KSD_SS_PIN2: | |
1873 pwd_flag = 1; | |
1874 sim_pin_ident(MFW_SIM_PIN2); | |
1875 break; | |
1876 } | |
1877 break; | |
1878 | |
1879 case KSD_CMD_UBLK: | |
1880 switch(cmd->cmdPrm.sKSPW.ssCd) | |
1881 { | |
1882 case KSD_SS_PIN1: | |
1883 pwd_flag = 1; | |
1884 sim_pin_ident(MFW_SIM_PUK1); | |
1885 break; | |
1886 case KSD_SS_PIN2: | |
1887 pwd_flag = 1; | |
1888 sim_pin_ident(MFW_SIM_PUK2); | |
1889 break; | |
1890 } | |
1891 break; | |
1892 | |
1893 case KSD_CMD_CL: | |
1894 ss_res.type = ss_cvtSCode((T_ACI_KSD_SS)cmd->cmdPrm.sKSCL.ssCd); | |
1895 ss_res.category = ss_cvtOCode((T_ACI_KSD_OP)cmd->cmdPrm.sKSCL.opCd); | |
1896 ss_res.ppn[0] = 0; | |
1897 ss_res.pwd[0] = 0; | |
1898 ss_res.bs = 0; | |
1899 ss_res.time = 0; | |
1900 ss_signal(E_SS_RES, &ss_res); | |
1901 break; | |
1902 | |
1903 case KSD_CMD_USSD: | |
1904 memset(&ussd_info, 0, sizeof(ussd_info)); | |
1905 if( cmd->cmdPrm.sKSUS.ussd ) | |
1906 { | |
1907 ussd_info.len = strlen((char *)cmd->cmdPrm.sKSUS.ussd); | |
1908 strcpy((char*)ussd_info.ussd, (char *)cmd->cmdPrm.sKSUS.ussd); | |
1909 } | |
1910 else | |
1911 ussd_info.ussd[0] = 0; | |
1912 ussd_info.dcs = MFW_ASCII; | |
1913 //PATCH TB 1509 | |
1914 ss_res.type = SS_USSD; | |
1915 ss_res.category = SS_CTG_UNKNOWN; | |
1916 ss_res.ppn[0] = 0; | |
1917 ss_res.pwd[0] = 0; | |
1918 ss_res.bs = 0; | |
1919 ss_res.time = 0; | |
1920 ss_signal(E_SS_RES, &ss_res); | |
1921 //END PATCH TB | |
1922 break; | |
1923 | |
1924 case AT_CMD_CUSD: | |
1925 memset(&ussd_info, 0, sizeof(ussd_info)); | |
1926 ussd_info.len = cmd->cmdPrm.sCUSD.str->len; | |
1927 memcpy((char*)ussd_info.ussd, cmd->cmdPrm.sCUSD.str->data, cmd->cmdPrm.sCUSD.str->len); | |
1928 ussd_info.dcs = (T_MFW_DCS)cmd->cmdPrm.sCUSD.dcs; | |
1929 /* SPR#CQ3204 -JVJ - USSD call back sent to MMI */ | |
1930 ss_res.type = SS_USSD; | |
1931 ss_res.category = SS_CTG_UNKNOWN; | |
1932 ss_res.ppn[0] = 0; | |
1933 ss_res.pwd[0] = 0; | |
1934 ss_res.bs = 0; | |
1935 ss_res.time = 0; | |
1936 ss_signal(E_SS_RES, &ss_res); | |
1937 /* SPR#CQ3204 -JVJ */ | |
1938 break; | |
1939 default: | |
1940 break; | |
1941 } | |
1942 } | |
1943 | |
1944 /* | |
1945 +--------------------------------------------------------------------+ | |
1946 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
1947 | STATE : code ROUTINE: ss_ok_string | | |
1948 +--------------------------------------------------------------------+ | |
1949 | |
1950 | |
1951 PURPOSE : Send of SS string is successful. | |
1952 | |
1953 */ | |
1954 | |
1955 void ss_ok_string(T_ACI_AT_CMD cmdId) | |
1956 { | |
1957 TRACE_FUNCTION("ss_ok_string()"); | |
1958 | |
1959 switch ((int)cmdId) | |
1960 { | |
1961 case KSD_CMD_CB: | |
1962 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1963 // free the allocated memory once the ss_signal() execution is done | |
1964 #ifdef FF_MMI_OPTIM | |
1965 TRACE_EVENT("KSD_CMD_CB"); | |
1966 if(cb_cnf) | |
1967 { | |
1968 ss_signal(E_SS_CB_CNF, cb_cnf); | |
1969 mfwFree((U8*)cb_cnf, sizeof(T_MFW_SS_CB_CNF)); | |
1970 } | |
1971 #else | |
1972 ss_signal(E_SS_CB_CNF, &cb_cnf); | |
1973 #endif | |
1974 break; | |
1975 case KSD_CMD_CF: | |
1976 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1977 #ifdef FF_MMI_OPTIM | |
1978 TRACE_EVENT("KSD_CMD_CF"); | |
1979 if(cf_cnf) | |
1980 { | |
1981 ss_signal(E_SS_CF_CNF, cf_cnf); | |
1982 mfwFree((U8*)cf_cnf, sizeof(T_MFW_SS_CF_CNF)); | |
1983 } | |
1984 #else | |
1985 ss_signal(E_SS_CF_CNF, &cf_cnf); | |
1986 #endif | |
1987 | |
1988 break; | |
1989 case KSD_CMD_CW: | |
1990 // Apr 06 2005 REF: CRR 29989 xpradipg | |
1991 #ifdef FF_MMI_OPTIM | |
1992 TRACE_EVENT("KSD_CMD_CW"); | |
1993 if(cw_cnf) | |
1994 { | |
1995 ss_signal(E_SS_CW_CNF, cw_cnf); | |
1996 mfwFree((U8*)cw_cnf, sizeof(T_MFW_SS_CW_CNF)); | |
1997 } | |
1998 #else | |
1999 ss_signal(E_SS_CW_CNF, &cw_cnf); | |
2000 #endif | |
2001 break; | |
2002 case KSD_CMD_PWD: | |
2003 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2004 #ifdef FF_MMI_OPTIM | |
2005 TRACE_EVENT("KSD_CMD_PW"); | |
2006 if(pw_cnf) | |
2007 { | |
2008 if (!pwd_flag) | |
2009 ss_signal(E_SS_GET_PW, pw_cnf); | |
2010 mfwFree((U8*)pw_cnf,sizeof(T_MFW_SS_PW_CNF)); | |
2011 } | |
2012 #else | |
2013 if (!pwd_flag) | |
2014 ss_signal(E_SS_GET_PW, &pw_cnf); | |
2015 #endif | |
2016 | |
2017 if (pwd_flag == 1) | |
2018 { | |
2019 pwd_flag = 0; | |
2020 sim_ok_cpinc(); | |
2021 } | |
2022 break; | |
2023 case KSD_CMD_UBLK: | |
2024 sim_ss_unblock(SIM_UBLK_OK, CME_ERR_NotPresent); | |
2025 break; | |
2026 case KSD_CMD_CL: | |
2027 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2028 #ifdef FF_MMI_OPTIM | |
2029 TRACE_EVENT("KSD_CMD_CLI"); | |
2030 if(cli_cnf) | |
2031 { | |
2032 ss_signal(E_SS_CLI_CNF,(void*) cli_cnf); | |
2033 mfwFree((U8*)cli_cnf, sizeof(T_MFW_SS_CLI_CNF)); | |
2034 } | |
2035 #else | |
2036 ss_signal(E_SS_CLI_CNF,&cli_cnf); | |
2037 #endif | |
2038 break; | |
2039 case KSD_CMD_IMEI: | |
2040 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2041 #ifdef FF_MMI_OPTIM | |
2042 if( imei_info) | |
2043 { | |
2044 imei_info->error = MFW_SS_NO_ERROR; | |
2045 ss_signal(E_SS_IMEI, imei_info); | |
2046 mfwFree((U8*)imei_info,sizeof(T_MFW_IMEI)); | |
2047 } | |
2048 #else | |
2049 imei_info.error = MFW_SS_NO_ERROR; | |
2050 ss_signal(E_SS_IMEI, &imei_info); | |
2051 #endif | |
2052 break; | |
2053 default: | |
2054 break; | |
2055 } | |
2056 } | |
2057 | |
2058 | |
2059 /* | |
2060 +--------------------------------------------------------------------+ | |
2061 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
2062 | STATE : code ROUTINE: ss_error_string | | |
2063 +--------------------------------------------------------------------+ | |
2064 | |
2065 | |
2066 PURPOSE : Send of SS string is failed. | |
2067 | |
2068 */ | |
2069 | |
2070 void ss_error_string(T_ACI_AT_CMD cmdId, T_ACI_CME_ERR reason) | |
2071 { | |
2072 TRACE_FUNCTION("ss_error_string()"); | |
2073 | |
2074 switch ((int)cmdId) | |
2075 { | |
2076 case KSD_CMD_CB: | |
2077 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2078 // deallocation occurs either in ok/ error since the response is always is | |
2079 // either one of them | |
2080 #ifdef FF_MMI_OPTIM | |
2081 TRACE_EVENT("KSD_CMD_CB"); | |
2082 if(cb_cnf) | |
2083 { | |
2084 ss_signal(E_SS_CB_CNF, cb_cnf); | |
2085 mfwFree((U8*)cb_cnf,sizeof(T_MFW_SS_CB_CNF)); | |
2086 } | |
2087 #else | |
2088 ss_signal(E_SS_CB_CNF, &cb_cnf); | |
2089 #endif | |
2090 break; | |
2091 case KSD_CMD_CF: | |
2092 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2093 #ifdef FF_MMI_OPTIM | |
2094 TRACE_EVENT("KSD_CMD_CF"); | |
2095 if(cf_cnf) | |
2096 { | |
2097 ss_signal(E_SS_CF_CNF, cf_cnf); | |
2098 mfwFree((U8*)cf_cnf,sizeof(T_MFW_SS_CF_CNF)); | |
2099 TRACE_FUNCTION("memory freed for cf_cnf"); | |
2100 } | |
2101 #else | |
2102 ss_signal(E_SS_CF_CNF, &cf_cnf); | |
2103 #endif | |
2104 break; | |
2105 case KSD_CMD_CW: | |
2106 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2107 #ifdef FF_MMI_OPTIM | |
2108 TRACE_EVENT("KSD_CMD_CW"); | |
2109 if(cw_cnf) | |
2110 { | |
2111 ss_signal(E_SS_CW_CNF, cw_cnf); | |
2112 mfwFree((U8*)E_SS_CW_CNF,sizeof(T_MFW_SS_CW_CNF)); | |
2113 } | |
2114 #else | |
2115 ss_signal(E_SS_CW_CNF, &cw_cnf); | |
2116 #endif | |
2117 break; | |
2118 case KSD_CMD_PWD: | |
2119 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2120 #ifdef FF_MMI_OPTIM | |
2121 TRACE_EVENT("KSD_CMD_PW"); | |
2122 if(pw_cnf) | |
2123 { | |
2124 if (!pwd_flag) | |
2125 ss_signal(E_SS_GET_PW, pw_cnf); | |
2126 mfwFree((U8*)pw_cnf,sizeof(T_MFW_SS_PW_CNF)); | |
2127 } | |
2128 #else | |
2129 if (!pwd_flag) | |
2130 ss_signal(E_SS_GET_PW, &pw_cnf); | |
2131 #endif | |
2132 if (pwd_flag == 1) | |
2133 { | |
2134 pwd_flag = 0; | |
2135 sim_error_cpinc(); | |
2136 } | |
2137 break; | |
2138 case KSD_CMD_UBLK: | |
2139 sim_ss_unblock(SIM_UBLK_ERROR, reason); | |
2140 break; | |
2141 case KSD_CMD_CL: | |
2142 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2143 #ifdef FF_MMI_OPTIM | |
2144 TRACE_EVENT("KSD_CMD_CLI"); | |
2145 if(cli_cnf) | |
2146 { | |
2147 ss_signal(E_SS_CLI_CNF, cli_cnf); | |
2148 mfwFree((U8*)cli_cnf,sizeof(T_MFW_SS_CLI_CNF)); | |
2149 } | |
2150 #else | |
2151 ss_signal(E_SS_CLI_CNF,&cli_cnf); | |
2152 #endif | |
2153 case KSD_CMD_IMEI: | |
2154 // Apr 06 2005 REF: CRR 29989 xpradipg | |
2155 #ifdef FF_MMI_OPTIM | |
2156 if( imei_info) | |
2157 { | |
2158 imei_info->error = MFW_SS_ERROR; | |
2159 ss_signal(E_SS_IMEI, imei_info); | |
2160 mfwFree((U8*)imei_info,sizeof(T_MFW_IMEI)); | |
2161 } | |
2162 #else | |
2163 imei_info.error = MFW_SS_ERROR; | |
2164 ss_signal(E_SS_IMEI, &imei_info); | |
2165 #endif | |
2166 break; | |
2167 default: | |
2168 break; | |
2169 } | |
2170 } | |
2171 | |
2172 | |
2173 /* | |
2174 +--------------------------------------------------------------------+ | |
2175 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
2176 | STATE : code ROUTINE: ss_set_clck | | |
2177 +--------------------------------------------------------------------+ | |
2178 | |
2179 | |
2180 PURPOSE : This function execute the facility lock command. | |
2181 | |
2182 */ | |
2183 /*a0393213 warnings removal - T_ACI_CLCK_FAC changed to T_ACI_FAC as a result of ACI enum change*/ | |
2184 T_MFW ss_set_clck(T_ACI_FAC fac, | |
2185 T_ACI_CLCK_MOD mode, | |
2186 CHAR *passwd, | |
2187 T_ACI_CLASS class_type, | |
2188 UBYTE modul) | |
2189 { | |
2190 TRACE_EVENT("ss_set_clck()"); | |
2191 | |
2192 clck_flag = modul; | |
2193 | |
2194 if (sAT_PlusCLCK(CMD_SRC_LCL, fac,mode, passwd, class_type) != AT_EXCT) | |
2195 return MFW_SS_FAIL; | |
2196 return MFW_SS_OK; | |
2197 } | |
2198 | |
2199 | |
2200 /* | |
2201 +--------------------------------------------------------------------+ | |
2202 | PROJECT : MMI-Framework (8417) MODULE : MFW_SS | | |
2203 | STATE : code ROUTINE : ss_ok_clck | | |
2204 +--------------------------------------------------------------------+ | |
2205 | |
2206 PURPOSE : The executing of the facility lock command is successful. | |
2207 | |
2208 */ | |
2209 | |
2210 void ss_ok_clck() | |
2211 { | |
2212 TRACE_FUNCTION("ss_ok_clck()"); | |
2213 | |
2214 switch (clck_flag) | |
2215 { | |
2216 case MFW_PHB: | |
2217 phb_ok_clck(); | |
2218 break; | |
2219 case MFW_SIM_CPIND: | |
2220 sim_ok_cpind(); | |
2221 break; | |
2222 case MFW_SIM_CPINE: | |
2223 sim_ok_cpine(); | |
2224 break; | |
2225 } | |
2226 clck_flag = MFW_MODUL_UNKNOWN; | |
2227 } | |
2228 | |
2229 | |
2230 /* | |
2231 +--------------------------------------------------------------------+ | |
2232 | PROJECT : MMI-Framework (8417) MODULE : MFW_SS | | |
2233 | STATE : code ROUTINE : ss_error_clck | | |
2234 +--------------------------------------------------------------------+ | |
2235 | |
2236 PURPOSE : The executing of the facility lock command is failed. | |
2237 | |
2238 */ | |
2239 | |
2240 void ss_error_clck() | |
2241 { | |
2242 TRACE_FUNCTION("ss_error_clck()"); | |
2243 | |
2244 switch (clck_flag) | |
2245 { | |
2246 case MFW_PHB: | |
2247 phb_error_clck(); | |
2248 break; | |
2249 case MFW_SIM_CPIND: | |
2250 sim_error_cpind(); | |
2251 break; | |
2252 case MFW_SIM_CPINE: | |
2253 sim_error_cpine(); | |
2254 break; | |
2255 } | |
2256 clck_flag = MFW_MODUL_UNKNOWN; | |
2257 } | |
2258 | |
2259 | |
2260 /* | |
2261 +--------------------------------------------------------------------+ | |
2262 | PROJECT: MMI-Framework (8417) MODULE: MFW_DMY | | |
2263 | STATE : code ROUTINE: ss_send_ussd | | |
2264 +--------------------------------------------------------------------+ | |
2265 | |
2266 | |
2267 PURPOSE : Send USSD string. | |
2268 Note: ASCII is not allowed to use. | |
2269 | |
2270 */ | |
2271 | |
2272 T_MFW ss_send_ussd(T_MFW_SS_USSD *ussd_info) | |
2273 { | |
2274 T_ACI_USSD_DATA str; | |
2275 T_ACI_RETURN res; | |
2276 | |
2277 TRACE_FUNCTION("ss_send_ussd()"); | |
2278 | |
2279 if (!ussd_info->len OR !ussd_info->ussd) | |
2280 return MFW_SS_FAIL; | |
2281 | |
2282 if (ussd_info->dcs == MFW_ASCII) | |
2283 return MFW_SS_FAIL; | |
2284 | |
2285 if (ussd_info->len > MAX_USSD_LEN) | |
2286 { | |
2287 str.len = MAX_USSD_LEN; | |
2288 memcpy(str.data, ussd_info->ussd, MAX_USSD_LEN); | |
2289 } | |
2290 else | |
2291 { | |
2292 str.len = ussd_info->len; | |
2293 memcpy(str.data, ussd_info->ussd, ussd_info->len); | |
2294 } | |
2295 res = sAT_PlusCUSD(CMD_SRC_LCL, &str, (SHORT)ussd_info->dcs); | |
2296 if ((res != AT_EXCT) AND (res != AT_CMPL)) | |
2297 return MFW_SS_FAIL; | |
2298 | |
2299 return MFW_SS_OK; | |
2300 } | |
2301 | |
2302 | |
2303 | |
2304 /* | |
2305 +--------------------------------------------------------------------+ | |
2306 | PROJECT: MMI-Framework (8417) MODULE: MFW_DMY | | |
2307 | STATE : code ROUTINE: rAT_PlusCUSD | | |
2308 +--------------------------------------------------------------------+ | |
2309 | |
2310 | |
2311 PURPOSE : Notify or response for USSD from ACI | |
2312 | |
2313 */ | |
2314 | |
2315 void rAT_PlusCUSD(T_ACI_CUSD_MOD m, T_ACI_USSD_DATA *ussd, SHORT dcs) | |
2316 { | |
2317 | |
2318 TRACE_FUNCTION("rAT_PlusCUSD()"); | |
2319 | |
2320 //Dec 16, 2005 OMAPS00053316 x0018858 | |
2321 //Added the NullCheck to ensure that we dont access the elements when the pointer is NULL. | |
2322 //Begin OMAPS00053316 | |
2323 | |
2324 if(ussd != NULL) | |
2325 { | |
2326 ussd_info.len = ussd->len; | |
2327 memcpy(ussd_info.ussd, ussd->data, sizeof(ussd_info.ussd)); | |
2328 } | |
2329 else | |
2330 { | |
2331 ussd_info.len = 0; | |
2332 memset(ussd_info.ussd, 0x00, sizeof(ussd_info.ussd)); | |
2333 } | |
2334 //End OMAPS00053316 | |
2335 ussd_info.dcs = (T_MFW_DCS)dcs; | |
2336 | |
2337 if (m==CUSD_MOD_TerminatedByNetwork || | |
2338 m== CUSD_MOD_OperationNotSupported || | |
2339 m==CUSD_MOD_NetworkTimeout) | |
2340 ussd_info.error = MFW_SS_ERROR; | |
2341 else | |
2342 ussd_info.error = MFW_SS_NO_ERROR; | |
2343 | |
2344 /* Jun 30, 2006 REF : OMAPS00083503 R.Prabakar | |
2345 Description : When USSD string is sent, MMI shows requesting screen forever | |
2346 Solution : Some cases in rAT_PlusCUSD weren't handled. They are handled now*/ | |
2347 if (m == CUSD_MOD_YesActReq) | |
2348 ss_signal(E_SS_USSD_REQ, &ussd_info); | |
2349 if (m == CUSD_MOD_NoActReq || m==CUSD_MOD_TerminatedByNetwork || m== CUSD_MOD_OperationNotSupported || m==CUSD_MOD_NetworkTimeout) | |
2350 ss_signal(E_SS_USSD_CNF, &ussd_info); | |
2351 } | |
2352 | |
2353 | |
2354 /* | |
2355 +--------------------------------------------------------------------+ | |
2356 | PROJECT: MMI-Framework (8417) MODULE: MFW_DMY | | |
2357 | STATE : code ROUTINE: ss_ok_ussd | | |
2358 +--------------------------------------------------------------------+ | |
2359 | |
2360 | |
2361 PURPOSE : USSD process is successful. | |
2362 | |
2363 */ | |
2364 | |
2365 void ss_ok_ussd(T_ACI_AT_CMD cmdId) | |
2366 { | |
2367 TRACE_FUNCTION("ss_ok_ussd()"); | |
2368 | |
2369 if (cmdId == (T_ACI_AT_CMD)KSD_CMD_USSD) /*a0393213 typecast done to remove lint warning*/ | |
2370 { | |
2371 ussd_info.error = MFW_SS_NO_ERROR; | |
2372 ss_signal(E_SS_USSD_CNF, &ussd_info); | |
2373 } | |
2374 } | |
2375 | |
2376 | |
2377 /* | |
2378 +--------------------------------------------------------------------+ | |
2379 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
2380 | STATE : code ROUTINE: ss_error_ussd | | |
2381 +--------------------------------------------------------------------+ | |
2382 | |
2383 | |
2384 PURPOSE : USSD process is failed. | |
2385 | |
2386 */ | |
2387 | |
2388 void ss_error_ussd(T_ACI_AT_CMD cmdId, T_ACI_CME_ERR reason) | |
2389 { | |
2390 TRACE_FUNCTION("ss_error_ussd()"); | |
2391 | |
2392 // ussd_info.error = ss_cvtErrCode(reason); | |
2393 ss_signal(E_SS_USSD_CNF, &ussd_info); | |
2394 } | |
2395 | |
2396 /* | |
2397 +---------------------------------------------------------------------+ | |
2398 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
2399 | STATE : code ROUTINE: ss_abort_transaction | | |
2400 +---------------------------------------------------------------------+ | |
2401 | |
2402 | |
2403 PURPOSE : Abort executing of SS transaction | |
2404 | |
2405 */ | |
2406 | |
2407 T_MFW ss_abort_transaction(void) | |
2408 { | |
2409 TRACE_FUNCTION("ss_abort_transaction()"); | |
2410 | |
2411 if (sAT_Abort(CMD_SRC_LCL, AT_CMD_CUSD) EQ AT_CMPL) | |
2412 return TRUE; | |
2413 else | |
2414 { | |
2415 if (sAT_Abort(CMD_SRC_LCL, AT_CMD_D) EQ AT_CMPL) | |
2416 return TRUE; | |
2417 } | |
2418 return FALSE; | |
2419 } | |
2420 | |
2421 | |
2422 /* | |
2423 +--------------------------------------------------------------------+ | |
2424 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
2425 | STATE : code ROUTINE: ss_set_cug | | |
2426 +--------------------------------------------------------------------+ | |
2427 | |
2428 | |
2429 PURPOSE : set parameter of close user group | |
2430 | |
2431 */ | |
2432 T_MFW_SS_RETURN ss_set_cug (T_MFW_SS_CUG_PARA *cug_param) | |
2433 { | |
2434 T_ACI_CCUG_MOD cug_mode = CCUG_MOD_NotPresent; | |
2435 T_ACI_CCUG_IDX cug_index = CCUG_IDX_NotPresent; | |
2436 T_ACI_CCUG_INFO cug_info = CCUG_INFO_NotPresent; | |
2437 | |
2438 TRACE_FUNCTION("ss_set_cug()"); | |
2439 | |
2440 /* check cug mode */ | |
2441 switch(cug_param->mode) | |
2442 { | |
2443 case MFW_SS_CUG_TMP_DISABLE: | |
2444 cug_mode = CCUG_MOD_DisableTmp; | |
2445 break; | |
2446 case MFW_SS_CUG_TMP_ENABLE: | |
2447 cug_mode = CCUG_MOD_EnableTmp; /* enable to control cug info */ | |
2448 break; | |
2449 default: /* ACI keep last valid value */ | |
2450 break; | |
2451 } | |
2452 /* check cug index */ | |
2453 switch(cug_param->index) | |
2454 { | |
2455 case MFW_SS_CUG_INDEX0: | |
2456 cug_index = CCUG_IDX_0; | |
2457 break; | |
2458 case MFW_SS_CUG_INDEX1: | |
2459 cug_index = CCUG_IDX_1; | |
2460 break; | |
2461 case MFW_SS_CUG_INDEX2: | |
2462 cug_index = CCUG_IDX_2; | |
2463 break; | |
2464 case MFW_SS_CUG_INDEX3: | |
2465 cug_index = CCUG_IDX_3; | |
2466 break; | |
2467 case MFW_SS_CUG_INDEX4: | |
2468 cug_index = CCUG_IDX_4; | |
2469 break; | |
2470 case MFW_SS_CUG_INDEX5: | |
2471 cug_index = CCUG_IDX_5; | |
2472 break; | |
2473 case MFW_SS_CUG_INDEX6: | |
2474 cug_index = CCUG_IDX_6; | |
2475 break; | |
2476 case MFW_SS_CUG_INDEX7: | |
2477 cug_index = CCUG_IDX_7; | |
2478 break; | |
2479 case MFW_SS_CUG_INDEX8: | |
2480 cug_index = CCUG_IDX_8; | |
2481 break; | |
2482 case MFW_SS_CUG_INDEX9: | |
2483 cug_index = CCUG_IDX_9; | |
2484 break; | |
2485 case MFW_SS_CUG_NO_INDEX: | |
2486 cug_index = CCUG_IDX_No; /* preferred CUG taken from subscriber data */ | |
2487 break; | |
2488 default: /* ACI keep last valid value */ | |
2489 break; | |
2490 } | |
2491 | |
2492 /* check cug info */ | |
2493 switch(cug_param->info) | |
2494 { | |
2495 case MFW_SS_CUG_SUPP_OA: | |
2496 cug_info = CCUG_INFO_SuppOa; /* suppress outgoing access */ | |
2497 break; | |
2498 case MFW_SS_CUG_SUPP_PREF: | |
2499 cug_info = CCUG_INFO_SuppPrefCug; /* suppress preferential closed user group */ | |
2500 break; | |
2501 case MFW_SS_CUG_SUPP_BOTH: | |
2502 cug_info = CCUG_INFO_SuppBoth; /* suppress outgoing access and preferential cug */ | |
2503 break; | |
2504 case MFW_SS_CUG_INFO_NO: /* no cug info */ | |
2505 cug_info = CCUG_INFO_No; | |
2506 break; | |
2507 default: /* ACI keep last valid value */ | |
2508 break; | |
2509 } | |
2510 if(sAT_PlusCCUG(CMD_SRC_LCL,cug_mode,cug_index,cug_info) EQ AT_CMPL) /* set in ACI cug parameters */ | |
2511 return MFW_SS_OK; | |
2512 else | |
2513 return MFW_SS_FAIL; | |
2514 } | |
2515 | |
2516 /* | |
2517 +--------------------------------------------------------------------+ | |
2518 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
2519 | STATE : code ROUTINE: ss_get_cug | | |
2520 +--------------------------------------------------------------------+ | |
2521 | |
2522 | |
2523 PURPOSE : get parameter of close user group | |
2524 | |
2525 */ | |
2526 | |
2527 T_MFW_SS_RETURN ss_get_cug(T_MFW_SS_CUG_PARA *cug_param) | |
2528 { | |
2529 T_ACI_CCUG_MOD cug_mode; | |
2530 T_ACI_CCUG_IDX cug_index; | |
2531 T_ACI_CCUG_INFO cug_info; | |
2532 | |
2533 cug_param->mode = MFW_SS_CUG_MODE_Not_Present; | |
2534 cug_param->index = MFW_SS_CUG_INDEX_Not_Present; | |
2535 cug_param->info = MFW_SS_CUG_INFO_Not_Present; | |
2536 | |
2537 TRACE_FUNCTION("ss_get_cug()"); | |
2538 | |
2539 if(qAT_PlusCCUG(CMD_SRC_LCL,&cug_mode,&cug_index,&cug_info) NEQ AT_CMPL) /* get cug parameters of ACI */ | |
2540 return MFW_SS_FAIL; | |
2541 else | |
2542 { | |
2543 cug_param->mode = (T_MFW_SS_CUG_MODE)cug_mode; | |
2544 cug_param->index = (T_MFW_SS_CUG_INDEX)cug_index; | |
2545 cug_param->info = (T_MFW_SS_CUG_INFO)cug_info; | |
2546 return MFW_SS_OK; | |
2547 } | |
2548 } | |
2549 //PATCH TB 1309 | |
2550 /* | |
2551 +--------------------------------------------------------------------+ | |
2552 | PROJECT: MMI-Framework (8417) MODULE: MFW_SS | | |
2553 | STATE : code ROUTINE: ss_command_abort | | |
2554 +--------------------------------------------------------------------+ | |
2555 | |
2556 | |
2557 PURPOSE : | |
2558 | |
2559 */ | |
2560 T_MFW ss_command_abort(void) | |
2561 { | |
2562 TRACE_FUNCTION ("ss_command_abort()"); | |
2563 | |
2564 // Abort SS transaction. | |
2565 // Any SS AT_CMD will clear all SS (any) transaction(s) | |
2566 if (sAT_Abort(CMD_SRC_LCL, AT_CMD_CUSD) == AT_CMPL) | |
2567 return TRUE; | |
2568 else | |
2569 return FALSE; | |
2570 } | |
2571 //END PATCH TB | |
2572 //CQ-16432 start | |
2573 void ss_sat_passwdReqd(T_ACI_AT_CMD cmdId, T_ACI_CME_ERR err) | |
2574 { | |
2575 TRACE_FUNCTION("ss_sat_passwdReqd"); | |
2576 ss_signal(E_SS_SAT_CPWD,&cmdId); | |
2577 return; | |
2578 } | |
2579 //CQ-16432 end |