FreeCalypso > hg > fc-magnetite
comparison src/ui3/mfw/mfw_cphs.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 | d7a40e34fee0 |
comparison
equal
deleted
inserted
replaced
419:59143cd42ec7 | 420:e8ddbb0837ed |
---|---|
1 /* | |
2 +--------------------------------------------------------------------+ | |
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_cphs.c $| | |
4 | $Author:: VO $Revision:: 1 $| | |
5 | CREATED: 14.7.00 $Modtime:: $| | |
6 | STATE : code | | |
7 +--------------------------------------------------------------------+ | |
8 | |
9 MODULE : MFW_CPHS | |
10 | |
11 PURPOSE : This modul contains CPHS management functions. | |
12 | |
13 | |
14 $History:: mfw_cphs.c $ | |
15 | |
16 June 27,2007 OMAPS00134788 x0066814(Geetha) | |
17 Description: EXT1 record not appende to CHPHS Voice Mail Number (6F17) though referenced | |
18 Solution: Added a function to read the EXT1 records for mailbox number. | |
19 Added a condition in cphs_read_mbn() to check whether EXT1 is present. | |
20 | |
21 Nov 27, 2006 OMAPS00098359 a0393213(R.Prabakar) | |
22 Description: CPHS 4.2 : Call Divert doesn't work properly for Line 2 | |
23 | |
24 Oct 30 2006, OMAPS00098881 x0039928(sumanth) | |
25 Removal of power variant | |
26 | |
27 May 30, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar) | |
28 Description : CPHS Call Forwarding feature implementation | |
29 | |
30 May 30, 2006 DR: OMAPS00070657 x0pleela | |
31 Description: CPHS feature on Locosto-Lite | |
32 Solution: For ALS feature, | |
33 a) Added the definition for the new function "mfw_cphs_get_als_info()" | |
34 | |
35 May 18, 2006 DR: OMAPS00070657 x0pleela | |
36 Description: CPHS feature on Locosto-Lite | |
37 Solution: For VMWI feature, | |
38 a) A new function "sendCPWIEvt" is defined to set the voice mail indication | |
39 if there are any voice mails | |
40 | |
41 Jan 12, 2006 OMAPS00062632 x0018858 | |
42 Description: The differnace in the type of the data passed to the function cphs_read_information() | |
43 is causing an incorrect value being received as the output. | |
44 Solution: The errcode being passed to the function has been modified to USHORT | |
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: Static allocation of mbnData is replaced with dynamic allocation | |
50 and deallocation | |
51 | |
52 Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
53 Bug:Clenup of sprintf used for tracing | |
54 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX | |
55 | |
56 */ | |
57 | |
58 #define ENTITY_MFW | |
59 | |
60 #include <string.h> | |
61 #include <stdio.h> | |
62 #include <stdlib.h> | |
63 #include <limits.h> | |
64 | |
65 #if defined (NEW_FRAME) | |
66 | |
67 #include "typedefs.h" | |
68 #include "vsi.h" | |
69 #include "pei.h" | |
70 #include "custom.h" | |
71 #include "gsm.h" | |
72 | |
73 #else | |
74 | |
75 #include "STDDEFS.H" | |
76 #include "custom.h" | |
77 #include "gsm.h" | |
78 #include "vsi.h" | |
79 | |
80 #endif | |
81 | |
82 #include "mfw_mfw.h" | |
83 #include "mfw_sim.h" | |
84 #include "mfw_nm.h" | |
85 #include "mfw_simi.h" | |
86 #include "mfw_phb.h" | |
87 #include "mfw_phbi.h" | |
88 #include "mfw_cphs.h" | |
89 #include "mfw_cphsi.h" | |
90 #include "mfw_win.h" | |
91 #include "mfw_cm.h" | |
92 #include "mfw_ss.h" | |
93 #include "mfw_ffs.h" | |
94 | |
95 #include "ksd.h" | |
96 #include "psa.h" | |
97 | |
98 #ifdef SIM_TOOLKIT | |
99 #include "mfw_sat.h" | |
100 #endif | |
101 | |
102 #if defined (FAX_AND_DATA) | |
103 #include "aci_fd.h" | |
104 #endif | |
105 | |
106 #include "cmh.h" | |
107 #include "phb.h" | |
108 #include "cmh_phb.h" | |
109 #include "psa_sim.h" | |
110 | |
111 #ifndef PCM_2_FFS | |
112 #include "pcm.h" | |
113 #include "mfw_ffs.h" | |
114 #endif | |
115 | |
116 //x0pleela 11 june, 2006 DR: OMAPS00079692 | |
117 //Including this header to get the ACI's VC Status and update MFW VC staus variable | |
118 #ifdef FF_CPHS | |
119 #include "Cphs.h" | |
120 #endif | |
121 | |
122 EXTERN MfwHdr * current_mfw_elem; | |
123 static int cphsCommand (U32 cmd, void *h); /* handle win commands */ | |
124 | |
125 /* event parameter define */ | |
126 static T_MFW_CPHS_OP_NAME opName; | |
127 static T_MFW_CPHS_VC_NUM mbNum; | |
128 static T_MFW_CPHS_VC_STAT mbStatus; | |
129 static T_MFW_CPHS_DV_STAT dvStatus; | |
130 static T_MFW_CPHS_ALS_STATUS alsStatus; | |
131 static T_MFW_CPHS_CSP csProfile; | |
132 static T_MFW_CPHS_INFONUM_LIST numList; | |
133 static T_MFW_CPHS_INFONUM_ENTRY infoEntry; | |
134 #ifdef FF_CPHS_REL4 | |
135 static T_MFW_CPHS_MSP_INFO mspinfo; | |
136 T_MFW_CPHS_REL4_MWIS mwis_stat[4]; | |
137 #endif | |
138 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
139 // the optimisation is placed under a flag, a pointer variable is defined | |
140 // instead of the static array, which is allocated and deallocated | |
141 #ifdef FF_MMI_OPTIM | |
142 //x0pleela 14 June, 2006 DR: OMAPS00080549 | |
143 //changed the size of the Mail box number to avoid SIM write operation to overwrite other memory locations | |
144 #ifdef FF_CPHS | |
145 #if defined ( TI_PS_FFS_PHB) || defined(PHONEBOOK_EXTENSION) | |
146 #define MAX_MAIL_BOX_NUMBER 120 | |
147 #else//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION | |
148 #define MAX_MAIL_BOX_NUMBER 120 | |
149 #endif//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION | |
150 #else //FF_CPHS | |
151 #define MAX_MAIL_BOX_NUMBER 120 | |
152 #endif //FF_CPHS | |
153 UBYTE *mbnData; | |
154 #else //FF_MMI_OPTIM | |
155 //x0pleela 14 June, 2006 DR: OMAPS00080549 | |
156 #ifdef FF_CPHS | |
157 #if defined ( TI_PS_FFS_PHB) || defined(PHONEBOOK_EXTENSION) | |
158 static UBYTE mbnData[120]; // it should be allocated dynamically. | |
159 #else//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION | |
160 static UBYTE mbnData[120]; // it should be allocated dynamically. | |
161 #endif//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION | |
162 #else //FF_CPHS | |
163 static UBYTE mbnData[120]; // it should be allocated dynamically. | |
164 #endif //FF_CPHS | |
165 #endif //FF_MMI_OPTIM | |
166 | |
167 /* PATCH VO 22.01.01 */ | |
168 static UBYTE mbsData[MFW_CPHS_MBS_SIZE]; // it should be allocated dynamically. | |
169 static UBYTE dvData[MFW_CPHS_CFF_SIZE]; // it should be allocated dynamically. | |
170 /* PATCH VO 22.01.01 end */ | |
171 static T_MFW_CPHS_READ_SIM_ENTRY read_sim_entry;//MC | |
172 /* variable define */ | |
173 static T_MFW_CPHS_STATUS cphsStatus; | |
174 static UBYTE cphsPhase; | |
175 static UBYTE cphsServTab[CPHS_SERVICE_TABLE]; | |
176 static UBYTE maxRec; | |
177 /* PATCH JPS 16.01.01: store mailbox number entry */ | |
178 static T_MFW_CPHS_ENTRY MbnEntry; | |
179 /* PATCH JPS 16.01.01 END */ | |
180 static T_MFW_CPHS_ENTRY *vcEntry; | |
181 static UBYTE simStatus; | |
182 static UBYTE alsData; | |
183 static UBYTE idxLevel; | |
184 static UBYTE startIdx; | |
185 static UBYTE cphsUpdate = FALSE; | |
186 static UINT16 cphsPrevRead = 0; | |
187 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ | |
188 static UBYTE curr_recNr; | |
189 static void cphs_read_ext1(SHORT table_id); | |
190 //Added by Muthu Raja For PCM Reolacement | |
191 | |
192 #ifdef PCM_2_FFS | |
193 #define PSPDF_MBN_ID "/PCM/MBN" /* Mailbox Numbers */ | |
194 #endif | |
195 | |
196 static UBYTE ubCphsMbExtRecNo = 0; | |
197 static SHORT sFreeRec = 0; | |
198 static UBYTE ubCurrExtRcWrite = 0; | |
199 static UBYTE ubFlushRecords = 0; | |
200 static UBYTE ubExtRecData[200]; | |
201 static UBYTE flush_data[13]; | |
202 | |
203 | |
204 void FFS_log_message(char *LogMsg,...); | |
205 #define TRACE_FUNCTION FFS_log_message | |
206 #define TRACE_FUNCTION_P1 FFS_log_message | |
207 #define TRACE_EVENT FFS_log_message | |
208 #define TRACE_EVENT_P1 FFS_log_message | |
209 #define TRACE_EVENT_P2 FFS_log_message | |
210 #define TRACE_EVENT_P3 FFS_log_message | |
211 #define TRACE_EVENT_P4 FFS_log_message | |
212 | |
213 void FFS_log_message(char *LogMsg,...) | |
214 { | |
215 fd_t fd= -1; | |
216 char log_ffs_buf[256]; | |
217 va_list varpars; | |
218 va_start (varpars, LogMsg); | |
219 vsprintf(log_ffs_buf,LogMsg,varpars); | |
220 va_end (varpars); | |
221 fd = ffs_open((const char*)"/ffslog", FFS_O_APPEND | FFS_O_WRONLY ); | |
222 if(fd < 0) | |
223 fd=ffs_open((const char*)"/ffslog", FFS_O_CREATE |FFS_O_WRONLY ); | |
224 if(fd > 0) | |
225 { | |
226 strcat(log_ffs_buf, "\n"); | |
227 ffs_write(fd, log_ffs_buf, strlen(log_ffs_buf)); | |
228 ffs_close(fd); | |
229 } | |
230 } | |
231 | |
232 | |
233 /* | |
234 +--------------------------------------------------------------------+ | |
235 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
236 | STATE : code ROUTINE: cphs_init | | |
237 +--------------------------------------------------------------------+ | |
238 | |
239 | |
240 PURPOSE : initialize for CPHS management | |
241 | |
242 */ | |
243 | |
244 void cphs_init(void) | |
245 { | |
246 TRACE_FUNCTION("cphs_init()"); | |
247 | |
248 cphsStatus = CPHS_NotPresent; | |
249 simStatus = MFW_SIMOP_UNKNOWN; | |
250 mfwCommand[MfwTypCphs] = (MfwCb) cphsCommand; | |
251 } | |
252 | |
253 | |
254 /* | |
255 +--------------------------------------------------------------------+ | |
256 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
257 | STATE : code ROUTINE: cphs_exit | | |
258 +--------------------------------------------------------------------+ | |
259 | |
260 | |
261 PURPOSE : | |
262 | |
263 */ | |
264 | |
265 void cphs_exit(void) | |
266 { | |
267 TRACE_FUNCTION ("cphs_exit()"); | |
268 } | |
269 | |
270 | |
271 /* | |
272 +--------------------------------------------------------------------+ | |
273 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
274 | STATE : code ROUTINE: cphs_create | | |
275 +--------------------------------------------------------------------+ | |
276 | |
277 | |
278 PURPOSE : create event for CPHS management | |
279 | |
280 */ | |
281 | |
282 MfwHnd cphs_create (MfwHnd hWin, MfwEvt event, MfwCb cbfunc) | |
283 { | |
284 MfwHdr *hdr; | |
285 T_MFW_CPHS *cphs_para; | |
286 MfwHdr *insert_status=0; | |
287 | |
288 TRACE_FUNCTION("cphs_create()"); | |
289 | |
290 hdr = (MfwHdr *) mfwAlloc(sizeof(MfwHdr)); | |
291 cphs_para = (T_MFW_CPHS *) mfwAlloc(sizeof(T_MFW_CPHS)); | |
292 | |
293 if (!hdr || !cphs_para) | |
294 { | |
295 TRACE_ERROR("ERROR: cphs_create() Mem Alloc Failed."); | |
296 | |
297 if(hdr) | |
298 mfwFree((U8*)hdr,sizeof(MfwHdr)); | |
299 | |
300 if(cphs_para) | |
301 mfwFree((U8*)cphs_para,sizeof(T_MFW_CPHS)); | |
302 | |
303 return FALSE; | |
304 } | |
305 | |
306 cphs_para->emask = event; | |
307 cphs_para->handler = cbfunc; | |
308 | |
309 hdr->data = cphs_para; /* store parameter in node */ | |
310 hdr->type = MfwTypCphs; /* type of event handler */ | |
311 | |
312 insert_status= mfwInsert((MfwHdr *) hWin,hdr); | |
313 if(!insert_status) | |
314 { | |
315 TRACE_ERROR("ERROR: cphs_create() Failed to Install Handler. "); | |
316 mfwFree((U8*)hdr,sizeof(MfwHdr)); | |
317 mfwFree((U8*)cphs_para,sizeof(T_MFW_CPHS)); | |
318 return 0; | |
319 } | |
320 return insert_status; | |
321 } | |
322 | |
323 /* | |
324 +--------------------------------------------------------------------+ | |
325 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
326 | STATE : code ROUTINE: cphs_delete | | |
327 +--------------------------------------------------------------------+ | |
328 | |
329 | |
330 PURPOSE : delete a event for CPHS management | |
331 | |
332 */ | |
333 | |
334 MfwRes cphs_delete (MfwHnd h) | |
335 { | |
336 TRACE_FUNCTION("cphs_delete()"); | |
337 | |
338 if (!h || !((MfwHdr *) h)->data) | |
339 return MfwResIllHnd; | |
340 | |
341 if (!mfwRemove((MfwHdr *) h)) | |
342 return MfwResIllHnd; | |
343 | |
344 mfwFree(((MfwHdr *) h)->data,sizeof(T_MFW_CPHS)); | |
345 mfwFree(h,sizeof(MfwHdr)); | |
346 | |
347 return MfwResOk; | |
348 } | |
349 | |
350 /* | |
351 +--------------------------------------------------------------------+ | |
352 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
353 | STATE : code ROUTINE : cphs_sign_exec | | |
354 +--------------------------------------------------------------------+ | |
355 | |
356 PURPOSE : dispatch CPHS management signal | |
357 | |
358 */ | |
359 | |
360 static int cphs_sign_exec (MfwHdr *cur_elem, MfwEvt event, | |
361 T_MFW_CPHS_PARA * para) | |
362 { | |
363 TRACE_FUNCTION("cphs_sign_exec()"); | |
364 | |
365 while (cur_elem) | |
366 { | |
367 if (cur_elem->type == MfwTypCphs) | |
368 { | |
369 T_MFW_CPHS *cphs_data; | |
370 | |
371 cphs_data = (T_MFW_CPHS *) cur_elem->data; | |
372 if (cphs_data->emask & event) | |
373 { | |
374 cphs_data->event = event; | |
375 TRACE_EVENT_P1("cphs_sign_exec():event=%d",event); | |
376 switch (event) | |
377 { | |
378 case E_CPHS_IND: | |
379 memcpy(&cphs_data->para.stat, para, sizeof(T_MFW_CPHS_STATUS)); | |
380 break; | |
381 case E_CPHS_OP_NAME: | |
382 memcpy(&cphs_data->para.oper_name, para, sizeof(T_MFW_CPHS_OP_NAME)); | |
383 break; | |
384 case E_CPHS_GET_VC_NUM: | |
385 memcpy(&cphs_data->para.vc_entry, para, sizeof(T_MFW_CPHS_VC_NUM)); | |
386 break; | |
387 case E_CPHS_SET_VC_NUM: | |
388 memcpy(&cphs_data->para.result, para, sizeof(UBYTE)); | |
389 break; | |
390 case E_CPHS_GET_VC_STAT: | |
391 memcpy(&cphs_data->para.vc_status, para, sizeof(T_MFW_CPHS_VC_STAT)); | |
392 break; | |
393 case E_CPHS_SET_VC_STAT: | |
394 memcpy(&cphs_data->para.result, para, sizeof(UBYTE)); | |
395 break; | |
396 case E_CPHS_GET_DV_STAT: | |
397 memcpy(&cphs_data->para.dv_status, para, sizeof(T_MFW_CPHS_DV_STAT)); | |
398 break; | |
399 case E_CPHS_SET_DV_STAT: | |
400 memcpy(&cphs_data->para.result, para, sizeof(UBYTE)); | |
401 break; | |
402 case E_CPHS_GET_ALS_STATUS: | |
403 memcpy(&cphs_data->para.als_status, para, sizeof(T_MFW_CPHS_ALS_STATUS)); | |
404 break; | |
405 case E_CPHS_SET_LINE: | |
406 memcpy(&cphs_data->para.result, para, sizeof(UBYTE)); | |
407 break; | |
408 case E_CPHS_GET_CSP: | |
409 memcpy(&cphs_data->para.csp, para, sizeof(T_MFW_CPHS_CSP)); | |
410 break; | |
411 case E_CPHS_GET_INFO_LIST: | |
412 memcpy(&cphs_data->para.num_list, para, sizeof(T_MFW_CPHS_INFONUM_LIST)); | |
413 break; | |
414 case E_CPHS_GET_INFO_NUM: | |
415 memcpy(&cphs_data->para.info_entry, para, sizeof(T_MFW_CPHS_INFONUM_ENTRY)); | |
416 break; | |
417 case E_CPHS_GET_SIM_FIELD://MC added for generic read function | |
418 memcpy(&cphs_data->para.read_sim_entry, para, sizeof(T_MFW_CPHS_READ_SIM_ENTRY)); | |
419 break; | |
420 case E_CPHS_SET_SIM_FIELD://MC added for generic read function | |
421 memcpy(&cphs_data->para.read_sim_entry, para, sizeof(T_MFW_CPHS_READ_SIM_ENTRY)); | |
422 break; | |
423 | |
424 | |
425 } | |
426 if (cphs_data->handler) | |
427 { | |
428 // store current mfw elem | |
429 current_mfw_elem = cur_elem; | |
430 | |
431 if ((*(cphs_data->handler)) (cphs_data->event, (void *) &cphs_data->para)) | |
432 return TRUE; | |
433 } | |
434 } | |
435 } | |
436 cur_elem = cur_elem->next; | |
437 } | |
438 | |
439 return FALSE; | |
440 } | |
441 | |
442 /* | |
443 +--------------------------------------------------------------------+ | |
444 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
445 | STATE : code ROUTINE : cphs_signal | | |
446 +--------------------------------------------------------------------+ | |
447 | |
448 PURPOSE : Send a signal | |
449 | |
450 */ | |
451 | |
452 static void cphs_signal (MfwEvt event, void *para) | |
453 { | |
454 /*MC, SPR 1389, we have to enable the display whenever | |
455 we send an event up to the MMI*/ | |
456 | |
457 UBYTE temp=0; | |
458 #ifndef FF_POWER_MANAGEMENT | |
459 temp = dspl_Enable(0); | |
460 #else | |
461 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
462 display is enabled only when lcd refresh is needed*/ | |
463 if(FFS_flashData.refresh == 1) | |
464 temp = dspl_Enable(0); | |
465 #endif | |
466 | |
467 TRACE_FUNCTION("cphs_signal()"); | |
468 | |
469 if (mfwSignallingMethod EQ 0) | |
470 { | |
471 if (mfwFocus) | |
472 if (cphs_sign_exec(mfwFocus,event,para)) | |
473 { | |
474 #ifndef FF_POWER_MANAGEMENT | |
475 dspl_Enable(temp);/*MC, SPR 1389*/ | |
476 #else | |
477 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
478 display is enabled only when lcd refresh is needed*/ | |
479 if(FFS_flashData.refresh == 1) | |
480 dspl_Enable(temp);/*MC, SPR 1389*/ | |
481 #endif | |
482 return; | |
483 } | |
484 if (mfwRoot) | |
485 cphs_sign_exec(mfwRoot,event,para); | |
486 } | |
487 else | |
488 { | |
489 MfwHdr * h = 0; | |
490 | |
491 /* | |
492 * Focus set, then start here | |
493 */ | |
494 if (mfwFocus) | |
495 h = mfwFocus; | |
496 /* | |
497 * Focus not set, then start root | |
498 */ | |
499 if (!h) | |
500 h = mfwRoot; | |
501 | |
502 /* | |
503 * No elements available, return | |
504 */ | |
505 | |
506 while (h) | |
507 { | |
508 /* | |
509 * Signal consumed, then return | |
510 */ | |
511 if (cphs_sign_exec (h, event, para)) | |
512 { | |
513 #ifndef FF_POWER_MANAGEMENT | |
514 dspl_Enable(temp);/*MC, SPR 1389*/ | |
515 #else | |
516 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
517 display is enabled only when lcd refresh is needed*/ | |
518 if(FFS_flashData.refresh == 1) | |
519 dspl_Enable(temp);/*MC, SPR 1389*/ | |
520 #endif | |
521 return; | |
522 } | |
523 | |
524 /* | |
525 * All windows tried inclusive root | |
526 */ | |
527 if (h == mfwRoot) | |
528 { | |
529 #ifndef FF_POWER_MANAGEMENT | |
530 dspl_Enable(temp);/*MC, SPR 1389*/ | |
531 #else | |
532 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
533 display is enabled only when lcd refresh is needed*/ | |
534 if(FFS_flashData.refresh == 1) | |
535 dspl_Enable(temp);/*MC, SPR 1389*/ | |
536 #endif | |
537 return; | |
538 } | |
539 | |
540 /* | |
541 * get parent window | |
542 */ | |
543 h = mfwParent(mfwParent(h)); | |
544 if(h) | |
545 h = ((MfwWin * )(h->data))->elems; | |
546 } | |
547 cphs_sign_exec(mfwRoot,event,para); | |
548 } | |
549 // Power Management | |
550 #ifndef FF_POWER_MANAGEMENT | |
551 dspl_Enable(temp);/*MC, SPR 1389*/ | |
552 #else | |
553 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
554 display is enabled only when lcd refresh is needed*/ | |
555 if(FFS_flashData.refresh == 1) | |
556 dspl_Enable(temp);/*MC, SPR 1389*/ | |
557 #endif | |
558 } | |
559 | |
560 /* | |
561 +--------------------------------------------------------------------+ | |
562 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
563 | STATE : code ROUTINE: sendCPWIEvt | | |
564 +--------------------------------------------------------------------+ | |
565 | |
566 | |
567 PURPOSE :this function sends the E_CPHS_GET_VC_STAT event if there is any voice mail | |
568 MMI doesn't read from the SIM, but will set the vc Status based on the input from ACI | |
569 | |
570 */ | |
571 //18 May, 2006 DR: OMAPS00070657 x0pleela | |
572 #ifdef FF_CPHS | |
573 void sendCPWIEvt( UBYTE flag_set, USHORT line ) | |
574 { | |
575 T_MFW_CPHS_VC_STAT vc_stat; | |
576 TRACE_FUNCTION("sendCPWIEvt()"); | |
577 //11/06/2006 | |
578 | |
579 vc_stat.line1 = MFW_CFLAG_NotPresent; | |
580 vc_stat.line2 = MFW_CFLAG_NotPresent; | |
581 vc_stat.data = MFW_CFLAG_NotPresent; | |
582 vc_stat.fax = MFW_CFLAG_NotPresent; | |
583 | |
584 switch( line ) | |
585 { | |
586 case CPHS_LINE1: | |
587 if( flag_set ) | |
588 vc_stat.line1 = MFW_CFLAG_SET; | |
589 else | |
590 vc_stat.line1 = MFW_CFLAG_NOTSet; | |
591 break; | |
592 | |
593 case CPHS_LINE2: | |
594 if( flag_set ) | |
595 vc_stat.line2 = MFW_CFLAG_SET; | |
596 else | |
597 vc_stat.line2 = MFW_CFLAG_NOTSet; | |
598 break; | |
599 | |
600 case CPHS_LINE_DATA: | |
601 if( flag_set ) | |
602 vc_stat.data = MFW_CFLAG_SET; | |
603 else | |
604 vc_stat.data = MFW_CFLAG_NOTSet; | |
605 break; | |
606 | |
607 case CPHS_LINE_FAX: | |
608 if( flag_set ) | |
609 vc_stat.fax = MFW_CFLAG_SET; | |
610 else | |
611 vc_stat.fax = MFW_CFLAG_NOTSet; | |
612 break; | |
613 | |
614 default: | |
615 vc_stat.line1 = MFW_CFLAG_NotPresent; | |
616 vc_stat.line2 = MFW_CFLAG_NotPresent; | |
617 vc_stat.data = MFW_CFLAG_NotPresent; | |
618 vc_stat.fax = MFW_CFLAG_NotPresent; | |
619 break; | |
620 | |
621 } | |
622 | |
623 cphs_signal(E_CPHS_GET_VC_STAT,(void*)&vc_stat); | |
624 } | |
625 #endif | |
626 | |
627 /* | |
628 +--------------------------------------------------------------------+ | |
629 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
630 | STATE : code ROUTINE: sendCFISEvt | | |
631 +--------------------------------------------------------------------+ | |
632 | |
633 | |
634 PURPOSE :this function is used to signal CFIS event | |
635 */ | |
636 | |
637 #ifdef FF_CPHS_REL4 | |
638 void sendCPHSSignal( UBYTE event, void* para) | |
639 { | |
640 TRACE_FUNCTION("sendCPHSSignal()"); | |
641 cphs_signal(event,para); | |
642 } | |
643 #endif | |
644 /* | |
645 +--------------------------------------------------------------------+ | |
646 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
647 | STATE : code ROUTINE : cphs_support_check | | |
648 +--------------------------------------------------------------------+ | |
649 | |
650 PURPOSE : Check whether CPHS is supported. | |
651 | |
652 */ | |
653 | |
654 void cphs_support_check (void) | |
655 { | |
656 TRACE_FUNCTION ("cphs_support_check()"); | |
657 | |
658 /* Read CPHS information filed (6F16 - 3 bytes) from SIM card */ | |
659 if (!cphs_read_sim_dat(SIM_CPHS_CINF, NOT_PRESENT_8BIT, MFW_CPHS_INFO_SIZE)) | |
660 { | |
661 /* Read failed */ | |
662 /*MC-CONQUEST5999->6007, 20/05/2002, set status to ERR rather than NotPresent*/ | |
663 cphsStatus = CPHS_ERR; | |
664 TRACE_EVENT("CPHS, error reading support indication"); | |
665 cphs_signal(E_CPHS_IND, &cphsStatus); | |
666 } | |
667 } | |
668 | |
669 /* | |
670 +--------------------------------------------------------------------+ | |
671 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
672 | STATE : code ROUTINE : cphs_config | | |
673 +--------------------------------------------------------------------+ | |
674 | |
675 PURPOSE : Request the Configuration of CPHS fields | |
676 | |
677 */ | |
678 | |
679 T_MFW cphs_config (T_MFW_CPHS_INFO *cphs_info) | |
680 { | |
681 TRACE_FUNCTION ("cphs_config()"); | |
682 | |
683 if (cphs_info NEQ NULL /* AND | |
684 cphsStatus EQ MFW_CPHS_OK */ ) | |
685 { | |
686 cphs_info->phase = cphsPhase; | |
687 cphs_info->csp = cphs_ssc(MFW_CPHS_CSP, cphsServTab); | |
688 cphs_info->mbNum = cphs_ssc(MFW_CPHS_MB_NUMBER, cphsServTab); | |
689 | |
690 if (cphsPhase EQ 1) /* phase 1 only */ | |
691 cphs_info->sst = cphs_ssc(MFW_CPHS_SST, cphsServTab); | |
692 else /* not support */ | |
693 cphs_info->sst = NO_ALLOCATED; | |
694 | |
695 if (cphsPhase EQ 2) /* phase 2 only */ | |
696 { | |
697 cphs_info->opNS = cphs_ssc(MFW_CHPS_NAME_SHORT, cphsServTab); | |
698 cphs_info->iNum = cphs_ssc(MFW_CHPS_INFO_NUMBERS, cphsServTab); | |
699 } | |
700 else /* not support */ | |
701 { | |
702 cphs_info->opNS = NO_ALLOCATED; | |
703 cphs_info->iNum = NO_ALLOCATED; | |
704 } | |
705 } | |
706 return cphsStatus; | |
707 } | |
708 | |
709 /* | |
710 +--------------------------------------------------------------------+ | |
711 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
712 | STATE : code ROUTINE : cphs_operator_name | | |
713 +--------------------------------------------------------------------+ | |
714 | |
715 PURPOSE : Request the network operator name | |
716 | |
717 */ | |
718 | |
719 T_MFW cphs_operator_name (void) | |
720 { | |
721 TRACE_FUNCTION ("cphs_operator_name()"); | |
722 | |
723 /* Check CPHS support status */ | |
724 if (cphsStatus EQ CPHS_NotPresent) | |
725 return cphsStatus; | |
726 | |
727 /* Read operator name sring */ | |
728 if (!cphs_read_sim_dat(SIM_CPHS_ONSTR, NOT_PRESENT_8BIT, MFW_CPHS_ONS_SIZE)) | |
729 { | |
730 /* Read operator name sring failed */ | |
731 opName.longName.len = 0; | |
732 | |
733 /* Read operator name shortform */ | |
734 if ((cphsPhase NEQ 2) OR | |
735 (cphs_ssc(MFW_CHPS_NAME_SHORT, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED) OR | |
736 !cphs_read_sim_dat(SIM_CPHS_ONSHF, NOT_PRESENT_8BIT, MFW_CPHS_ONSF_SIZE) ) | |
737 { | |
738 /* Read operator name shortform failed. | |
739 Send event with empty info to MMI */ | |
740 opName.shortName.len = 0; | |
741 cphs_signal(E_CPHS_OP_NAME, &opName); | |
742 } | |
743 } | |
744 return cphsStatus; | |
745 } | |
746 | |
747 /* | |
748 +--------------------------------------------------------------------+ | |
749 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
750 | STATE : code ROUTINE : cphs_get_mailbox | | |
751 +--------------------------------------------------------------------+ | |
752 | |
753 PURPOSE : Request the Mailbox Numbers | |
754 | |
755 */ | |
756 | |
757 void cphs_get_mailbox (void) | |
758 { | |
759 TRACE_FUNCTION ("cphs_get_mailbox()"); | |
760 | |
761 mbNum.count = 0; | |
762 | |
763 /* Check CPHS support status. | |
764 When CPHS is not support, read mailbox numbers from EEPROM */ | |
765 if (cphsStatus EQ CPHS_NotPresent) | |
766 { | |
767 cphs_read_eeprom_mailbox(); | |
768 return; | |
769 } | |
770 | |
771 /* Check CPHS service table. | |
772 When CPHS is not support, read mailbox numbers from EEPROM */ | |
773 if (cphs_ssc(MFW_CPHS_MB_NUMBER, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED) | |
774 { | |
775 cphs_read_eeprom_mailbox(); | |
776 return; | |
777 } | |
778 /* Read mailbox numbers from SIM. | |
779 When this reading failed, read mailbox numbers from EEPROM */ | |
780 if (!cphs_read_sim_rcd(SIM_CPHS_MBXN, 1, 0)) /* read the first record */ | |
781 cphs_read_eeprom_mailbox(); | |
782 } | |
783 | |
784 static UBYTE cphs_write_sim_voicemail_rcd(void) | |
785 { | |
786 BOOL bSavePossible = FALSE; | |
787 UBYTE result = MFW_SIMOP_WRITE_OK; | |
788 | |
789 TRACE_FUNCTION("cphs_write_sim_voicemail_rcd"); | |
790 | |
791 /* allocate mbnData (sizeof(dataLen)) */ | |
792 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
793 // the dynamic allocation is done here, if the write fails it is deallocated | |
794 // else if success it is deallocated in the callback | |
795 #ifdef FF_MMI_OPTIM | |
796 mbnData = (UBYTE*)mfwAlloc(200); | |
797 if(mbnData != NULL) | |
798 { | |
799 #endif | |
800 ubCphsMbExtRecNo = 0; | |
801 sFreeRec = 0; | |
802 ubCurrExtRcWrite = 0; | |
803 ubFlushRecords = 0; | |
804 | |
805 bSavePossible = cphs_build_mbn_data(mbnData, vcEntry->datalen); | |
806 | |
807 /**************************************************************************************/ | |
808 /**************************************************************************************/ | |
809 /* Check if enough EXT1 Records are available for storing the current number; If not, show Write Error */ | |
810 if ( bSavePossible == FALSE ) | |
811 { | |
812 result = MFW_SIMOP_WRITE_ERR; | |
813 | |
814 TRACE_FUNCTION("cphs_write_sim_voicemail_rcd: notenuf EXT1recs"); | |
815 cphs_signal(E_CPHS_SET_VC_NUM, &result); | |
816 | |
817 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
818 // mbnData is deallocated, on failure of write operation | |
819 #ifdef FF_MMI_OPTIM | |
820 if(mbnData) | |
821 mfwFree(mbnData,200); | |
822 #endif | |
823 | |
824 return 0; | |
825 } | |
826 /**************************************************************************************/ | |
827 /**************************************************************************************/ | |
828 | |
829 if (!cphs_write_sim_rcd(SIM_CPHS_MBXN, vcEntry->index, | |
830 mbnData, vcEntry->datalen)) | |
831 { | |
832 cphs_write_eeprom_mailbox(vcEntry); | |
833 } | |
834 #ifdef FF_MMI_OPTIM | |
835 } | |
836 #endif | |
837 | |
838 return 1; | |
839 } | |
840 | |
841 /* | |
842 +--------------------------------------------------------------------+ | |
843 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
844 | STATE : code ROUTINE : cphs_set_mailbox | | |
845 +--------------------------------------------------------------------+ | |
846 | |
847 PURPOSE : Save the Mailbox Numbers | |
848 | |
849 */ | |
850 | |
851 T_MFW cphs_set_mailbox (T_MFW_CPHS_ENTRY *entry) | |
852 { | |
853 | |
854 TRACE_FUNCTION ("cphs_set_mailbox()"); | |
855 | |
856 TRACE_EVENT_P1("no: %s", entry->number); | |
857 | |
858 if (entry NEQ NULL AND | |
859 strlen((char *)entry->number) NEQ 0 ) | |
860 /* PATCH JPS 16.01.01: must copy the data and not only point on it!! */ | |
861 { | |
862 memcpy((char *)&MbnEntry, (char *)entry, sizeof(T_MFW_CPHS_ENTRY)); | |
863 //vcEntry = entry; | |
864 vcEntry = &MbnEntry; // VO ??? | |
865 | |
866 } | |
867 else | |
868 return CPHS_ERR; | |
869 | |
870 if ((entry->index <= 0) OR | |
871 (entry->index > 4) ) | |
872 return CPHS_ERR; | |
873 | |
874 /* Check CPHS support status. | |
875 When CPHS is not support, write mailbox numbers to EEPROM */ | |
876 if (cphsStatus EQ CPHS_NotPresent) | |
877 { | |
878 cphs_write_eeprom_mailbox(entry); | |
879 //x0pleela 11 June, 2006 DR:OMAPS00079692 | |
880 //changed from CPHS_OK to MFW_CPHS_OK | |
881 return MFW_CPHS_OK; | |
882 } | |
883 | |
884 /* Check CPHS service table. | |
885 When CPHS is not support, write mailbox numbers to EEPROM */ | |
886 if ( cphs_ssc(MFW_CPHS_MB_NUMBER, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED) | |
887 { | |
888 cphs_write_eeprom_mailbox(entry); | |
889 //x0pleela 11 June, 2006 DR:OMAPS00079692 | |
890 //changed from CPHS_OK to MFW_CPHS_OK | |
891 return MFW_CPHS_OK; | |
892 } | |
893 | |
894 /* Read first record to determine the data length, | |
895 When the reading failed, write mailbox numbers to EEPROM */ | |
896 // simStatus = MFW_SIMOP_WRITE_OK; | |
897 if (!cphs_write_sim_voicemail_rcd()) | |
898 { | |
899 return CPHS_ERR; | |
900 } | |
901 | |
902 //x0pleela 11 June, 2006 DR:OMAPS00079692 | |
903 //changed from CPHS_OK to MFW_CPHS_OK | |
904 return MFW_CPHS_OK; | |
905 } | |
906 | |
907 /* | |
908 +-------------------------------------------------------------------------+ | |
909 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
910 | STATE : code ROUTINE : cphs_get_mailbox_status | | |
911 +-------------------------------------------------------------------------+ | |
912 | |
913 PURPOSE : get the voice message waiting flag | |
914 | |
915 */ | |
916 | |
917 T_MFW cphs_get_mailbox_status () | |
918 { | |
919 TRACE_FUNCTION ("cphs_get_mailbox_status()"); | |
920 | |
921 | |
922 /* Read voice message waiting flag. | |
923 When this reading failed, send event with "read error" parameter to MMI */ | |
924 if (!cphs_read_sim_dat(SIM_CPHS_VMW, NOT_PRESENT_8BIT, MFW_CPHS_MBS_SIZE)) | |
925 { | |
926 mbStatus.result = MFW_SIMOP_READ_ERR; | |
927 cphs_signal(E_CPHS_GET_VC_STAT, &mbStatus); | |
928 } | |
929 return cphsStatus; | |
930 } | |
931 /* | |
932 +-------------------------------------------------------------------------+ | |
933 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
934 | STATE : code ROUTINE : cphs_rel4_get_mailbox_status | | |
935 +-------------------------------------------------------------------------+ | |
936 | |
937 PURPOSE : get the voice message waiting flag | |
938 | |
939 */ | |
940 #ifdef FF_CPHS_REL4 | |
941 void cphs_rel4_get_mailbox_status() | |
942 { | |
943 TRACE_FUNCTION("cphs_rel4_get_mailbox_status"); | |
944 qAT_PercentMWIS(CMD_SRC_LCL,0xFF);/*mspId is set to FF to get MWIS for all profiles*/ | |
945 } | |
946 | |
947 T_MFW_CPHS_REL4_MWIS* get_mwis_stat(int profile) | |
948 { | |
949 return &mwis_stat[profile -1]; | |
950 } | |
951 #endif | |
952 /* | |
953 +-------------------------------------------------------------------------+ | |
954 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
955 | STATE : code ROUTINE : cphs_set_mailbox_status | | |
956 +-------------------------------------------------------------------------+ | |
957 | |
958 PURPOSE : Save the voice message waiting flag | |
959 | |
960 */ | |
961 | |
962 T_MFW cphs_set_mailbox_status (T_MFW_CFLAG_STATUS line1, | |
963 T_MFW_CFLAG_STATUS line2, | |
964 T_MFW_CFLAG_STATUS fax, | |
965 T_MFW_CFLAG_STATUS data) | |
966 { | |
967 UBYTE result; | |
968 | |
969 TRACE_FUNCTION ("cphs_set_mailbox_status()"); | |
970 | |
971 /* Check CPHS support status. */ | |
972 if (cphsStatus EQ CPHS_NotPresent) | |
973 { | |
974 TRACE_EVENT("cphsStatus is CPHS_NotPresent !"); | |
975 return cphsStatus; | |
976 } | |
977 | |
978 /* Write status in buffer */ | |
979 if (line1 EQ MFW_CFLAG_SET OR | |
980 line1 EQ MFW_CFLAG_NOTSet ) | |
981 { mbsData[0] &=0xF0; //zero the lower nibble | |
982 mbsData[0] |= line1&0x0F; /* low Nibble */ | |
983 } | |
984 /*else | |
985 mbsData[0] = 0x0F;*/ | |
986 | |
987 if (line2 EQ MFW_CFLAG_SET OR | |
988 line2 EQ MFW_CFLAG_NOTSet ) | |
989 { mbsData[0]&=0x0F; | |
990 mbsData[0] |= (line2 << 4)&0xF0;; /* high Nibble */ | |
991 } | |
992 | |
993 if (fax EQ MFW_CFLAG_SET OR | |
994 fax EQ MFW_CFLAG_NOTSet ) | |
995 { mbsData[1] &= 0xF0; //zero the low nibble | |
996 mbsData[1] |= fax&0x0F; /* low Nibble */ | |
997 } | |
998 | |
999 if (data EQ MFW_CFLAG_SET OR | |
1000 data EQ MFW_CFLAG_NOTSet ) | |
1001 { mbsData[1] &= 0x0F; //zero the high nibble | |
1002 mbsData[1] |= (data << 4)&0xF0; /* high Nibble */ | |
1003 } | |
1004 | |
1005 /* Read voice message waiting flag to determine the size */ | |
1006 simStatus = MFW_SIMOP_WRITE_OK; | |
1007 if (!cphs_read_sim_dat(SIM_CPHS_VMW, NOT_PRESENT_8BIT, MFW_CPHS_MBS_SIZE)) | |
1008 { | |
1009 result = MFW_SIMOP_WRITE_ERR; | |
1010 cphs_signal(E_CPHS_SET_VC_STAT, &result); | |
1011 } | |
1012 /* PATCH VO 22.01.01 end */ | |
1013 return cphsStatus; | |
1014 } | |
1015 | |
1016 /* | |
1017 +------------------------------------------------------------------------+ | |
1018 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1019 | STATE : code ROUTINE : cphs_get_divert_status | | |
1020 +------------------------------------------------------------------------+ | |
1021 | |
1022 PURPOSE : Request the call forwarding flags | |
1023 | |
1024 */ | |
1025 | |
1026 T_MFW cphs_get_divert_status () | |
1027 { | |
1028 TRACE_FUNCTION ("cphs_get_divert_status()"); | |
1029 | |
1030 | |
1031 /* Read call forwarding flags. | |
1032 When this reading failed, send event with "read error" parameter to MMI */ | |
1033 /*a0393213 cphs rel4 - when EF(CFIS) is present call sAT_PercentCFIS to get CFIS*/ | |
1034 #ifdef FF_CPHS_REL4 | |
1035 if(sim_serv_table_check((UBYTE)SRV_No_55) != ALLOCATED_AND_ACTIVATED ) | |
1036 { | |
1037 #endif | |
1038 | |
1039 if (!cphs_read_sim_dat(SIM_CPHS_CFF, NOT_PRESENT_8BIT, MFW_CPHS_CFF_SIZE)) | |
1040 { | |
1041 dvStatus.result = MFW_SIMOP_READ_ERR; | |
1042 cphs_signal(E_CPHS_GET_DV_STAT, &dvStatus); | |
1043 } | |
1044 #ifdef FF_CPHS_REL4 | |
1045 } | |
1046 else | |
1047 { | |
1048 UBYTE mspId=mfw_cphs_get_reg_profile(); | |
1049 TRACE_EVENT_P1("msp id %d", mspId); | |
1050 /*needs clarification regarding third and fourth parameters*/ | |
1051 sAT_PercentCFIS(CMD_SRC_LCL, CFIS_MOD_Read, mspId , mspId, 0, NULL, NULL, 0); | |
1052 } | |
1053 #endif | |
1054 return cphsStatus; | |
1055 } | |
1056 | |
1057 /* | |
1058 +-------------------------------------------------------------------------+ | |
1059 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1060 | STATE : code ROUTINE : cphs_set_divert_status | | |
1061 +-------------------------------------------------------------------------+ | |
1062 | |
1063 PURPOSE : Save the call forwarding flag | |
1064 | |
1065 */ | |
1066 | |
1067 T_MFW cphs_set_divert_status (T_MFW_CFLAG_STATUS line1, | |
1068 T_MFW_CFLAG_STATUS line2, | |
1069 T_MFW_CFLAG_STATUS fax, | |
1070 T_MFW_CFLAG_STATUS data) | |
1071 { | |
1072 UBYTE result; | |
1073 | |
1074 TRACE_EVENT_P4 ("cphs_set_divert_status() %d %d %d %d",line1,line2,fax,data); | |
1075 | |
1076 | |
1077 /* Write status in buffer */ | |
1078 if (line1 EQ MFW_CFLAG_SET OR | |
1079 line1 EQ MFW_CFLAG_NOTSet ) | |
1080 { dvData[0]&= 0xF0; //zero the lower nibble | |
1081 dvData[0] |= line1&0x0F; /* low Nibble */ | |
1082 } | |
1083 | |
1084 if (line2 EQ MFW_CFLAG_SET OR | |
1085 line2 EQ MFW_CFLAG_NOTSet ) | |
1086 { dvData[0]&= 0x0F; | |
1087 dvData[0] |= (line2 << 4)&0xF0; /* high Nibble */ | |
1088 } | |
1089 | |
1090 if (fax EQ MFW_CFLAG_SET OR | |
1091 fax EQ MFW_CFLAG_NOTSet ) | |
1092 { dvData[1]&= 0xF0; //zero the lower nibble | |
1093 dvData[1] |= fax&0x0F; /* low Nibble */ | |
1094 } | |
1095 | |
1096 | |
1097 if (data EQ MFW_CFLAG_SET OR | |
1098 data EQ MFW_CFLAG_NOTSet ) | |
1099 { dvData[1] &=0x0F; | |
1100 dvData[1] |= (data << 4)&0xF0; /* high Nibble */ | |
1101 } | |
1102 | |
1103 /* Read call forwarding flag to determine the size */ | |
1104 simStatus = MFW_SIMOP_WRITE_OK; | |
1105 if (!cphs_read_sim_dat(SIM_CPHS_CFF, NOT_PRESENT_8BIT, MFW_CPHS_CFF_SIZE)) | |
1106 { | |
1107 TRACE_EVENT("cphs_set_divert_status:cphs_read_sim_dat failed"); | |
1108 result = MFW_SIMOP_WRITE_ERR; | |
1109 cphs_signal(E_CPHS_SET_DV_STAT, &result); | |
1110 } | |
1111 return cphsStatus; | |
1112 } | |
1113 | |
1114 | |
1115 /* | |
1116 +-------------------------------------------------------------------------+ | |
1117 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1118 | STATE : code ROUTINE : cphs_rel4_set_divert_status | | |
1119 +-------------------------------------------------------------------------+ | |
1120 | |
1121 PURPOSE : Save the call forwarding flag into SIM by calling sAT_PercentCFIS | |
1122 PARAMETERS: voice - call forward status for voice | |
1123 fax - call forward status for fax | |
1124 data - call forward status for data | |
1125 | |
1126 */ | |
1127 #ifdef FF_CPHS_REL4 | |
1128 T_MFW cphs_rel4_set_divert_status(T_MFW_CFLAG_STATUS voice, T_MFW_CFLAG_STATUS fax, | |
1129 T_MFW_CFLAG_STATUS data, char number[PHB_MAX_LEN]) | |
1130 { | |
1131 UBYTE mspId=mfw_cphs_get_reg_profile(); | |
1132 UBYTE cfuStat=0x00; | |
1133 | |
1134 TRACE_FUNCTION("cphs_rel4_set_divert_status"); | |
1135 TRACE_EVENT_P4("voice - %d, fax - %d, data - %d, number - %s", voice, fax, data, number); | |
1136 TRACE_EVENT_P1("msp id %d",mspId); | |
1137 | |
1138 cfuStat= cfuStat | (voice == MFW_CFLAG_SET) | ((fax==MFW_CFLAG_SET)<<1) | ((data==MFW_CFLAG_SET)<<2); | |
1139 | |
1140 /*check third, fourth, sixth, seventh and eight parameters, number convert to 10 digit, TOA - psaSAT_getTonNpi is a local fn in ACI*/ | |
1141 sAT_PercentCFIS( CMD_SRC_LCL, | |
1142 CFIS_MOD_Write, | |
1143 mspId, | |
1144 mspId, | |
1145 cfuStat, | |
1146 number, | |
1147 NULL, | |
1148 0xFF); | |
1149 return cphsStatus; | |
1150 | |
1151 | |
1152 } | |
1153 #endif | |
1154 | |
1155 | |
1156 | |
1157 /* | |
1158 +---------------------------------------------------------------------+ | |
1159 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1160 | STATE : code ROUTINE : cphs_get_als_info | | |
1161 +---------------------------------------------------------------------+ | |
1162 | |
1163 PURPOSE : Request the Status of Alternate Line Service information | |
1164 (first read selected ALS line, dann status of this line). | |
1165 When the field does not exist in SIM, read it from EEPROM. | |
1166 | |
1167 */ | |
1168 | |
1169 void cphs_get_als_info (T_MFW_CPHS_ALS_STATUS *info) | |
1170 { | |
1171 TRACE_FUNCTION ("cphs_get_als_info()"); | |
1172 | |
1173 /* read alternate line service from EEPROM */ | |
1174 cphs_read_eeprom_als(info); | |
1175 | |
1176 cphs_signal(E_CPHS_GET_ALS_STATUS, &alsStatus); | |
1177 } | |
1178 | |
1179 /* | |
1180 +---------------------------------------------------------------------+ | |
1181 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1182 | STATE : code ROUTINE : cphs_select_line | | |
1183 +---------------------------------------------------------------------+ | |
1184 | |
1185 PURPOSE : Select the current used line. When the field does not | |
1186 exist in SIM, read it from EEPROM. | |
1187 | |
1188 */ | |
1189 | |
1190 void cphs_select_line (T_MFW_LINE_INDEX line) | |
1191 { | |
1192 UBYTE result; | |
1193 T_ACI_ALS_MOD alsMode=ALS_MOD_NOTPRESENT; | |
1194 | |
1195 TRACE_EVENT_P1 ("cphs_select_line() %d",line); | |
1196 | |
1197 if (line NEQ MFW_SERV_LINE1 AND | |
1198 line NEQ MFW_SERV_LINE2 ) | |
1199 { | |
1200 result = MFW_SIMOP_WRITE_ERR; | |
1201 cphs_signal(E_CPHS_SET_LINE, &result); | |
1202 return; | |
1203 } | |
1204 | |
1205 alsData = (UBYTE) line; | |
1206 | |
1207 | |
1208 /* write alternate line service in EEPROM */ | |
1209 cphs_write_eeprom_als(&result); | |
1210 | |
1211 if (line EQ MFW_SERV_LINE1) | |
1212 alsMode = ALS_MOD_SPEECH; | |
1213 if (line EQ MFW_SERV_LINE2) | |
1214 alsMode = ALS_MOD_AUX_SPEECH; | |
1215 sAT_PercentALS(CMD_SRC_LCL, alsMode); | |
1216 | |
1217 cphs_signal(E_CPHS_SET_LINE, &result); | |
1218 } | |
1219 | |
1220 /* | |
1221 +---------------------------------------------------------------------+ | |
1222 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1223 | STATE : code ROUTINE : cphs_set_als_status | | |
1224 +---------------------------------------------------------------------+ | |
1225 | |
1226 PURPOSE : Change the lock status of the line. When the field does | |
1227 not exist in SIM, read it from EEPROM. | |
1228 | |
1229 */ | |
1230 | |
1231 T_MFW cphs_set_als_status (T_MFW_LINE_STATUS status) | |
1232 { | |
1233 UBYTE result; | |
1234 T_MFW_SIM_PIN_STATUS pinStatus; | |
1235 | |
1236 TRACE_FUNCTION ("cphs_set_als_status()"); | |
1237 | |
1238 /* check PIN 2 requirement */ | |
1239 pinStatus.type = MFW_SIM_PIN2; | |
1240 sim_pin_status(&pinStatus); | |
1241 if (pinStatus.stat NEQ MFW_SIM_NO_PIN) | |
1242 return MFW_SIM_PIN2_REQ; | |
1243 | |
1244 /* check given parameter */ | |
1245 if (status NEQ MFW_LINE_LOCKED AND | |
1246 status NEQ MFW_LINE_UNLOCKED ) | |
1247 { | |
1248 result = MFW_SIMOP_WRITE_ERR; | |
1249 cphs_signal(E_CPHS_SET_ALS_STATUS, &result); | |
1250 return CPHS_ERR; | |
1251 } | |
1252 | |
1253 alsData = (UBYTE) status; | |
1254 | |
1255 /* write lock status in EEPROM */ | |
1256 cphs_write_eeprom_alss(&result); | |
1257 cphs_signal(E_CPHS_SET_LINE, &result); | |
1258 //x0pleela 11 June, 2006 DR:OMAPS00079692 | |
1259 //changed from CPHS_OK to MFW_CPHS_OK | |
1260 return MFW_CPHS_OK; | |
1261 } | |
1262 | |
1263 /* | |
1264 +---------------------------------------------------------------------+ | |
1265 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1266 | STATE : code ROUTINE : cphs_get_csp | | |
1267 +---------------------------------------------------------------------+ | |
1268 | |
1269 PURPOSE : Request the customer service profile | |
1270 | |
1271 */ | |
1272 | |
1273 T_MFW cphs_get_csp () | |
1274 { | |
1275 UBYTE res; | |
1276 | |
1277 TRACE_FUNCTION ("cphs_get_csp()"); | |
1278 | |
1279 | |
1280 /* check CPHS service table */ | |
1281 res = cphs_ssc(MFW_CPHS_CSP, cphsServTab); | |
1282 if ( res NEQ ALLOCATED_AND_ACTIVATED) | |
1283 return res; | |
1284 | |
1285 /* Read customer service profile. | |
1286 When this reading failed, send event with empty parameter array to MMI */ | |
1287 if (!cphs_read_sim_dat(SIM_CPHS_CSP, NOT_PRESENT_8BIT, MFW_CPHS_CSP_SIZE)) | |
1288 { | |
1289 csProfile.result = MFW_SIMOP_READ_ERR; | |
1290 memset(csProfile.csp, 0, sizeof(csProfile.csp)); | |
1291 cphs_signal(E_CPHS_GET_CSP, &csProfile); | |
1292 } | |
1293 | |
1294 return cphsStatus; | |
1295 } | |
1296 | |
1297 /* | |
1298 +---------------------------------------------------------------------+ | |
1299 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1300 | STATE : code ROUTINE : cphs_get_info_num | | |
1301 +---------------------------------------------------------------------+ | |
1302 | |
1303 PURPOSE : Request information numbers directory | |
1304 | |
1305 */ | |
1306 | |
1307 T_MFW cphs_get_info_num (UBYTE level, UBYTE startIndex) | |
1308 { | |
1309 // UBYTE res; // RAVI | |
1310 T_MFW_CPHS_INFO cf_info; | |
1311 | |
1312 TRACE_FUNCTION ("cphs_get_info_num()"); | |
1313 | |
1314 | |
1315 if (level < 1 OR | |
1316 startIndex < 1 ) | |
1317 return CPHS_ERR; | |
1318 cphs_config(&cf_info); | |
1319 | |
1320 | |
1321 /* Read customer service profile to check | |
1322 whether information numbers are supported. */ | |
1323 numList.count = 0; | |
1324 idxLevel = level; | |
1325 startIdx = startIndex; | |
1326 simStatus = MFW_SIMOP_READ_OK; | |
1327 if (!cphs_read_sim_dat(SIM_CPHS_CSP, NOT_PRESENT_8BIT, MFW_CPHS_CSP_SIZE)) | |
1328 { | |
1329 simStatus = MFW_SIMOP_UNKNOWN; | |
1330 TRACE_EVENT("Can't read CSP for info nums"); | |
1331 return CPHS_NotPresent; | |
1332 } | |
1333 | |
1334 return cphsStatus; | |
1335 } | |
1336 | |
1337 /* | |
1338 +----------------------------------------------------------------------+ | |
1339 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1340 | STATE : code ROUTINE : cphs_select_info_num | | |
1341 +----------------------------------------------------------------------+ | |
1342 | |
1343 PURPOSE : read a information number entry | |
1344 | |
1345 */ | |
1346 | |
1347 T_MFW cphs_select_info_num (UBYTE index) | |
1348 { | |
1349 TRACE_FUNCTION ("cphs_select_info_num()"); | |
1350 | |
1351 | |
1352 /* Read a information number entry. | |
1353 When this reading failed, send event with "read error" parameter to MMI */ | |
1354 simStatus = MFW_SIMOP_READ_OK; | |
1355 startIdx = index; | |
1356 | |
1357 // By now we know if 6F19 or EA01 are present for reading info. num entries from | |
1358 // So lets use this knowledge. | |
1359 | |
1360 if (cphsPrevRead == SIM_CPHS_INFN) | |
1361 { | |
1362 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, 1, 0)) | |
1363 { | |
1364 infoEntry.result = MFW_SIMOP_READ_ERR; | |
1365 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); | |
1366 TRACE_EVENT("Error reading single info num"); | |
1367 } | |
1368 else | |
1369 { | |
1370 cphsPrevRead = SIM_CPHS_INFN; | |
1371 } | |
1372 } | |
1373 else | |
1374 { | |
1375 if (cphsPrevRead == SIM_CPHS_INFN2) | |
1376 { | |
1377 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0)) | |
1378 {TRACE_EVENT("Error reading single info num 2"); | |
1379 infoEntry.result = MFW_SIMOP_READ_ERR; | |
1380 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); | |
1381 } | |
1382 else | |
1383 { | |
1384 cphsPrevRead = SIM_CPHS_INFN2; | |
1385 } | |
1386 } | |
1387 } | |
1388 return cphsStatus; | |
1389 } | |
1390 | |
1391 /* | |
1392 +-----------------------------------------------------------------------+ | |
1393 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1394 | STATE : code ROUTINE : cphs_read_information | | |
1395 +-----------------------------------------------------------------------+ | |
1396 | |
1397 PURPOSE : Read CPHS information | |
1398 | |
1399 */ | |
1400 //x0018858 OMAPS00062632 The errcode type has been modified from SHORT to USHORT. | |
1401 void cphs_read_information(USHORT errCode, UBYTE *data, UBYTE dataLen) | |
1402 { | |
1403 UBYTE *ptr; | |
1404 /* PATCH VO 22.01.01: copy CPHS service table according to | |
1405 the actual length in the SIM card */ | |
1406 UBYTE len; | |
1407 /* PATCH VO 22.01.01 END */ | |
1408 | |
1409 TRACE_FUNCTION ("cphs_read_information()"); | |
1410 | |
1411 ptr = data; | |
1412 /* PATCH VO 22.01.01: copy CPHS service table according to | |
1413 the actual length in the SIM card */ | |
1414 len = dataLen; | |
1415 memset(cphsServTab, 0, sizeof(cphsServTab)); | |
1416 /* PATCH VO 22.01.01 END */ | |
1417 #ifdef FF_2TO1_PS | |
1418 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR | |
1419 #else | |
1420 if ( errCode NEQ SIM_NO_ERROR OR | |
1421 #endif | |
1422 ptr EQ NULL OR | |
1423 dataLen <= 0) /* PATCH VO 22.01.01: not check a certain length */ | |
1424 { | |
1425 cphs_signal(E_CPHS_IND, &cphsStatus); | |
1426 } | |
1427 else | |
1428 { | |
1429 cphsPhase = *ptr; | |
1430 len--; | |
1431 if (len > 0) | |
1432 { | |
1433 ptr++; | |
1434 memcpy (cphsServTab, ptr, MINIMUM(len, CPHS_SERVICE_TABLE)); | |
1435 } | |
1436 /* PATCH VO 22.01.01 END */ | |
1437 //x0pleela 11 June, 2006 DR:OMAPS00079692 | |
1438 //changed from CPHS_OK to MFW_CPHS_OK | |
1439 cphsStatus = MFW_CPHS_OK; | |
1440 TRACE_EVENT("CPHS supported"); | |
1441 cphs_signal(E_CPHS_IND, &cphsStatus); | |
1442 } | |
1443 } | |
1444 | |
1445 /* | |
1446 +-----------------------------------------------------------------------+ | |
1447 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1448 | STATE : code ROUTINE : cphs_read_ons | | |
1449 +-----------------------------------------------------------------------+ | |
1450 | |
1451 PURPOSE : Read operator name short form | |
1452 | |
1453 */ | |
1454 void cphs_read_ons(USHORT errCode, UBYTE *data, UBYTE dataLen) | |
1455 { | |
1456 UBYTE *ptr; | |
1457 | |
1458 TRACE_FUNCTION ("cphs_read_ons()"); | |
1459 | |
1460 ptr = data; | |
1461 #ifdef FF_2TO1_PS | |
1462 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR | |
1463 #else | |
1464 if ( errCode NEQ SIM_NO_ERROR OR | |
1465 #endif | |
1466 ptr EQ NULL OR | |
1467 // dataLen < MFW_CPHS_ONS_SIZE ) | |
1468 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */ | |
1469 { | |
1470 opName.longName.len = 0; | |
1471 } | |
1472 else | |
1473 { | |
1474 cmhPHB_getMfwTagNt(ptr, (UBYTE)MINIMUM(LONG_NAME, dataLen), | |
1475 opName.longName.data, &opName.longName.len); | |
1476 opName.longName.dcs = MFW_DCS_SIM; | |
1477 | |
1478 /* Read operator name shortform */ | |
1479 if ((cphsPhase NEQ 2) OR | |
1480 (cphs_ssc(MFW_CHPS_NAME_SHORT, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED) OR | |
1481 !cphs_read_sim_dat(SIM_CPHS_ONSHF, NOT_PRESENT_8BIT, MFW_CPHS_ONSF_SIZE) ) | |
1482 { | |
1483 opName.shortName.len = 0; | |
1484 if (opName.longName.len != 0) | |
1485 TRACE_EVENT("Got a long name!!!"); | |
1486 cphs_signal(E_CPHS_OP_NAME, &opName); | |
1487 } | |
1488 } | |
1489 } | |
1490 | |
1491 /* | |
1492 +-----------------------------------------------------------------------+ | |
1493 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1494 | STATE : code ROUTINE : cphs_read_onsf | | |
1495 +-----------------------------------------------------------------------+ | |
1496 | |
1497 PURPOSE : Read operator name short form | |
1498 | |
1499 */ | |
1500 void cphs_read_onsf(USHORT errCode, UBYTE *data, UBYTE dataLen) | |
1501 { | |
1502 UBYTE *ptr; | |
1503 | |
1504 TRACE_FUNCTION ("cphs_read_onsf()"); | |
1505 | |
1506 ptr = data; | |
1507 #ifdef FF_2TO1_PS | |
1508 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR | |
1509 #else | |
1510 if ( errCode NEQ SIM_NO_ERROR OR | |
1511 #endif | |
1512 ptr EQ NULL OR | |
1513 dataLen < MFW_CPHS_ONSF_SIZE ) | |
1514 { | |
1515 opName.shortName.len = 0; | |
1516 } | |
1517 else | |
1518 { | |
1519 cmhPHB_getMfwTagNt(ptr, MFW_CPHS_ONSF_SIZE, | |
1520 opName.shortName.data, &opName.shortName.len); | |
1521 opName.shortName.dcs = MFW_DCS_SIM; | |
1522 TRACE_EVENT("Got a short Name"); | |
1523 } | |
1524 | |
1525 cphs_signal(E_CPHS_OP_NAME, &opName); | |
1526 } | |
1527 | |
1528 /* | |
1529 +-----------------------------------------------------------------------+ | |
1530 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1531 | STATE : code ROUTINE : cphs_read_mbn | | |
1532 +-----------------------------------------------------------------------+ | |
1533 | |
1534 PURPOSE : Read mailbox numbers | |
1535 | |
1536 */ | |
1537 | |
1538 void cphs_read_mbn(SHORT table_id) | |
1539 { | |
1540 UBYTE* pData; /* points to data buffer */ | |
1541 UBYTE alphaLen; | |
1542 UBYTE dataLen; | |
1543 T_ACI_TOA type; | |
1544 | |
1545 TRACE_FUNCTION ("cphs_read_mbn()"); | |
1546 | |
1547 pData = simShrdPrm.atb[table_id].exchData; | |
1548 dataLen = simShrdPrm.atb[table_id].dataLen; | |
1549 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ | |
1550 curr_recNr = simShrdPrm.atb[table_id].recNr; | |
1551 | |
1552 TRACE_EVENT_P1("curr_recNr: %d", curr_recNr); | |
1553 | |
1554 TRACE_EVENT_P1("dataLen: %d", dataLen); | |
1555 | |
1556 #ifdef FF_2TO1_PS | |
1557 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR OR | |
1558 #else | |
1559 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR OR | |
1560 #endif | |
1561 pData EQ NULL OR | |
1562 dataLen < MFW_CPHS_MIN_MBN_SIZE ) | |
1563 { | |
1564 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ | |
1565 if (curr_recNr <= 1) | |
1566 { | |
1567 cphs_read_eeprom_mailbox(); | |
1568 return; | |
1569 } | |
1570 else | |
1571 { | |
1572 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum); | |
1573 } | |
1574 } | |
1575 else /* no read error */ | |
1576 { | |
1577 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ | |
1578 if (curr_recNr EQ 1) | |
1579 { | |
1580 maxRec = simShrdPrm.atb[table_id].recMax; | |
1581 } | |
1582 | |
1583 if ( dataLen >= MFW_CPHS_MIN_MBN_SIZE ) | |
1584 { | |
1585 alphaLen = dataLen - MFW_CPHS_MIN_MBN_SIZE; | |
1586 } | |
1587 else | |
1588 { | |
1589 alphaLen = 0; | |
1590 } | |
1591 | |
1592 /* Copy/encode data */ | |
1593 if ( ( *(pData + alphaLen) > 0 ) /* If Length of the contents is > 0 */ | |
1594 && | |
1595 ( *(pData + alphaLen) <= 11 ) | |
1596 ) | |
1597 { | |
1598 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ | |
1599 mbNum.entries[mbNum.count].index = curr_recNr; | |
1600 | |
1601 mbNum.entries[mbNum.count].datalen = dataLen; | |
1602 | |
1603 TRACE_EVENT_P1("mbNum.count: %d", mbNum.count); | |
1604 | |
1605 TRACE_EVENT_P1("mbNum.entries[mbNum.count].index: %d", mbNum.entries[mbNum.count].index); | |
1606 | |
1607 cmhPHB_getMfwTagNt(pData, alphaLen, | |
1608 mbNum.entries[mbNum.count].alpha.data, | |
1609 &mbNum.entries[mbNum.count].alpha.len); | |
1610 pData += alphaLen; | |
1611 | |
1612 if ( *(pData) > 1 ) | |
1613 { | |
1614 cmhPHB_getAdrStr ( (CHAR *)mbNum.entries[mbNum.count].number, | |
1615 PHB_MAX_LEN - 1, | |
1616 pData + 2, | |
1617 *pData ); | |
1618 } | |
1619 else | |
1620 { | |
1621 memset ( (void *)mbNum.entries[mbNum.count].number, 0, PHB_MAX_LEN ); | |
1622 } | |
1623 | |
1624 cmhPHB_toaDmrg ( *( pData + 1 ), &type ); | |
1625 mbNum.entries[mbNum.count].ton = phb_cvtTon(type.ton); | |
1626 mbNum.entries[mbNum.count].npi = phb_cvtNpi(type.npi); | |
1627 | |
1628 mbNum.entries[mbNum.count].ext_rec_number = 0; | |
1629 | |
1630 TRACE_EVENT_P1("dataLen: %d", dataLen); | |
1631 | |
1632 TRACE_EVENT_P1("alphaLen: %d", alphaLen); | |
1633 | |
1634 TRACE_EVENT_P2("cphs_read_mbn: idx, ext_rec_number: %d, %d", mbNum.count, mbNum.entries[mbNum.count].ext_rec_number); | |
1635 | |
1636 pData += 12; | |
1637 | |
1638 if ( *pData NEQ 0xFF ) | |
1639 { | |
1640 /* read bearer capability EF */ | |
1641 /* return; */ | |
1642 } | |
1643 | |
1644 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ | |
1645 pData += 1; | |
1646 | |
1647 if ( *pData NEQ 0xFF ) | |
1648 { | |
1649 /*Read EXT1 EF */ | |
1650 UBYTE rcd_no; | |
1651 rcd_no= *pData; | |
1652 mbNum.entries[mbNum.count].ext_rec_idx[mbNum.entries[mbNum.count].ext_rec_number] = rcd_no; | |
1653 | |
1654 if(!cphs_read_sim_rcd(SIM_EXT1,rcd_no,UCHAR_MAX)) | |
1655 { | |
1656 /*Append the extension data to mailbox number*/ | |
1657 TRACE_FUNCTION("EXTENSION RECORD PRESENT"); | |
1658 } | |
1659 else | |
1660 { | |
1661 /*EXT1 record is being read. Wait the corr callback.*/ | |
1662 return; | |
1663 } | |
1664 } | |
1665 | |
1666 mbNum.count++; | |
1667 | |
1668 } | |
1669 | |
1670 curr_recNr++; | |
1671 if (curr_recNr > maxRec) | |
1672 { | |
1673 TRACE_EVENT("got CPHS MAilbox nos"); | |
1674 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum); | |
1675 } | |
1676 else | |
1677 { | |
1678 /* Read the next entry */ | |
1679 if (!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX)) | |
1680 { | |
1681 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum); | |
1682 } | |
1683 } | |
1684 } | |
1685 } | |
1686 | |
1687 /* | |
1688 +-----------------------------------------------------------------------+ | |
1689 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1690 | STATE : code ROUTINE : cphs_read_ext1 | | |
1691 +-----------------------------------------------------------------------+ | |
1692 | |
1693 PURPOSE : Read EXT1 record for mailbox numbers | |
1694 | |
1695 */ | |
1696 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ | |
1697 void cphs_read_ext1(SHORT table_id) | |
1698 { | |
1699 UBYTE* pData; /* points to data buffer */ | |
1700 UBYTE alphaLen; | |
1701 UBYTE dataLen; | |
1702 UBYTE recNr; | |
1703 UBYTE ext_rec_no; | |
1704 T_ACI_TOA type; | |
1705 UBYTE ext1num[PHB_MAX_LEN]; | |
1706 | |
1707 TRACE_FUNCTION ("cphs_read_ext1()"); | |
1708 | |
1709 pData = simShrdPrm.atb[table_id].exchData; | |
1710 dataLen = simShrdPrm.atb[table_id].dataLen; | |
1711 recNr = simShrdPrm.atb[table_id].recNr; | |
1712 | |
1713 if ( *pData EQ 0x02 ) //implies that the EF conatins additional data | |
1714 { | |
1715 | |
1716 /*Extract ext data*/ | |
1717 if(*(pData+1) NEQ 0xFF) | |
1718 { | |
1719 alphaLen=*(pData+1); | |
1720 cmhPHB_getAdrStr ( (CHAR *)ext1num, | |
1721 PHB_MAX_LEN - 1, | |
1722 pData + 2, | |
1723 *(pData+1) ); | |
1724 | |
1725 strncat( (CHAR *)mbNum.entries[mbNum.count].number, (CHAR *)ext1num, | |
1726 strlen((CHAR *)ext1num) ); | |
1727 | |
1728 mbNum.entries[mbNum.count].ext_rec_number++; | |
1729 | |
1730 TRACE_EVENT_P2("cphs_read_ext1: idx, ext_rec_number: %d, %d", mbNum.count, mbNum.entries[mbNum.count].ext_rec_number); | |
1731 | |
1732 if ( *(pData + 12) == 0xFF ) | |
1733 { | |
1734 //return control to mbn | |
1735 curr_recNr++; | |
1736 | |
1737 mbNum.count++; | |
1738 | |
1739 if (curr_recNr > maxRec) | |
1740 { | |
1741 TRACE_EVENT("got CPHS MAilbox nos-2"); | |
1742 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum); | |
1743 } | |
1744 else | |
1745 { | |
1746 if(!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX)) | |
1747 { | |
1748 TRACE_FUNCTION("Control Back to mbn-1"); | |
1749 return; | |
1750 } | |
1751 } | |
1752 } | |
1753 else | |
1754 { | |
1755 ext_rec_no = *(pData + 12); | |
1756 | |
1757 mbNum.entries[mbNum.count].ext_rec_idx[mbNum.entries[mbNum.count].ext_rec_number] = ext_rec_no; | |
1758 | |
1759 if(!cphs_read_sim_rcd(SIM_EXT1,ext_rec_no,UCHAR_MAX)) | |
1760 { | |
1761 /*Append the extension data to mailbox number*/ | |
1762 TRACE_FUNCTION( " MORE EXTENSION RECORDS PRESENT -But read Error"); | |
1763 | |
1764 curr_recNr++; | |
1765 | |
1766 mbNum.count++; | |
1767 | |
1768 if(!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX)) | |
1769 { | |
1770 TRACE_FUNCTION("Control Back to mbn-2"); | |
1771 return; | |
1772 } | |
1773 } | |
1774 } | |
1775 } | |
1776 } | |
1777 else | |
1778 ; | |
1779 | |
1780 return; | |
1781 } | |
1782 | |
1783 /* | |
1784 +-----------------------------------------------------------------------+ | |
1785 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1786 | STATE : code ROUTINE : cphs_rel4_get_mailbox_id | | |
1787 +-----------------------------------------------------------------------+ | |
1788 | |
1789 PURPOSE : Get mailbox identifiers for the registered profile | |
1790 | |
1791 */ | |
1792 #ifdef FF_CPHS_REL4 | |
1793 void cphs_rel4_get_mailbox_id() | |
1794 { | |
1795 UBYTE mspId=mfw_cphs_get_reg_profile(); | |
1796 TRACE_FUNCTION("cphs_rel4_get_mailbox_id"); | |
1797 /*get Mailbox Identifiers for the registered profile*/ | |
1798 qAT_PercentMBI(CMD_SRC_LCL,mspId); | |
1799 } | |
1800 /* | |
1801 +-----------------------------------------------------------------------+ | |
1802 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1803 | STATE : code ROUTINE : cphs_rel4_get_mailbox_no | | |
1804 +-----------------------------------------------------------------------+ | |
1805 | |
1806 PURPOSE : Get mailbox number from the given index | |
1807 | |
1808 */ | |
1809 void cphs_rel4_get_mailbox_no(UBYTE index) | |
1810 { | |
1811 TRACE_FUNCTION("cphs_rel4_get_mailbox_no"); | |
1812 /*get mailbox number for the supplied index - the call is asynchronous*/ | |
1813 qAT_PercentMBDN(CMD_SRC_LCL,index); | |
1814 } | |
1815 | |
1816 /******************************************************************************* | |
1817 | |
1818 $Function: is_message_waiting | |
1819 $Description: returns true if any message (in any profile) is waiting | |
1820 | |
1821 *******************************************************************************/ | |
1822 | |
1823 BOOL is_message_waiting(void) | |
1824 { | |
1825 TRACE_FUNCTION("is_message_waiting"); | |
1826 if(mwis_stat[0].mwisStat&0x0F || mwis_stat[1].mwisStat&0x0F || | |
1827 mwis_stat[2].mwisStat&0x0F || mwis_stat[3].mwisStat&0x0F) | |
1828 return TRUE; | |
1829 else | |
1830 return FALSE; | |
1831 } | |
1832 | |
1833 | |
1834 #endif | |
1835 | |
1836 /* | |
1837 +-----------------------------------------------------------------------+ | |
1838 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1839 | STATE : code ROUTINE : cphs_read_mbs | | |
1840 +-----------------------------------------------------------------------+ | |
1841 | |
1842 PURPOSE : Read voice message waiting flag | |
1843 | |
1844 */ | |
1845 void cphs_read_mbs(USHORT errCode, UBYTE *data, UBYTE dataLen) | |
1846 { | |
1847 UBYTE *ptr; | |
1848 int i; /* PATCH VO 22.01.01 */ | |
1849 | |
1850 TRACE_FUNCTION ("cphs_read_mbs()"); | |
1851 | |
1852 ptr = data; | |
1853 #ifdef FF_2TO1_PS | |
1854 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR | |
1855 #else | |
1856 if ( errCode NEQ SIM_NO_ERROR OR | |
1857 #endif | |
1858 ptr EQ NULL OR | |
1859 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */ | |
1860 { | |
1861 mbStatus.result = MFW_SIMOP_READ_ERR; | |
1862 } | |
1863 else | |
1864 { | |
1865 memset(&mbStatus, MFW_CFLAG_NotPresent, sizeof(mbStatus)); | |
1866 | |
1867 //x0pleela, 07 June, 2006 DVT: OMAPS00079692 | |
1868 //Copy SIM data into mbsData to initialise mbsData with the SIM data instead of zeros | |
1869 memcpy( mbsData, ptr, dataLen ); | |
1870 | |
1871 mbStatus.result = MFW_SIMOP_READ_OK; | |
1872 | |
1873 for (i=0; i<dataLen; i++) | |
1874 { | |
1875 switch (i) | |
1876 { | |
1877 case 0: | |
1878 mbStatus.line1 = (T_MFW_CFLAG_STATUS)(ptr[i] & 0x0F); /*a0393213 compiler warnings removal - extra parenthesis added*/ | |
1879 mbStatus.line2 = (T_MFW_CFLAG_STATUS)(( ptr[i] >> 4 ) & 0x0F); | |
1880 break; | |
1881 case 1: | |
1882 mbStatus.fax = (T_MFW_CFLAG_STATUS)(ptr[i] & 0x0F); | |
1883 mbStatus.data = (T_MFW_CFLAG_STATUS)(( ptr[i] >> 4 ) & 0x0F); | |
1884 break; | |
1885 default: | |
1886 break; | |
1887 } | |
1888 } | |
1889 /* PATCH VO 22.01.01 END */ | |
1890 } | |
1891 TRACE_EVENT("Reading Mailboxes"); | |
1892 cphs_signal(E_CPHS_GET_VC_STAT, &mbStatus); | |
1893 } | |
1894 | |
1895 | |
1896 | |
1897 | |
1898 | |
1899 /* | |
1900 +-----------------------------------------------------------------------+ | |
1901 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1902 | STATE : code ROUTINE : cphs_read_cff | | |
1903 +-----------------------------------------------------------------------+ | |
1904 | |
1905 PURPOSE : Read call forwarding flag | |
1906 | |
1907 */ | |
1908 void cphs_read_cff(USHORT errCode, UBYTE *data, UBYTE dataLen) | |
1909 { | |
1910 UBYTE *ptr; | |
1911 int i; /* PATCH VO 22.01.01 */ | |
1912 | |
1913 TRACE_FUNCTION ("cphs_read_cff()"); | |
1914 | |
1915 ptr = data; | |
1916 #ifdef FF_2TO1_PS | |
1917 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR | |
1918 #else | |
1919 if ( errCode NEQ SIM_NO_ERROR OR | |
1920 #endif | |
1921 ptr EQ NULL OR | |
1922 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */ | |
1923 { | |
1924 dvStatus.result = MFW_SIMOP_READ_ERR; | |
1925 } | |
1926 else | |
1927 { | |
1928 memset(&dvStatus, MFW_CFLAG_NotPresent, sizeof(dvStatus)); | |
1929 /* May 30, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar) | |
1930 Description : CPHS Call Forwarding feature implementation | |
1931 Solution : As part of this implementation, dvData is made to be consistent with the data | |
1932 read from SIM*/ | |
1933 memcpy(&dvData, ptr,dataLen); | |
1934 dvStatus.result = MFW_SIMOP_READ_OK; | |
1935 for (i=0; i<dataLen; i++) | |
1936 { | |
1937 switch (i) | |
1938 { | |
1939 case 0: | |
1940 dvStatus.line1 = (T_MFW_CFLAG_STATUS)(ptr[i] & 0x0F); /*a0393213 compiler warnings removal - extra parenthesis added*/ | |
1941 dvStatus.line2 = (T_MFW_CFLAG_STATUS)(( ptr[i] >> 4 ) & 0x0F); | |
1942 break; | |
1943 case 1: | |
1944 dvStatus.fax = (T_MFW_CFLAG_STATUS)(ptr[i] & 0x0F); | |
1945 dvStatus.data = (T_MFW_CFLAG_STATUS)(( ptr[i] >> 4 ) & 0x0F); | |
1946 break; | |
1947 default: | |
1948 break; | |
1949 } | |
1950 } | |
1951 /* PATCH VO 22.01.01 END */ | |
1952 } | |
1953 TRACE_EVENT("CPHS valid call forwrading status"); | |
1954 cphs_signal(E_CPHS_GET_DV_STAT, &dvStatus); | |
1955 } | |
1956 | |
1957 /* | |
1958 +-----------------------------------------------------------------------+ | |
1959 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1960 | STATE : code ROUTINE : cphs_read_als | | |
1961 +-----------------------------------------------------------------------+ | |
1962 | |
1963 PURPOSE : Read alternate line service | |
1964 | |
1965 */ | |
1966 void cphs_read_als(USHORT errCode, UBYTE *data, UBYTE dataLen) | |
1967 { | |
1968 | |
1969 TRACE_FUNCTION ("cphs_read_als()"); | |
1970 } | |
1971 | |
1972 /* | |
1973 +-----------------------------------------------------------------------+ | |
1974 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1975 | STATE : code ROUTINE : cphs_read_alss | | |
1976 +-----------------------------------------------------------------------+ | |
1977 | |
1978 PURPOSE : Read alternate line service status | |
1979 | |
1980 */ | |
1981 void cphs_read_alss(USHORT errCode, UBYTE *data, UBYTE dataLen) | |
1982 { | |
1983 | |
1984 TRACE_FUNCTION ("cphs_read_alss()"); | |
1985 | |
1986 } | |
1987 | |
1988 /* | |
1989 +-----------------------------------------------------------------------+ | |
1990 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
1991 | STATE : code ROUTINE : cphs_read_csp | | |
1992 +-----------------------------------------------------------------------+ | |
1993 | |
1994 PURPOSE : Read customer service profile | |
1995 | |
1996 */ | |
1997 void cphs_read_csp(USHORT errCode, UBYTE *data, UBYTE dataLen) | |
1998 { | |
1999 UBYTE *ptr; | |
2000 UBYTE flag; | |
2001 int i; | |
2002 | |
2003 TRACE_FUNCTION ("cphs_read_csp()"); | |
2004 | |
2005 ptr = data; | |
2006 #ifdef FF_2TO1_PS | |
2007 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR | |
2008 #else | |
2009 if ( errCode NEQ SIM_NO_ERROR OR | |
2010 #endif | |
2011 ptr EQ NULL OR | |
2012 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */ | |
2013 { | |
2014 if (simStatus EQ MFW_SIMOP_READ_OK) /* Used for read information numbers */ | |
2015 { | |
2016 simStatus = MFW_SIMOP_UNKNOWN; | |
2017 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2018 } | |
2019 else | |
2020 { | |
2021 csProfile.result = MFW_SIMOP_READ_ERR; | |
2022 memset(csProfile.csp, 0, sizeof(csProfile.csp)); | |
2023 cphs_signal(E_CPHS_GET_CSP, &csProfile); | |
2024 } | |
2025 } | |
2026 else | |
2027 { | |
2028 if (simStatus EQ MFW_SIMOP_READ_OK) /* Used for read information numbers */ | |
2029 { | |
2030 simStatus = MFW_SIMOP_UNKNOWN; | |
2031 | |
2032 /* check the service group code */ | |
2033 flag = 0; | |
2034 for (i = 0; i < dataLen; i += 2) /* PATCH VO 22.01.01: use the actual length in the SIM card */ | |
2035 { | |
2036 if (ptr[i] EQ 0xD5 AND ptr[i+1] EQ 0xFF) | |
2037 flag = 1; | |
2038 } | |
2039 if (!flag) | |
2040 { | |
2041 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2042 return; | |
2043 } | |
2044 | |
2045 /* Read the first information numbers record */ | |
2046 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, 1, 0)) | |
2047 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2048 else | |
2049 cphsPrevRead = SIM_CPHS_INFN; | |
2050 } | |
2051 else | |
2052 { | |
2053 csProfile.result = MFW_SIMOP_READ_OK; | |
2054 TRACE_EVENT("CPHS valis CSP"); | |
2055 memcpy(csProfile.csp, ptr, sizeof(csProfile.csp)); | |
2056 cphs_signal(E_CPHS_GET_CSP, &csProfile); | |
2057 } | |
2058 } | |
2059 } | |
2060 | |
2061 /* | |
2062 +------------------------------------------------------------------------+ | |
2063 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
2064 | STATE : code ROUTINE : cphs_req_info_num_read | | |
2065 +------------------------------------------------------------------------+ | |
2066 | |
2067 PURPOSE : Read customer service profile | |
2068 | |
2069 */ | |
2070 | |
2071 void cphs_req_info_num_read(UBYTE rcd_num, UBYTE dataLen) | |
2072 { | |
2073 TRACE_FUNCTION ("cphs_req_info_num_read()"); | |
2074 | |
2075 if (rcd_num > maxRec) | |
2076 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2077 else | |
2078 { | |
2079 if (cphsPrevRead == SIM_CPHS_INFN) | |
2080 { | |
2081 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, rcd_num, dataLen)) | |
2082 { | |
2083 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2084 } | |
2085 else | |
2086 { | |
2087 cphsPrevRead = SIM_CPHS_INFN; | |
2088 } | |
2089 } | |
2090 else | |
2091 { | |
2092 if (cphsPrevRead == SIM_CPHS_INFN2) | |
2093 { | |
2094 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, rcd_num, dataLen)) | |
2095 { | |
2096 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2097 } | |
2098 else | |
2099 { | |
2100 cphsPrevRead = SIM_CPHS_INFN2; | |
2101 } | |
2102 } | |
2103 } | |
2104 } | |
2105 } | |
2106 | |
2107 /* | |
2108 +--------------------------------------------------------------------------+ | |
2109 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
2110 | STATE : code ROUTINE : cphs_read_first_info_num | | |
2111 +--------------------------------------------------------------------------+ | |
2112 | |
2113 PURPOSE : Read first record of information numbers | |
2114 | |
2115 */ | |
2116 | |
2117 void cphs_read_first_info_num(SHORT table_id) | |
2118 { | |
2119 UBYTE dataLen; | |
2120 | |
2121 TRACE_FUNCTION ("cphs_read_first_info_num()"); | |
2122 | |
2123 #ifdef FF_2TO1_PS | |
2124 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR ) /* VO patch 040501 - remove dataLen and pData check */ | |
2125 #else | |
2126 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR ) /* VO patch 040501 - remove dataLen and pData check */ | |
2127 #endif | |
2128 { | |
2129 if (simStatus EQ MFW_SIMOP_READ_OK) /* Read entry of information numbers */ | |
2130 { | |
2131 simStatus = MFW_SIMOP_UNKNOWN; | |
2132 infoEntry.result = MFW_SIMOP_READ_ERR; | |
2133 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); | |
2134 } | |
2135 else | |
2136 {// if we are here then its possible the read of 7F20 6F19 failed. | |
2137 | |
2138 if (cphsPrevRead == SIM_CPHS_INFN) | |
2139 { | |
2140 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0)) | |
2141 { | |
2142 infoEntry.result = MFW_SIMOP_READ_ERR; | |
2143 cphs_signal(E_CPHS_GET_INFO_LIST, &infoEntry); | |
2144 } | |
2145 else | |
2146 { | |
2147 cphsPrevRead = SIM_CPHS_INFN2; | |
2148 } | |
2149 } | |
2150 else | |
2151 { | |
2152 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2153 } | |
2154 } | |
2155 } | |
2156 else | |
2157 { | |
2158 maxRec = simShrdPrm.atb[table_id].recMax; | |
2159 dataLen = simShrdPrm.atb[table_id].dataLen; | |
2160 | |
2161 if (simStatus EQ MFW_SIMOP_READ_OK) /* Read entry of information numbers */ | |
2162 { | |
2163 /* VO patch 040501 - add dataLen check: if (patch) else ... */ | |
2164 if (dataLen < MFW_CPHS_MIN_INS_SIZE ) | |
2165 { | |
2166 simStatus = MFW_SIMOP_UNKNOWN; | |
2167 infoEntry.result = MFW_SIMOP_READ_ERR; | |
2168 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); | |
2169 } | |
2170 else | |
2171 cphs_req_info_num_read(startIdx, dataLen); | |
2172 } | |
2173 else /* Read list of information numbers */ | |
2174 { | |
2175 /* VO patch 040501 - add dataLen check: if (patch) else ... */ | |
2176 if (dataLen < MFW_CPHS_MIN_INS_SIZE ) | |
2177 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2178 else | |
2179 { | |
2180 if (idxLevel EQ 1) /* read this entry */ | |
2181 cphs_read_info_num(table_id); | |
2182 else /* read the startIndex record */ | |
2183 cphs_req_info_num_read(startIdx, dataLen); | |
2184 } | |
2185 } | |
2186 } | |
2187 } | |
2188 | |
2189 /* | |
2190 +---------------------------------------------------------------------+ | |
2191 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
2192 | STATE : code ROUTINE : cphs_read_info_num | | |
2193 +---------------------------------------------------------------------+ | |
2194 | |
2195 PURPOSE : Read first record of information numbers | |
2196 | |
2197 */ | |
2198 | |
2199 void cphs_read_info_num(SHORT table_id) | |
2200 { | |
2201 UBYTE* pData; /* points to data buffer */ | |
2202 UBYTE dataLen; | |
2203 UBYTE alphaLen; | |
2204 UBYTE recNr; | |
2205 T_ACI_TOA type; | |
2206 | |
2207 TRACE_FUNCTION ("cphs_read_info_num()"); | |
2208 | |
2209 pData = simShrdPrm.atb[table_id].exchData; | |
2210 dataLen = simShrdPrm.atb[table_id].dataLen; | |
2211 recNr = simShrdPrm.atb[table_id].recNr; | |
2212 | |
2213 #ifdef FF_2TO1_PS | |
2214 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR OR | |
2215 #else | |
2216 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR OR | |
2217 #endif | |
2218 pData EQ NULL OR | |
2219 dataLen < MFW_CPHS_MIN_INS_SIZE ) | |
2220 { | |
2221 if (simStatus EQ MFW_SIMOP_READ_OK) /* Read entry of information numbers */ | |
2222 { | |
2223 simStatus = MFW_SIMOP_UNKNOWN; | |
2224 infoEntry.result = MFW_SIMOP_READ_ERR; | |
2225 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); | |
2226 } | |
2227 else | |
2228 {// if we are here then its possible the read of 7F20 6F19 failed. | |
2229 // so we must try reading 7F10 EA01 instead. | |
2230 | |
2231 if (cphsPrevRead == SIM_CPHS_INFN2) | |
2232 { | |
2233 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0)) | |
2234 { | |
2235 infoEntry.result = MFW_SIMOP_READ_ERR; | |
2236 cphs_signal(E_CPHS_GET_INFO_LIST, &infoEntry); | |
2237 } | |
2238 else | |
2239 { | |
2240 cphsPrevRead = SIM_CPHS_INFN2; | |
2241 } | |
2242 } | |
2243 else | |
2244 { | |
2245 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2246 } | |
2247 } | |
2248 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); // correct ??? VO | |
2249 } | |
2250 else | |
2251 { | |
2252 if (simStatus EQ MFW_SIMOP_READ_OK) | |
2253 { | |
2254 /* Read entry of information numbers */ | |
2255 alphaLen = *pData; | |
2256 if (alphaLen) | |
2257 { | |
2258 /* copy/encode entry */ | |
2259 infoEntry.index = recNr; | |
2260 infoEntry.entryStat = *(pData + 1); | |
2261 | |
2262 cmhPHB_getMfwTagNt(pData + 2, alphaLen, | |
2263 infoEntry.alpha.data, &infoEntry.alpha.len); | |
2264 | |
2265 pData += alphaLen + 2; | |
2266 | |
2267 if (*pData NEQ 0xFF) | |
2268 { | |
2269 cmhPHB_getAdrStr ( (CHAR *)infoEntry.number, | |
2270 3, /* length of number */ | |
2271 pData + 2, | |
2272 *pData ); | |
2273 cmhPHB_toaDmrg ( *( pData + 1 ), &type ); | |
2274 infoEntry.ton = phb_cvtTon(type.ton); | |
2275 infoEntry.npi = phb_cvtNpi(type.npi); | |
2276 infoEntry.entryStat = infoEntry.entryStat | 0x80; | |
2277 } | |
2278 else | |
2279 { | |
2280 infoEntry.number[0] = '\0'; | |
2281 infoEntry.ton = MFW_TON_UNKNOWN; | |
2282 infoEntry.npi = MFW_NPI_UNKNOWN; | |
2283 } | |
2284 } | |
2285 infoEntry.result = MFW_SIMOP_READ_OK; | |
2286 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); | |
2287 return; | |
2288 } | |
2289 else if ((*(pData + 1) & 0x0F) < idxLevel) | |
2290 { | |
2291 /* The index level is out the wished index level. */ | |
2292 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); | |
2293 } | |
2294 else if ((*(pData + 1) & 0x0F) > idxLevel) | |
2295 { | |
2296 /* This is not wished index level. Read the next */ | |
2297 recNr++; | |
2298 cphs_req_info_num_read(recNr, dataLen); | |
2299 } | |
2300 else | |
2301 { | |
2302 /* This is the wished index level. Read it. */ | |
2303 alphaLen = *pData; | |
2304 if (alphaLen) /* check alpha length */ | |
2305 { | |
2306 /* copy/encode this entry in list */ | |
2307 numList.level = idxLevel; | |
2308 numList.entry[numList.count].index = recNr; | |
2309 numList.entry[numList.count].entryStat = *(pData + 1) & 0x7F; /* set bit 8 to 0 */ | |
2310 | |
2311 cmhPHB_getMfwTagNt(pData + 2, alphaLen, | |
2312 numList.entry[numList.count].alpha.data, | |
2313 &numList.entry[numList.count].alpha.len); | |
2314 | |
2315 pData += alphaLen + 2; | |
2316 | |
2317 if (*pData NEQ 0xFF) | |
2318 { | |
2319 numList.entry[numList.count].entryStat = numList.entry[numList.count].entryStat | 0x80; | |
2320 } | |
2321 numList.count++; | |
2322 } | |
2323 recNr++; | |
2324 /* Read the next record */ | |
2325 cphs_req_info_num_read(recNr, dataLen); | |
2326 } | |
2327 } | |
2328 } | |
2329 | |
2330 /* | |
2331 +--------------------------------------------------------------------------+ | |
2332 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
2333 | STATE : code ROUTINE : cphs_read_eeprom_mailbox | | |
2334 +--------------------------------------------------------------------------+ | |
2335 | |
2336 PURPOSE : Read mailbox number from EEPROM | |
2337 | |
2338 */ | |
2339 | |
2340 void cphs_read_eeprom_mailbox(void) | |
2341 { | |
2342 U8 version; | |
2343 #ifdef PCM_2_FFS | |
2344 T_PSPDF_MBN mbn; | |
2345 #else | |
2346 EF_MBN mbn; | |
2347 #endif | |
2348 | |
2349 T_ACI_TOA numTp; | |
2350 int i; | |
2351 USHORT max_rcd; | |
2352 | |
2353 for (i=0; i<MAX_CPHS_ENTRY; i++) | |
2354 { | |
2355 #ifdef PCM_2_FFS | |
2356 if (ffs_ReadRecord((UBYTE *)PSPDF_MBN_ID, (UBYTE *)&mbn, | |
2357 sizeof( T_PSPDF_MBN ), (USHORT)(i+1), 1 ) == sizeof( T_PSPDF_MBN ) ) | |
2358 | |
2359 #else | |
2360 if (pcm_ReadRecord((UBYTE *)EF_MBN_ID, | |
2361 (USHORT)(i+1), | |
2362 SIZE_EF_MBN, | |
2363 (UBYTE *)&mbn, | |
2364 &version, | |
2365 &max_rcd) == PCM_OK) | |
2366 #endif | |
2367 | |
2368 { | |
2369 if (mbn.len) | |
2370 { | |
2371 mbNum.entries[mbNum.count].index = i+1; | |
2372 cmhPHB_getAdrStr ( (char *)mbNum.entries[mbNum.count].number, | |
2373 PHB_MAX_LEN - 1, mbn.mbNum, mbn.len ); | |
2374 cmhPHB_getMfwTagNt ( mbn.alphId, 10, | |
2375 mbNum.entries[mbNum.count].alpha.data, | |
2376 &mbNum.entries[mbNum.count].alpha.len ); | |
2377 cmhPHB_toaDmrg ( mbn.numTp, &numTp ); | |
2378 mbNum.entries[mbNum.count].ton = phb_cvtTon(numTp.ton); | |
2379 mbNum.entries[mbNum.count].npi = phb_cvtNpi(numTp.npi); | |
2380 mbNum.entries[mbNum.count].service = i; | |
2381 mbNum.count++; | |
2382 } | |
2383 } | |
2384 } | |
2385 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum); | |
2386 } | |
2387 | |
2388 /* | |
2389 +---------------------------------------------------------------------------+ | |
2390 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
2391 | STATE : code ROUTINE : cphs_write_eeprom_mailbox | | |
2392 +---------------------------------------------------------------------------+ | |
2393 | |
2394 PURPOSE : Write mailbox number in EEPROM | |
2395 | |
2396 */ | |
2397 | |
2398 void cphs_write_eeprom_mailbox(T_MFW_CPHS_ENTRY *entry) | |
2399 { | |
2400 T_ACI_PB_TEXT text; | |
2401 UBYTE len; | |
2402 //EF_MBN mbn; | |
2403 T_ACI_TOA type; | |
2404 UBYTE *pNumber; | |
2405 UBYTE result; | |
2406 UBYTE outLen; | |
2407 | |
2408 len = MINIMUM ( MAX_PCM_MAILBOX_LEN, entry->alpha.len); | |
2409 text.len = len; | |
2410 memcpy(text.data, entry->alpha.data, len); | |
2411 text.cs = CS_Sim; | |
2412 cmhPHB_getMfwTagSim ( &text, FFS_flashData.mbn_AlphId, &outLen, MAX_PCM_MAILBOX_LEN ); | |
2413 | |
2414 if ( entry->number[0] EQ '+') | |
2415 { | |
2416 type.ton = TON_International; | |
2417 pNumber = &entry->number[1]; | |
2418 } | |
2419 else | |
2420 { | |
2421 type.ton = (T_ACI_TOA_TON)entry->ton;/*a0393213 warnings removal-explicit typecasting done*/ | |
2422 pNumber = &entry->number[0]; | |
2423 } | |
2424 type.npi = (T_ACI_TOA_NPI)entry->npi;/*a0393213 warnings removal-explicit typecasting done*/ | |
2425 //MC- switching from PCM to FFS | |
2426 cmhPHB_toaMrg ( &type, /*&mbn.numTp*/&FFS_flashData.mbn_numTp ); | |
2427 | |
2428 cmhPHB_getAdrBcd ((UBYTE*) FFS_flashData.mbn_Num/*mbn.mbNum*/, /*&mbn.len*/&FFS_flashData.mbn_len, | |
2429 MAX_PCM_MAILBOX_LEN, (CHAR *)pNumber ); | |
2430 FFS_flashData.mbn_len/*mbn.len*/++; | |
2431 | |
2432 if (flash_write() == EFFS_OK) | |
2433 | |
2434 result = MFW_SIMOP_WRITE_OK; | |
2435 else | |
2436 result = MFW_SIMOP_WRITE_ERR; | |
2437 cphs_signal(E_CPHS_SET_VC_NUM, &result); | |
2438 } | |
2439 | |
2440 /* | |
2441 +-----------------------------------------------------------------------+ | |
2442 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
2443 | STATE : code ROUTINE : cphs_read_eeprom_als | | |
2444 +-----------------------------------------------------------------------+ | |
2445 | |
2446 PURPOSE : Read alternate line service information from EEPROM | |
2447 | |
2448 */ | |
2449 | |
2450 void cphs_read_eeprom_als(T_MFW_CPHS_ALS_STATUS *info) | |
2451 { | |
2452 #ifdef PCM_2_FFS | |
2453 T_PSPDF_ALS alsInfo; | |
2454 #else | |
2455 EF_ALS alsInfo; | |
2456 #endif | |
2457 | |
2458 // UBYTE version; // RAVI | |
2459 | |
2460 TRACE_FUNCTION ("cphs_read_eeprom_als()"); | |
2461 alsInfo.selLine = FFS_flashData.als_selLine; | |
2462 alsInfo.statLine = FFS_flashData.als_statLine; | |
2463 { | |
2464 switch (alsInfo.selLine) | |
2465 { | |
2466 case MFW_SERV_LINE1: | |
2467 alsStatus.selectedLine = MFW_SERV_LINE1; | |
2468 break; | |
2469 case MFW_SERV_LINE2: | |
2470 alsStatus.selectedLine = MFW_SERV_LINE2; | |
2471 break; | |
2472 default: | |
2473 alsStatus.selectedLine = MFW_SERV_LINE2; | |
2474 break; | |
2475 } | |
2476 | |
2477 switch (alsInfo.statLine) | |
2478 { | |
2479 case MFW_LINE_LOCKED: | |
2480 alsStatus.status = MFW_LINE_LOCKED; | |
2481 break; | |
2482 case MFW_LINE_UNLOCKED: | |
2483 alsStatus.status = MFW_LINE_UNLOCKED; | |
2484 break; | |
2485 default: | |
2486 alsStatus.status = MFW_LINE_UNLOCKED; | |
2487 break; | |
2488 } | |
2489 } | |
2490 | |
2491 info->selectedLine = alsStatus.selectedLine; | |
2492 info->status = alsStatus.status; | |
2493 | |
2494 } | |
2495 | |
2496 /* | |
2497 +-----------------------------------------------------------------------+ | |
2498 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
2499 | STATE : code ROUTINE : cphs_write_eeprom_als | | |
2500 +-----------------------------------------------------------------------+ | |
2501 | |
2502 PURPOSE : Write selected alternate line in EEPROM | |
2503 | |
2504 */ | |
2505 | |
2506 void cphs_write_eeprom_als(UBYTE *res) | |
2507 { | |
2508 | |
2509 | |
2510 | |
2511 | |
2512 /*a0393213 compiler warnings removal - variable alsinfo deleted*/ | |
2513 | |
2514 | |
2515 TRACE_FUNCTION ("cphs_write_eeprom_als()"); | |
2516 { | |
2517 if (alsStatus.status EQ MFW_LINE_LOCKED) | |
2518 *res = MFW_SIMOP_WRITE_ERR; | |
2519 | |
2520 alsStatus.selectedLine = (T_MFW_LINE_INDEX)alsData; | |
2521 | |
2522 FFS_flashData.als_selLine = alsData; | |
2523 if (flash_write() == EFFS_OK) | |
2524 *res = MFW_SIMOP_WRITE_OK; | |
2525 else | |
2526 *res = MFW_SIMOP_WRITE_ERR; | |
2527 } | |
2528 } | |
2529 | |
2530 /* | |
2531 +-----------------------------------------------------------------------+ | |
2532 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
2533 | STATE : code ROUTINE : cphs_write_eeprom_alss| | |
2534 +-----------------------------------------------------------------------+ | |
2535 | |
2536 PURPOSE : Write line lock status in EEPROM | |
2537 | |
2538 */ | |
2539 | |
2540 void cphs_write_eeprom_alss(UBYTE *res) | |
2541 { | |
2542 | |
2543 | |
2544 /*a0393213 compiler warnings removal - variable alsinfo removed*/ | |
2545 | |
2546 | |
2547 TRACE_FUNCTION ("cphs_write_eeprom_als()"); | |
2548 { | |
2549 alsStatus.status = (T_MFW_LINE_STATUS)alsData; | |
2550 FFS_flashData.als_statLine = alsData; | |
2551 | |
2552 if (flash_write() == EFFS_OK) | |
2553 *res = MFW_SIMOP_WRITE_OK; | |
2554 else | |
2555 *res = MFW_SIMOP_WRITE_ERR; | |
2556 } | |
2557 } | |
2558 | |
2559 /* | |
2560 +----------------------------------------------------------------------+ | |
2561 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
2562 | STATE : code ROUTINE: cphs_read_sim_dat | | |
2563 +----------------------------------------------------------------------+ | |
2564 | |
2565 | |
2566 PURPOSE : Request to read SIM card. | |
2567 | |
2568 */ | |
2569 | |
2570 BOOL cphs_read_sim_dat(USHORT data_id, UBYTE len, UBYTE max_length) | |
2571 { | |
2572 T_ACI_RETURN res; | |
2573 | |
2574 TRACE_FUNCTION ("cphs_read_sim_dat()"); | |
2575 | |
2576 #ifdef FF_2TO1_PS | |
2577 res = cmhSIM_ReadTranspEF ( CMD_SRC_NONE, | |
2578 AT_CMD_NONE, | |
2579 FALSE, /* SCT: dummy only (path info valid flag) */ | |
2580 NULL, /* SCT: dummy only (path info)*/ | |
2581 data_id, | |
2582 0, | |
2583 max_length, | |
2584 NULL, | |
2585 cphs_read_sim_dat_cb); | |
2586 #else | |
2587 res = cmhSIM_ReadTranspEF ( CMD_SRC_NONE, | |
2588 AT_CMD_NONE, | |
2589 FALSE, /* SCT: dummy only (path info valid flag) */ | |
2590 NULL, /* SCT: dummy only (path info)*/ | |
2591 data_id, | |
2592 0, | |
2593 max_length, | |
2594 NULL, | |
2595 cphs_read_sim_dat_cb); | |
2596 #endif | |
2597 if (res NEQ AT_EXCT) | |
2598 return FALSE; | |
2599 return TRUE; | |
2600 } | |
2601 | |
2602 /* | |
2603 +----------------------------------------------------------------------+ | |
2604 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
2605 | STATE : code ROUTINE: cphs_read_sim_dat_cb | | |
2606 +----------------------------------------------------------------------+ | |
2607 | |
2608 | |
2609 PURPOSE : Call back for SIM read. | |
2610 | |
2611 */ | |
2612 | |
2613 void cphs_read_sim_dat_cb(SHORT table_id) | |
2614 { | |
2615 UBYTE dataLen; | |
2616 UBYTE result; | |
2617 TRACE_FUNCTION ("cphs_read_sim_dat_cb()"); | |
2618 /***************************Go-lite Optimization changes Start***********************/ | |
2619 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
2620 TRACE_EVENT_P1("SIM Error code!!!%d",simShrdPrm.atb[table_id].errCode); | |
2621 /***************************Go-lite Optimization changes end***********************/ | |
2622 switch (simShrdPrm.atb[table_id].reqDataFld) | |
2623 { | |
2624 case SIM_CPHS_CINF: /* CPHS information */ | |
2625 if (!cphsUpdate) | |
2626 cphs_read_information(simShrdPrm.atb[table_id].errCode, | |
2627 simShrdPrm.atb[table_id].exchData, | |
2628 simShrdPrm.atb[table_id].dataLen); | |
2629 #ifdef SIM_TOOLKIT | |
2630 else | |
2631 cphs_update_info_cnf(simShrdPrm.atb[table_id].errCode, | |
2632 simShrdPrm.atb[table_id].exchData, | |
2633 simShrdPrm.atb[table_id].dataLen); | |
2634 #endif | |
2635 break; | |
2636 | |
2637 case SIM_CPHS_ONSTR: /* operator name string */ | |
2638 cphs_read_ons(simShrdPrm.atb[table_id].errCode, | |
2639 simShrdPrm.atb[table_id].exchData, | |
2640 simShrdPrm.atb[table_id].dataLen); | |
2641 break; | |
2642 | |
2643 case SIM_CPHS_ONSHF: /* operator name short form */ | |
2644 cphs_read_onsf(simShrdPrm.atb[table_id].errCode, | |
2645 simShrdPrm.atb[table_id].exchData, | |
2646 simShrdPrm.atb[table_id].dataLen); | |
2647 break; | |
2648 | |
2649 case SIM_CPHS_VMW: /* voice message waiting flag */ | |
2650 /* PATCH VO 22.01.01 */ | |
2651 if (simStatus EQ MFW_SIMOP_WRITE_OK) | |
2652 { | |
2653 /* Determine the size of this field, and write the data. | |
2654 When the writing is not possible, write this voice | |
2655 message waiting flag in EEPROM. */ | |
2656 simStatus = MFW_SIMOP_UNKNOWN; | |
2657 #ifdef FF_2TO1_PS | |
2658 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) | |
2659 #else | |
2660 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) | |
2661 #endif | |
2662 { | |
2663 dataLen = simShrdPrm.atb[table_id].dataLen; | |
2664 /* Write voice message waiting flag. | |
2665 When this writing failed, send event with "write error" parameter to MMI */ | |
2666 if (!cphs_write_sim_dat(SIM_CPHS_VMW, mbsData, dataLen)) | |
2667 { | |
2668 result = MFW_SIMOP_WRITE_ERR; | |
2669 cphs_signal(E_CPHS_SET_VC_STAT, &result); | |
2670 } | |
2671 } | |
2672 else | |
2673 { | |
2674 result = MFW_SIMOP_WRITE_ERR; | |
2675 cphs_signal(E_CPHS_SET_VC_STAT, &result); | |
2676 } | |
2677 } | |
2678 else | |
2679 /* PATCH VO 22.01.01 end */ | |
2680 cphs_read_mbs (simShrdPrm.atb[table_id].errCode, | |
2681 simShrdPrm.atb[table_id].exchData, | |
2682 simShrdPrm.atb[table_id].dataLen); | |
2683 break; | |
2684 | |
2685 case SIM_CPHS_CFF: /* call forwarding flag */ | |
2686 /* PATCH VO 22.01.01 */ | |
2687 if (simStatus EQ MFW_SIMOP_WRITE_OK) | |
2688 { | |
2689 /* Determine the size of this field, and write the data. | |
2690 When the writing is not possible, write this call forward flag in EEPROM*/ | |
2691 simStatus = MFW_SIMOP_UNKNOWN; | |
2692 #ifdef FF_2TO1_PS | |
2693 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) | |
2694 #else | |
2695 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) | |
2696 #endif | |
2697 { | |
2698 dataLen = simShrdPrm.atb[table_id].dataLen; | |
2699 /* Write call forwarding flag. | |
2700 When this writing failed, send event with "write error" parameter to MMI */ | |
2701 TRACE_EVENT_P2("cphs_read_sim_dat_cb():%x %x",dvData[0],dvData[1]); | |
2702 if (!cphs_write_sim_dat(SIM_CPHS_CFF, dvData, dataLen)) | |
2703 { | |
2704 result = MFW_SIMOP_WRITE_ERR; | |
2705 cphs_signal(E_CPHS_SET_DV_STAT, &result); | |
2706 } | |
2707 } | |
2708 else | |
2709 { | |
2710 result = MFW_SIMOP_WRITE_ERR; | |
2711 /*May 30, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar) | |
2712 Description : CPHS Call Forwarding feature implementation | |
2713 Solution : As part of the implementation, a typographical error is corrected. | |
2714 E_CPHS_SET_VC_STAT was changed to E_CPHS_SET_DV_STAT*/ | |
2715 cphs_signal(E_CPHS_SET_DV_STAT, &result); | |
2716 } | |
2717 } | |
2718 else | |
2719 /* PATCH VO 22.01.01 end */ | |
2720 cphs_read_cff (simShrdPrm.atb[table_id].errCode, | |
2721 simShrdPrm.atb[table_id].exchData, | |
2722 simShrdPrm.atb[table_id].dataLen); | |
2723 break; | |
2724 | |
2725 | |
2726 case SIM_CPHS_CSP: /* customer service profile */ | |
2727 cphs_read_csp (simShrdPrm.atb[table_id].errCode, | |
2728 simShrdPrm.atb[table_id].exchData, | |
2729 simShrdPrm.atb[table_id].dataLen); | |
2730 break; | |
2731 | |
2732 default: | |
2733 break; | |
2734 } | |
2735 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; | |
2736 } | |
2737 | |
2738 /* | |
2739 +----------------------------------------------------------------------+ | |
2740 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
2741 | STATE : code ROUTINE: cphs_write_sim_dat | | |
2742 +----------------------------------------------------------------------+ | |
2743 | |
2744 | |
2745 PURPOSE : Request to write SIM card. | |
2746 | |
2747 */ | |
2748 | |
2749 BOOL cphs_write_sim_dat(USHORT data_id, UBYTE *data, UBYTE length) | |
2750 { | |
2751 T_ACI_RETURN res; | |
2752 | |
2753 TRACE_FUNCTION ("cphs_write_sim_dat()"); | |
2754 | |
2755 #ifdef FF_2TO1_PS | |
2756 res = cmhSIM_WriteTranspEF (CMD_SRC_NONE, | |
2757 AT_CMD_NONE, | |
2758 FALSE, /* SCT: dummy only (path info valid flag) */ | |
2759 NULL, /* SCT: dummy only (path info) */ | |
2760 data_id, | |
2761 0, | |
2762 length, | |
2763 data, | |
2764 cphs_write_sim_dat_cb); | |
2765 #else | |
2766 res = cmhSIM_WriteTranspEF (CMD_SRC_NONE, | |
2767 AT_CMD_NONE, | |
2768 FALSE, /* SCT: dummy only (path info valid flag) */ | |
2769 NULL, /* SCT: dummy only (path info) */ | |
2770 data_id, | |
2771 0, | |
2772 length, | |
2773 data, | |
2774 cphs_write_sim_dat_cb); | |
2775 #endif | |
2776 | |
2777 if (res NEQ AT_EXCT) | |
2778 return FALSE; | |
2779 | |
2780 return TRUE; | |
2781 } | |
2782 | |
2783 /* | |
2784 +----------------------------------------------------------------------+ | |
2785 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
2786 | STATE : code ROUTINE: cphs_write_sim_dat_cb | | |
2787 +----------------------------------------------------------------------+ | |
2788 | |
2789 | |
2790 PURPOSE : callback of SIM card writing. | |
2791 | |
2792 */ | |
2793 | |
2794 void cphs_write_sim_dat_cb(SHORT table_id) | |
2795 { | |
2796 UBYTE result; | |
2797 TRACE_FUNCTION ("sim_write_sim_dat_cb()"); | |
2798 /***************************Go-lite Optimization changes Start***********************/ | |
2799 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
2800 TRACE_EVENT_P1("SIM Error code!!!%d", simShrdPrm.atb[table_id].errCode); | |
2801 /***************************Go-lite Optimization changes end***********************/ | |
2802 switch (simShrdPrm.atb[table_id].reqDataFld) | |
2803 { | |
2804 case SIM_CPHS_VMW: /* voice message waiting flag */ | |
2805 #ifdef FF_2TO1_PS | |
2806 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) | |
2807 #else | |
2808 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) | |
2809 #endif | |
2810 { | |
2811 result = MFW_SIMOP_WRITE_OK; | |
2812 cphs_signal(E_CPHS_SET_VC_STAT, &result); | |
2813 } | |
2814 else | |
2815 { | |
2816 result = MFW_SIMOP_WRITE_ERR; | |
2817 cphs_signal(E_CPHS_SET_VC_STAT, &result); | |
2818 } | |
2819 break; | |
2820 | |
2821 case SIM_CPHS_CFF: /* call forwarding flag */ | |
2822 #ifdef FF_2TO1_PS | |
2823 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) | |
2824 #else | |
2825 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) | |
2826 #endif | |
2827 { | |
2828 result = MFW_SIMOP_WRITE_OK; | |
2829 cphs_signal(E_CPHS_SET_DV_STAT, &result); | |
2830 } | |
2831 else | |
2832 { | |
2833 result = MFW_SIMOP_WRITE_ERR; | |
2834 cphs_signal(E_CPHS_SET_DV_STAT, &result); | |
2835 } | |
2836 break; | |
2837 | |
2838 default: | |
2839 break; | |
2840 } | |
2841 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; | |
2842 } | |
2843 | |
2844 /* | |
2845 +----------------------------------------------------------------------+ | |
2846 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
2847 | STATE : code ROUTINE: cphs_read_sim_rcd | | |
2848 +----------------------------------------------------------------------+ | |
2849 | |
2850 | |
2851 PURPOSE : Request to read SIM card. | |
2852 | |
2853 */ | |
2854 | |
2855 BOOL cphs_read_sim_rcd(USHORT data_id, UBYTE rcd_num, UBYTE len) | |
2856 { | |
2857 T_ACI_RETURN res; | |
2858 UBYTE dataLen; | |
2859 | |
2860 TRACE_FUNCTION ("cphs_read_sim_rcd()"); | |
2861 TRACE_EVENT_P1("rec num to be read: %d", rcd_num); | |
2862 | |
2863 if (rcd_num EQ 1) | |
2864 dataLen = UCHAR_MAX; | |
2865 else | |
2866 dataLen = len; | |
2867 | |
2868 #ifdef FF_2TO1_PS | |
2869 res = cmhSIM_ReadRecordEF ( CMD_SRC_NONE, | |
2870 AT_CMD_NONE, | |
2871 TRUE, /* SCT: dummy only (path info valid flag) */ | |
2872 NULL, /* SCT: dummy only (path info) */ | |
2873 data_id, | |
2874 rcd_num, | |
2875 dataLen, | |
2876 NULL, | |
2877 cphs_read_sim_rcd_cb); | |
2878 #else | |
2879 res = cmhSIM_ReadRecordEF ( CMD_SRC_NONE, | |
2880 AT_CMD_NONE, | |
2881 FALSE, /* SCT: dummy only (path info valid flag) */ | |
2882 NULL, /* SCT: dummy only (path info) */ | |
2883 data_id, | |
2884 rcd_num, | |
2885 dataLen, | |
2886 NULL, | |
2887 cphs_read_sim_rcd_cb); | |
2888 #endif | |
2889 | |
2890 if (res NEQ AT_EXCT) | |
2891 return FALSE; | |
2892 | |
2893 return TRUE; | |
2894 } | |
2895 | |
2896 /* | |
2897 +----------------------------------------------------------------------+ | |
2898 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
2899 | STATE : code ROUTINE: cphs_read_sim_rcd_cb | | |
2900 +----------------------------------------------------------------------+ | |
2901 | |
2902 | |
2903 PURPOSE : Request to read SIM card. | |
2904 | |
2905 */ | |
2906 | |
2907 void cphs_read_sim_rcd_cb (SHORT table_id) | |
2908 { | |
2909 UBYTE dataLen; | |
2910 TRACE_FUNCTION ("cphs_read_sim_rcd_cb()"); | |
2911 /***************************Go-lite Optimization changes Start***********************/ | |
2912 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
2913 TRACE_EVENT_P1("SIM Error code!!!%d", simShrdPrm.atb[table_id].errCode); | |
2914 | |
2915 | |
2916 TRACE_EVENT_P1("tableid: %d", table_id); | |
2917 /***************************Go-lite Optimization changes end***********************/ | |
2918 switch (simShrdPrm.atb[table_id].reqDataFld) | |
2919 { | |
2920 case SIM_CPHS_MBXN: /* mailbox numbers */ | |
2921 if (simStatus EQ MFW_SIMOP_WRITE_OK) | |
2922 { | |
2923 /* Determine the size of record, and write a new record. | |
2924 When the writing is not possible, write this mailbox | |
2925 number in EEPROM. */ | |
2926 simStatus = MFW_SIMOP_UNKNOWN; | |
2927 #ifdef FF_2TO1_PS | |
2928 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) | |
2929 #else | |
2930 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) | |
2931 #endif | |
2932 { | |
2933 dataLen = simShrdPrm.atb[table_id].dataLen; | |
2934 /* allocate mbnData (sizeof(dataLen)) */ | |
2935 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
2936 // the dynamic allocation is done here, if the write fails it is deallocated | |
2937 // else if success it is deallocated in the callback | |
2938 #ifdef FF_MMI_OPTIM | |
2939 mbnData = (UBYTE*)mfwAlloc(200); | |
2940 if(mbnData != NULL) | |
2941 { | |
2942 #endif | |
2943 ubCphsMbExtRecNo = 0; | |
2944 | |
2945 cphs_build_mbn_data(mbnData, dataLen); | |
2946 | |
2947 if (!cphs_write_sim_rcd(SIM_CPHS_MBXN, vcEntry->index, | |
2948 mbnData, dataLen)) | |
2949 { | |
2950 cphs_write_eeprom_mailbox(vcEntry); | |
2951 } | |
2952 #ifdef FF_MMI_OPTIM | |
2953 } | |
2954 #endif | |
2955 } | |
2956 else | |
2957 cphs_write_eeprom_mailbox(vcEntry); | |
2958 } | |
2959 else | |
2960 cphs_read_mbn(table_id); | |
2961 break; | |
2962 | |
2963 case SIM_CPHS_INFN: /* information numbers */ | |
2964 if (simShrdPrm.atb[table_id].recNr EQ 1) | |
2965 { | |
2966 /* VO patch 150501 */ | |
2967 if ((startIdx EQ 1) AND (simStatus EQ MFW_SIMOP_READ_OK)) | |
2968 cphs_read_info_num(table_id); | |
2969 else | |
2970 /* VO patch 150501 end */ | |
2971 cphs_read_first_info_num(table_id); | |
2972 } | |
2973 else | |
2974 cphs_read_info_num(table_id); | |
2975 break; | |
2976 | |
2977 case SIM_CPHS_INFN2: /* information numbers 2 - 7F10 'EA01' selected if SIM_CPHS_INFN '6F19' isn't there*/ | |
2978 if (simShrdPrm.atb[table_id].recNr EQ 1) | |
2979 { | |
2980 /* VO patch 150501 */ | |
2981 if ((startIdx EQ 1) AND (simStatus EQ MFW_SIMOP_READ_OK)) | |
2982 cphs_read_info_num(table_id); | |
2983 else | |
2984 /* VO patch end */ | |
2985 cphs_read_first_info_num(table_id); | |
2986 } | |
2987 else | |
2988 cphs_read_info_num(table_id); | |
2989 break; | |
2990 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ | |
2991 case SIM_EXT1: | |
2992 | |
2993 cphs_read_ext1(table_id); | |
2994 | |
2995 | |
2996 | |
2997 break; | |
2998 | |
2999 default: | |
3000 break; | |
3001 } | |
3002 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; | |
3003 } | |
3004 | |
3005 | |
3006 /* | |
3007 +----------------------------------------------------------------------+ | |
3008 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3009 | STATE : code ROUTINE: cphs_write_sim_rcd | | |
3010 +----------------------------------------------------------------------+ | |
3011 | |
3012 | |
3013 PURPOSE : Request to write SIM card. | |
3014 | |
3015 */ | |
3016 | |
3017 BOOL cphs_write_sim_rcd(USHORT data_id, UBYTE rcd_num, | |
3018 UBYTE *data, UBYTE dataLen) | |
3019 { | |
3020 T_ACI_RETURN res; | |
3021 | |
3022 TRACE_FUNCTION ("cphs_read_sim_rcd()"); | |
3023 | |
3024 #ifdef FF_2TO1_PS | |
3025 res = cmhSIM_WriteRecordEF (CMD_SRC_NONE, | |
3026 AT_CMD_NONE, | |
3027 TRUE, /* SCT: dummy only (path info valid flag) */ | |
3028 NULL, /* SCT: dummy only (path info) */ | |
3029 data_id, | |
3030 rcd_num, | |
3031 dataLen, | |
3032 data, | |
3033 cphs_write_sim_rcd_cb); | |
3034 #else | |
3035 res = cmhSIM_WriteRecordEF (CMD_SRC_NONE, | |
3036 AT_CMD_NONE, | |
3037 FALSE, /* SCT: dummy only (path info valid flag) */ | |
3038 NULL, /* SCT: dummy only (path info) */ | |
3039 data_id, | |
3040 rcd_num, | |
3041 dataLen, | |
3042 data, | |
3043 cphs_write_sim_rcd_cb); | |
3044 #endif | |
3045 | |
3046 if (res NEQ AT_EXCT) | |
3047 return FALSE; | |
3048 | |
3049 return TRUE; | |
3050 } | |
3051 | |
3052 /* | |
3053 +----------------------------------------------------------------------+ | |
3054 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3055 | STATE : code ROUTINE: cphs_build_ext1 | | |
3056 +----------------------------------------------------------------------+ | |
3057 | |
3058 | |
3059 PURPOSE : Frame the data as per the EXT1 record structure | |
3060 | |
3061 */ | |
3062 UBYTE *temp_data = NULL; | |
3063 | |
3064 | |
3065 UBYTE cphs_build_ext1(UBYTE *pData) | |
3066 | |
3067 { | |
3068 UBYTE count = 0; | |
3069 UBYTE ext1num[PHB_MAX_LEN]; | |
3070 UBYTE indx = 0; | |
3071 SHORT rec_no_to_write = 0; | |
3072 UBYTE numLen; | |
3073 UBYTE *pNumber; | |
3074 UBYTE i, j; | |
3075 unsigned int length_no = 0; | |
3076 UBYTE byteno = 0; | |
3077 | |
3078 TRACE_FUNCTION ( "cphs_build_ext1()" ); | |
3079 | |
3080 memset( pData, MFW_INVALID_SIM_DATA, 13); | |
3081 | |
3082 | |
3083 *pData = 0x02; //implies that the EF contains additional data | |
3084 temp_data = pData; | |
3085 | |
3086 /* number data and TON/NPI data */ | |
3087 if ( vcEntry->number[0] EQ '+' ) | |
3088 { | |
3089 vcEntry->ton = TON_International; | |
3090 pNumber = &vcEntry->number[1]; | |
3091 } | |
3092 else | |
3093 pNumber = &vcEntry->number[0]; | |
3094 | |
3095 | |
3096 cmhPHB_getAdrBcd ( ext1num, &numLen, | |
3097 PHB_MAX_LEN - 1, (CHAR *) (pNumber)); | |
3098 | |
3099 for(i=0; i < strlen((CHAR *)pNumber); i++) | |
3100 { | |
3101 TRACE_EVENT_P2("pNumber[%d] : %c", i,pNumber[i]); | |
3102 } | |
3103 | |
3104 | |
3105 length_no = numLen; //strlen( (CHAR *)pNumber ); | |
3106 byteno = numLen; //( length_no / 2 ) + ( length_no % 2 ); | |
3107 | |
3108 indx = ( (ubCurrExtRcWrite + 1) * 10 ); | |
3109 | |
3110 TRACE_EVENT_P1("length_no: %d", length_no); | |
3111 TRACE_EVENT_P1("indx: %d", indx); | |
3112 | |
3113 if ( ( byteno - indx ) > 10 ) | |
3114 { | |
3115 count = 10; | |
3116 } | |
3117 else | |
3118 { | |
3119 count = ( byteno - indx ); | |
3120 } | |
3121 | |
3122 TRACE_EVENT_P1("count: %d", count); | |
3123 | |
3124 if ( count != 0 ) | |
3125 { | |
3126 memcpy ( (void *)(pData + 2), (void *)&(ext1num[indx]), | |
3127 ( count ) ); | |
3128 } | |
3129 | |
3130 for(i=0; i < count; i++) | |
3131 { | |
3132 TRACE_EVENT_P2("pData + 2 + %d : %x", i, *(pData + 2+i)); | |
3133 } | |
3134 | |
3135 | |
3136 *(pData+1) = ( count ); | |
3137 | |
3138 pData += 12; | |
3139 | |
3140 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = sFreeRec; | |
3141 | |
3142 TRACE_EVENT_P1("ubCurrExtRcWrite: %d", ubCurrExtRcWrite); | |
3143 | |
3144 TRACE_EVENT_P1("mbNum...ext_rec_idx[ubCurrExtRcWrite]: %d", mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite]); | |
3145 | |
3146 ubCurrExtRcWrite++; | |
3147 | |
3148 if ( ubCphsMbExtRecNo <= ubCurrExtRcWrite ) | |
3149 { | |
3150 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) ) | |
3151 { | |
3152 TRACE_FUNCTION ("cphs_build_ext1() : ubCphsMbExtRecNo <= ubCurrExtRcWrite; no free rec"); | |
3153 *(pData) = 0xFF; | |
3154 return FALSE; | |
3155 } | |
3156 | |
3157 rec_no_to_write = sFreeRec; | |
3158 | |
3159 *(pData) = 0xFF; | |
3160 } | |
3161 else | |
3162 { | |
3163 rec_no_to_write = sFreeRec; | |
3164 | |
3165 sFreeRec = 0; | |
3166 | |
3167 if ( mbNum.entries[vcEntry->list_index].ext_rec_number > ubCurrExtRcWrite ) | |
3168 { | |
3169 | |
3170 TRACE_FUNCTION("ext rec taken from within"); | |
3171 sFreeRec = mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite]; | |
3172 } | |
3173 else | |
3174 { | |
3175 | |
3176 TRACE_FUNCTION("ext rec taken from cmh"); | |
3177 #ifdef TI_PS_FFS_PHB | |
3178 sFreeRec = cmh_Query_free_ext_record(); | |
3179 #endif | |
3180 } | |
3181 | |
3182 TRACE_EVENT_P1("sFreeRec : %d", sFreeRec); | |
3183 | |
3184 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) ) | |
3185 { | |
3186 TRACE_FUNCTION ("cphs_build_ext1() : No free records available"); | |
3187 *(pData) = 0xFF; | |
3188 } | |
3189 else | |
3190 { | |
3191 *(pData) = 0x00; | |
3192 *(pData) = sFreeRec; | |
3193 TRACE_FUNCTION("cmh_PHB_update_ext_record to be"); | |
3194 #ifdef TI_PS_FFS_PHB | |
3195 cmh_PHB_update_ext_record(sFreeRec,TRUE); | |
3196 #endif | |
3197 } | |
3198 | |
3199 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = *(pData); | |
3200 } | |
3201 | |
3202 TRACE_EVENT_P1("rec_no_to_write : %d", rec_no_to_write); | |
3203 cphs_write_sim_rcd(SIM_EXT1, rec_no_to_write, temp_data, 13); | |
3204 | |
3205 return TRUE; | |
3206 } | |
3207 | |
3208 static UBYTE mfw_cphs_vm_write_cb_ext(void) | |
3209 { | |
3210 UBYTE ret_internal = 0; | |
3211 UBYTE result; | |
3212 | |
3213 TRACE_FUNCTION("mfw_cphs_vm_write_cb_ext"); | |
3214 | |
3215 TRACE_EVENT_P1("ubCphsMbExtRecNo : %d", ubCphsMbExtRecNo); | |
3216 TRACE_EVENT_P1("ubCurrExtRcWrite : %d", ubCurrExtRcWrite); | |
3217 TRACE_EVENT_P2("idx, ext_rec_number : %d, %d", vcEntry->list_index, mbNum.entries[vcEntry->list_index].ext_rec_number); | |
3218 | |
3219 if ( ( ubCphsMbExtRecNo == 0 ) || ( ubCphsMbExtRecNo <= ubCurrExtRcWrite ) ) | |
3220 { | |
3221 | |
3222 TRACE_FUNCTION("inside if!"); | |
3223 | |
3224 /* Flush any EXT Records, if any */ | |
3225 if ( mbNum.entries[vcEntry->list_index].ext_rec_number > ubCphsMbExtRecNo ) | |
3226 { | |
3227 | |
3228 | |
3229 TRACE_FUNCTION("flush needed!--"); | |
3230 | |
3231 if ( ubFlushRecords == 0 ) | |
3232 { | |
3233 ubFlushRecords = 1; | |
3234 } | |
3235 | |
3236 TRACE_EVENT_P1("ubFlushRecords : %d", ubFlushRecords); | |
3237 TRACE_EVENT_P1("i : %d", (ubCphsMbExtRecNo + ubFlushRecords - 1)); | |
3238 TRACE_EVENT_P1("ext_rec_idx[i] : %d", mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1]); | |
3239 | |
3240 memset ( (void *)&flush_data[0], 0xFF, 13 ); | |
3241 #ifdef TI_PS_FFS_PHB | |
3242 cmh_PHB_update_ext_record(mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1], | |
3243 FALSE); | |
3244 #endif | |
3245 cphs_write_sim_rcd(SIM_EXT1, | |
3246 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1], | |
3247 flush_data, 13); | |
3248 | |
3249 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1] = 0xFF; | |
3250 mbNum.entries[vcEntry->list_index].ext_rec_number--; | |
3251 ubFlushRecords++; | |
3252 return 1; | |
3253 } | |
3254 | |
3255 ubFlushRecords = 0; | |
3256 | |
3257 result = MFW_SIMOP_WRITE_OK; | |
3258 | |
3259 | |
3260 TRACE_FUNCTION("mfw_cphs_vm_write_cb_ext: write OK"); | |
3261 cphs_signal(E_CPHS_SET_VC_NUM, &result); | |
3262 | |
3263 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
3264 // mbnData is deallocated, on successfull write operation | |
3265 #ifdef FF_MMI_OPTIM | |
3266 if(mbnData) | |
3267 mfwFree(mbnData,200); | |
3268 #endif | |
3269 | |
3270 return 0; | |
3271 | |
3272 } | |
3273 else | |
3274 { | |
3275 ret_internal = cphs_build_ext1(ubExtRecData); | |
3276 if ( ret_internal == FALSE ) | |
3277 { | |
3278 TRACE_FUNCTION("mfw_cphs_vm_write_cb_ext: cphs_build_ext1 returns FALSE"); | |
3279 | |
3280 result = MFW_SIMOP_WRITE_OK; | |
3281 | |
3282 cphs_signal(E_CPHS_SET_VC_NUM, &result); | |
3283 | |
3284 // Mar 30, 2005 REF: CRR 29986 xpradipg | |
3285 // mbnData is deallocated, on successfull write operation | |
3286 #ifdef FF_MMI_OPTIM | |
3287 if(mbnData) | |
3288 mfwFree(mbnData,200); | |
3289 #endif | |
3290 | |
3291 return 0; | |
3292 } | |
3293 } | |
3294 | |
3295 return 1; | |
3296 } | |
3297 | |
3298 /* | |
3299 +----------------------------------------------------------------------+ | |
3300 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3301 | STATE : code ROUTINE: cphs_write_sim_rcd_cb | | |
3302 +----------------------------------------------------------------------+ | |
3303 | |
3304 | |
3305 PURPOSE : callback of SIM card writing. | |
3306 | |
3307 */ | |
3308 | |
3309 void cphs_write_sim_rcd_cb (SHORT table_id) | |
3310 { | |
3311 UBYTE result; | |
3312 UBYTE *data_write; | |
3313 UBYTE dataLen = 0; | |
3314 UBYTE ret_internal = 0; | |
3315 | |
3316 TRACE_FUNCTION ("cphs_write_sim_rcd_cb()"); | |
3317 /***************************Go-lite Optimization changes Start***********************/ | |
3318 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
3319 TRACE_EVENT_P1("SIM Error code!!!%d", simShrdPrm.atb[table_id].errCode); | |
3320 /***************************Go-lite Optimization changes end***********************/ | |
3321 switch (simShrdPrm.atb[table_id].reqDataFld) | |
3322 { | |
3323 case SIM_CPHS_MBXN: /* mailbox numbers */ | |
3324 | |
3325 #ifdef FF_2TO1_PS | |
3326 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) | |
3327 #else | |
3328 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) | |
3329 #endif | |
3330 { | |
3331 result = MFW_SIMOP_WRITE_OK; | |
3332 | |
3333 ret_internal = mfw_cphs_vm_write_cb_ext(); | |
3334 if ( ret_internal == 1 ) | |
3335 { | |
3336 return; | |
3337 } | |
3338 } | |
3339 else | |
3340 { | |
3341 cphs_write_eeprom_mailbox(vcEntry); | |
3342 } | |
3343 | |
3344 break; | |
3345 | |
3346 case SIM_EXT1: /* mailbox ext numbers */ | |
3347 | |
3348 #ifdef FF_2TO1_PS | |
3349 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) | |
3350 #else | |
3351 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) | |
3352 #endif | |
3353 { | |
3354 result = MFW_SIMOP_WRITE_OK; | |
3355 | |
3356 ret_internal = mfw_cphs_vm_write_cb_ext(); | |
3357 if ( ret_internal == 1 ) | |
3358 { | |
3359 return; | |
3360 } | |
3361 } | |
3362 else | |
3363 { | |
3364 cphs_write_eeprom_mailbox(vcEntry); | |
3365 } | |
3366 | |
3367 break; | |
3368 | |
3369 | |
3370 default: | |
3371 break; | |
3372 } | |
3373 | |
3374 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; | |
3375 } | |
3376 | |
3377 /* | |
3378 +----------------------------------------------------------------------+ | |
3379 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3380 | STATE : code ROUTINE: cphs_build_mbn_data | | |
3381 +----------------------------------------------------------------------+ | |
3382 | |
3383 | |
3384 PURPOSE : Build mailbox number data in SIM format. | |
3385 | |
3386 */ | |
3387 | |
3388 BOOL cphs_build_mbn_data(UBYTE *data, UBYTE len) | |
3389 { | |
3390 UBYTE alphaLen; | |
3391 UBYTE numLen; | |
3392 UBYTE *pNumber; | |
3393 UBYTE i, j; | |
3394 unsigned int length_no = 0; | |
3395 UBYTE byteno = 0; | |
3396 | |
3397 TRACE_FUNCTION ("cphs_build_mbn_data()"); | |
3398 | |
3399 memset(data, MFW_INVALID_SIM_DATA, len); | |
3400 | |
3401 /* alpha data */ | |
3402 if (len <= MFW_CPHS_MIN_MBN_SIZE) | |
3403 alphaLen = 0; | |
3404 else | |
3405 alphaLen = len - MFW_CPHS_MIN_MBN_SIZE; | |
3406 i = MINIMUM (alphaLen, vcEntry->alpha.len); | |
3407 | |
3408 for ( j = 0; j < i; j++ ) | |
3409 data[j] = vcEntry->alpha.data[j]; | |
3410 | |
3411 data += alphaLen; | |
3412 | |
3413 /* number data and TON/NPI data */ | |
3414 if ( vcEntry->number[0] EQ '+' ) | |
3415 { | |
3416 vcEntry->ton = TON_International; | |
3417 pNumber = &vcEntry->number[1]; | |
3418 } | |
3419 else | |
3420 pNumber = &vcEntry->number[0]; | |
3421 | |
3422 for(i=0; i < strlen((CHAR *)pNumber); i++) | |
3423 { | |
3424 TRACE_EVENT_P2("pNumber[%d] : %c", i,pNumber[i]); | |
3425 } | |
3426 | |
3427 cmhPHB_getAdrBcd ( data + 2, &numLen, | |
3428 PHB_MAX_LEN - 1, (CHAR *)pNumber ); | |
3429 | |
3430 for(i=0; i < numLen; i++) | |
3431 { | |
3432 TRACE_EVENT_P2("data + 2 + %d : %x", i, *(data + 2+i)); | |
3433 } | |
3434 | |
3435 if ( numLen < 11 ) | |
3436 { | |
3437 *data = numLen + 1; | |
3438 } | |
3439 else | |
3440 { | |
3441 *data = 11; | |
3442 } | |
3443 | |
3444 | |
3445 *(data + 1) = ((( vcEntry -> ton << 4 ) & 0xF0 ) + ( vcEntry -> npi & 0x0F )) | 0x80; | |
3446 | |
3447 data += 12; | |
3448 | |
3449 length_no = numLen; | |
3450 byteno = length_no; // ( length_no / 2 ) + ( length_no % 2 ); | |
3451 | |
3452 if ( byteno > 10 ) | |
3453 { | |
3454 ubCphsMbExtRecNo = ( byteno / 10 ) - ( ( byteno % 10 ) == 0 ? 1 : 0 ); | |
3455 } | |
3456 | |
3457 TRACE_EVENT_P1("length_no : %d", length_no); | |
3458 TRACE_EVENT_P1("byteno : %d", byteno); | |
3459 TRACE_EVENT_P1("ubCphsMbExtRecNo : %d", ubCphsMbExtRecNo); | |
3460 TRACE_EVENT_P1("vcEntry->index : %d", vcEntry->index); | |
3461 TRACE_EVENT_P1("vcEntry->list_index : %d", vcEntry->list_index); | |
3462 TRACE_EVENT_P1("dataLen : %d", len); | |
3463 TRACE_EVENT_P1("ext_rec_number : %d", mbNum.entries[vcEntry->list_index].ext_rec_number); | |
3464 | |
3465 | |
3466 /**************************************************************************************/ | |
3467 /**************************************************************************************/ | |
3468 | |
3469 /* Check if enough EXT1 Records are available for storing the current number; If not, return FALSE */ | |
3470 | |
3471 if ( ( ubCphsMbExtRecNo > 0 ) && | |
3472 ( mbNum.entries[vcEntry->list_index].ext_rec_number < ubCphsMbExtRecNo ) ) | |
3473 { | |
3474 for ( i = mbNum.entries[vcEntry->list_index].ext_rec_number; i < ubCphsMbExtRecNo; i++ ) | |
3475 { | |
3476 sFreeRec = 0; | |
3477 #ifdef TI_PS_FFS_PHB | |
3478 sFreeRec = cmh_Query_free_ext_record(); | |
3479 #endif | |
3480 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) ) | |
3481 { | |
3482 sFreeRec = 0; | |
3483 TRACE_FUNCTION("Not enuf ext1 recs available, hence show writeerror"); | |
3484 return FALSE; | |
3485 } | |
3486 } | |
3487 | |
3488 sFreeRec = 0; | |
3489 } | |
3490 | |
3491 /**************************************************************************************/ | |
3492 /**************************************************************************************/ | |
3493 | |
3494 | |
3495 /* capability/configuration identifier data and EXT identifier data */ | |
3496 *data = 0xFF; | |
3497 | |
3498 if ( ubCphsMbExtRecNo == 0 ) | |
3499 { | |
3500 *(data + 1) = 0xFF; | |
3501 } | |
3502 else | |
3503 { | |
3504 sFreeRec = 0; | |
3505 ubCurrExtRcWrite = 0; | |
3506 | |
3507 if ( mbNum.entries[vcEntry->list_index].ext_rec_number > ubCurrExtRcWrite ) | |
3508 { | |
3509 TRACE_FUNCTION("ext rec taken from within"); | |
3510 sFreeRec = mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite]; | |
3511 } | |
3512 else | |
3513 { | |
3514 TRACE_FUNCTION("ext rec taken from cmh"); | |
3515 #ifdef TI_PS_FFS_PHB | |
3516 sFreeRec = cmh_Query_free_ext_record(); | |
3517 #endif | |
3518 } | |
3519 | |
3520 TRACE_EVENT_P1("sFreeRec: %d", sFreeRec); | |
3521 | |
3522 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) ) | |
3523 { | |
3524 TRACE_FUNCTION ("cphs_build_mbn_data() : No free records available"); | |
3525 *(data + 1) = 0xFF; | |
3526 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = 0xFF; | |
3527 } | |
3528 else | |
3529 { | |
3530 *(data + 1) = 0x00; | |
3531 *(data + 1) = sFreeRec; | |
3532 TRACE_FUNCTION("cmh_PHB_update_ext_record to be"); | |
3533 #ifdef TI_PS_FFS_PHB | |
3534 cmh_PHB_update_ext_record(sFreeRec,TRUE); | |
3535 #endif | |
3536 TRACE_EVENT_P1(" *(data + 1) : %d", *(data + 1) ); | |
3537 } | |
3538 | |
3539 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = *(data + 1); | |
3540 } | |
3541 | |
3542 return TRUE; | |
3543 } | |
3544 | |
3545 /* | |
3546 +----------------------------------------------------------------------+ | |
3547 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3548 | STATE : code ROUTINE: cphs_ssc | | |
3549 +----------------------------------------------------------------------+ | |
3550 | |
3551 | |
3552 PURPOSE : Check CPHS service status. | |
3553 | |
3554 */ | |
3555 | |
3556 UBYTE cphs_ssc (UBYTE nr, UBYTE * serv_table) | |
3557 { | |
3558 UBYTE value; | |
3559 | |
3560 TRACE_FUNCTION ("cphs_ssc()"); | |
3561 | |
3562 serv_table = serv_table + (nr-1)/4; | |
3563 value = * serv_table; | |
3564 | |
3565 value = value >> (((nr-1) & 3) * 2); | |
3566 value = value & 3; | |
3567 | |
3568 return value; | |
3569 } | |
3570 | |
3571 /* | |
3572 +--------------------------------------------------------------------+ | |
3573 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
3574 | STATE : code ROUTINE : cphsCommand | | |
3575 +--------------------------------------------------------------------+ | |
3576 | |
3577 PURPOSE : handle mfw windows command | |
3578 | |
3579 */ | |
3580 | |
3581 static int cphsCommand (U32 cmd, void *h) | |
3582 { | |
3583 switch (cmd) | |
3584 { | |
3585 case MfwCmdDelete: /* delete me */ | |
3586 if (!h) | |
3587 return 0; | |
3588 cphs_delete(h); | |
3589 return 1; | |
3590 default: | |
3591 break; | |
3592 } | |
3593 | |
3594 return 0; | |
3595 } | |
3596 | |
3597 #ifdef SIM_TOOLKIT | |
3598 /* | |
3599 +---------------------------------------------------------------------+ | |
3600 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
3601 | STATE : code ROUTINE : cphs_sat_file_update | | |
3602 +---------------------------------------------------------------------+ | |
3603 | |
3604 PURPOSE : SIM file change indication | |
3605 | |
3606 */ | |
3607 | |
3608 void cphs_sat_file_update(USHORT dataId) | |
3609 { | |
3610 TRACE_FUNCTION("cphs_sat_file_update()"); | |
3611 | |
3612 cphsUpdate = TRUE; | |
3613 switch (dataId) | |
3614 { | |
3615 case SIM_CPHS_CINF: | |
3616 if (!cphs_read_sim_dat(SIM_CPHS_CINF, NOT_PRESENT_8BIT, MFW_CPHS_INFO_SIZE)) | |
3617 { | |
3618 satUpdateFiles(TRUE, SIM_CPHS_CINF); | |
3619 } | |
3620 break; | |
3621 default: | |
3622 break; | |
3623 } | |
3624 } | |
3625 #endif | |
3626 | |
3627 #ifdef SIM_TOOLKIT | |
3628 /* | |
3629 +---------------------------------------------------------------------+ | |
3630 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | | |
3631 | STATE : code ROUTINE : cphs_update_info_cnf | | |
3632 +---------------------------------------------------------------------+ | |
3633 | |
3634 PURPOSE : call back for SIM file read | |
3635 | |
3636 */ | |
3637 void cphs_update_info_cnf (USHORT errCode, UBYTE *data, UBYTE dataLen) | |
3638 { | |
3639 UBYTE *ptr; | |
3640 | |
3641 TRACE_FUNCTION ("cphs_update_info_cnf()"); | |
3642 | |
3643 cphsUpdate = FALSE; /* reset flag */ | |
3644 ptr = data; | |
3645 #ifdef FF_2TO1_PS | |
3646 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR | |
3647 #else | |
3648 if ( errCode NEQ SIM_NO_ERROR OR | |
3649 #endif | |
3650 ptr EQ NULL OR | |
3651 dataLen < MFW_CPHS_INFO_SIZE) | |
3652 { | |
3653 satUpdateFiles(TRUE, SIM_CPHS_CINF); | |
3654 } | |
3655 else | |
3656 { | |
3657 cphsPhase = *ptr; | |
3658 ptr++; | |
3659 memcpy (cphsServTab, ptr, CPHS_SERVICE_TABLE*sizeof(UBYTE)); | |
3660 //x0pleela 11 June, 2006 DR:OMAPS00079692 | |
3661 //changed from CPHS_OK to MFW_CPHS_OK | |
3662 cphsStatus = MFW_CPHS_OK; | |
3663 satUpdateFiles ( TRUE, SIM_CPHS_CINF ); | |
3664 } | |
3665 } | |
3666 #endif | |
3667 /* | |
3668 +----------------------------------------------------------------------+ | |
3669 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3670 | STATE : code ROUTINE: Read_Sim | | |
3671 +----------------------------------------------------------------------+ | |
3672 | |
3673 | |
3674 PURPOSE : Request to read SIM card. | |
3675 | |
3676 */ | |
3677 | |
3678 BOOL Read_Sim(USHORT dat_id, USHORT offset, UBYTE max_len, UBYTE *exDat) | |
3679 { | |
3680 T_ACI_RETURN res; | |
3681 /* | |
3682 * x0047685 Added path_info to support R99 SIM Interface changes. | |
3683 */ | |
3684 T_path_info tmp_path; | |
3685 | |
3686 TRACE_FUNCTION ("Read_Sim()"); | |
3687 | |
3688 tmp_path.df_level1 = SIM_DF_VI; | |
3689 tmp_path.v_df_level2 = FALSE; | |
3690 | |
3691 #ifdef FF_2TO1_PS | |
3692 res = cmhSIM_ReadTranspEF ( CMD_SRC_NONE, | |
3693 AT_CMD_NONE, | |
3694 FALSE, /* SCT: dummy only (path info valid flag) */ | |
3695 NULL, /* SCT: dummy only (path info) */ | |
3696 dat_id, | |
3697 offset, | |
3698 max_len, | |
3699 exDat, | |
3700 cphs_read_sim_default_cb); | |
3701 #else | |
3702 res = cmhSIM_ReadTranspEF ( CMD_SRC_NONE, | |
3703 AT_CMD_NONE, | |
3704 TRUE, /* SCT: dummy only (path info valid flag) */ | |
3705 &tmp_path, /* SCT: dummy only (path info) */ | |
3706 dat_id, | |
3707 offset, | |
3708 max_len, | |
3709 exDat, | |
3710 cphs_read_sim_default_cb); | |
3711 #endif | |
3712 | |
3713 if (res NEQ AT_EXCT) | |
3714 return FALSE; | |
3715 | |
3716 return TRUE; | |
3717 } | |
3718 | |
3719 | |
3720 /* | |
3721 +----------------------------------------------------------------------+ | |
3722 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3723 | STATE : code ROUTINE: Read_Sim_Record | | |
3724 +----------------------------------------------------------------------+ | |
3725 | |
3726 | |
3727 PURPOSE : Request to read record from SIM card. | |
3728 | |
3729 */ | |
3730 | |
3731 BOOL Read_Sim_Record(USHORT dat_id, USHORT record, UBYTE len, UBYTE *exDat) | |
3732 { | |
3733 T_ACI_RETURN res; | |
3734 UBYTE dataLen; | |
3735 /* | |
3736 * x0047685 Added path_info to support R99 SIM Interface changes. | |
3737 */ | |
3738 T_path_info tmp_path; | |
3739 | |
3740 if (record EQ 1) | |
3741 dataLen = UCHAR_MAX; | |
3742 else | |
3743 dataLen = len; | |
3744 | |
3745 TRACE_FUNCTION ("Read_Sim_Record()"); | |
3746 | |
3747 tmp_path.df_level1 = SIM_DF_VI; | |
3748 tmp_path.v_df_level2 = FALSE; | |
3749 | |
3750 #ifdef FF_2TO1_PS | |
3751 res = cmhSIM_ReadRecordEF ( CMD_SRC_NONE, | |
3752 AT_CMD_NONE, | |
3753 FALSE, /* SCT: dummy only (path info valid flag) */ | |
3754 NULL, /* SCT: dummy only (path info) */ | |
3755 dat_id, | |
3756 record, | |
3757 dataLen, | |
3758 exDat, | |
3759 cphs_read_sim_default_cb); | |
3760 #else | |
3761 res = cmhSIM_ReadRecordEF ( CMD_SRC_NONE, | |
3762 AT_CMD_NONE, | |
3763 TRUE, /* SCT: dummy only (path info valid flag) */ | |
3764 &tmp_path, /* SCT: dummy only (path info) */ | |
3765 dat_id, | |
3766 record, | |
3767 dataLen, | |
3768 exDat, | |
3769 cphs_read_sim_default_cb); | |
3770 #endif | |
3771 if (res NEQ AT_EXCT) | |
3772 return FALSE; | |
3773 | |
3774 return TRUE; | |
3775 } | |
3776 | |
3777 /* | |
3778 +----------------------------------------------------------------------+ | |
3779 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3780 | STATE : code ROUTINE: Write_Sim | | |
3781 +----------------------------------------------------------------------+ | |
3782 PURPOSE : Request to write SIM card. | |
3783 */ | |
3784 | |
3785 BOOL Write_Sim(USHORT dat_id, UBYTE len, UBYTE *exDat) | |
3786 { | |
3787 T_ACI_RETURN res; | |
3788 | |
3789 TRACE_FUNCTION ("Write_Sim()"); | |
3790 | |
3791 #ifdef FF_2TO1_PS | |
3792 res = cmhSIM_WriteTranspEF (CMD_SRC_NONE, | |
3793 AT_CMD_NONE, | |
3794 FALSE, /* SCT: dummy only (path info valid flag) */ | |
3795 NULL, /* SCT: dummy only (path info) */ | |
3796 dat_id, | |
3797 0, | |
3798 len, | |
3799 exDat, | |
3800 cphs_write_sim_default_cb); | |
3801 #else | |
3802 res = cmhSIM_WriteTranspEF (CMD_SRC_NONE, | |
3803 AT_CMD_NONE, | |
3804 FALSE, /* SCT: dummy only (path info valid flag) */ | |
3805 NULL, /* SCT: dummy only (path info) */ | |
3806 dat_id, | |
3807 0, | |
3808 len, | |
3809 exDat, | |
3810 cphs_write_sim_default_cb); | |
3811 #endif | |
3812 | |
3813 if (res NEQ AT_EXCT) | |
3814 return FALSE; | |
3815 | |
3816 return TRUE; | |
3817 } | |
3818 | |
3819 | |
3820 /* | |
3821 +----------------------------------------------------------------------+ | |
3822 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3823 | STATE : code ROUTINE: Write_Sim_Record | | |
3824 +----------------------------------------------------------------------+ | |
3825 | |
3826 | |
3827 PURPOSE : Request to write record to SIM card. | |
3828 | |
3829 */ | |
3830 | |
3831 BOOL Write_Sim_Record(USHORT dat_id, USHORT record, UBYTE len, UBYTE *exDat) | |
3832 { | |
3833 T_ACI_RETURN res; | |
3834 /* | |
3835 * x0047685 Added path_info to support R99 SIM Interface changes. | |
3836 */ | |
3837 T_path_info tmp_path; | |
3838 | |
3839 TRACE_FUNCTION ("Write_Sim()"); | |
3840 | |
3841 tmp_path.df_level1 = SIM_DF_VI; | |
3842 tmp_path.v_df_level2 = FALSE; | |
3843 | |
3844 #ifdef FF_2TO1_PS | |
3845 res = cmhSIM_WriteRecordEF (CMD_SRC_NONE, | |
3846 AT_CMD_NONE, | |
3847 FALSE, /* SCT: dummy only (path info valid flag) */ | |
3848 NULL, /* SCT: dummy only (path info) */ | |
3849 dat_id, | |
3850 record, | |
3851 len, | |
3852 exDat, | |
3853 cphs_write_sim_default_cb); | |
3854 #else | |
3855 res = cmhSIM_WriteRecordEF (CMD_SRC_NONE, | |
3856 AT_CMD_NONE, | |
3857 TRUE, /* SCT: dummy only (path info valid flag) */ | |
3858 &tmp_path, /* SCT: dummy only (path info) */ | |
3859 dat_id, | |
3860 record, | |
3861 len, | |
3862 exDat, | |
3863 cphs_write_sim_default_cb); | |
3864 #endif | |
3865 | |
3866 if (res NEQ AT_EXCT) | |
3867 return FALSE; | |
3868 | |
3869 return TRUE; | |
3870 } | |
3871 | |
3872 /* | |
3873 +----------------------------------------------------------------------+ | |
3874 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3875 | STATE : code ROUTINE: cphs_read_default_cb | | |
3876 +----------------------------------------------------------------------+ | |
3877 | |
3878 | |
3879 PURPOSE : Sends event to MMI | |
3880 | |
3881 */ | |
3882 void cphs_read_sim_default_cb(SHORT table_id) | |
3883 { | |
3884 | |
3885 read_sim_entry.requested_field = simShrdPrm.atb[table_id].reqDataFld; | |
3886 read_sim_entry.exchange_data = simShrdPrm.atb[table_id].exchData; | |
3887 read_sim_entry.sim_result = simShrdPrm.atb[table_id].errCode; | |
3888 read_sim_entry.data_len = simShrdPrm.atb[table_id].dataLen; | |
3889 read_sim_entry.record = simShrdPrm.atb[table_id].recNr; | |
3890 #ifdef FF_2TO1_PS | |
3891 if (read_sim_entry.sim_result != CAUSE_SIM_NO_ERROR) | |
3892 #else | |
3893 if (read_sim_entry.sim_result != SIM_NO_ERROR) | |
3894 #endif | |
3895 { read_sim_entry.exchange_data = NULL; | |
3896 read_sim_entry.data_len = 0; | |
3897 } | |
3898 | |
3899 cphs_signal(E_CPHS_GET_SIM_FIELD, &read_sim_entry); | |
3900 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; | |
3901 } | |
3902 | |
3903 | |
3904 /* | |
3905 +----------------------------------------------------------------------+ | |
3906 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
3907 | STATE : code ROUTINE: cphs_read_default_cb | | |
3908 +----------------------------------------------------------------------+ | |
3909 | |
3910 | |
3911 PURPOSE : Sends event to MMI | |
3912 | |
3913 */ | |
3914 void cphs_write_sim_default_cb(SHORT table_id) | |
3915 { | |
3916 | |
3917 read_sim_entry.requested_field = simShrdPrm.atb[table_id].reqDataFld; | |
3918 read_sim_entry.exchange_data = simShrdPrm.atb[table_id].exchData; | |
3919 read_sim_entry.sim_result = simShrdPrm.atb[table_id].errCode; | |
3920 read_sim_entry.data_len = simShrdPrm.atb[table_id].dataLen; | |
3921 #ifdef FF_2TO1_PS | |
3922 if (read_sim_entry.sim_result != CAUSE_SIM_NO_ERROR) | |
3923 #else | |
3924 if (read_sim_entry.sim_result != SIM_NO_ERROR) | |
3925 #endif | |
3926 { read_sim_entry.exchange_data = NULL; | |
3927 read_sim_entry.data_len = 0; | |
3928 } | |
3929 | |
3930 cphs_signal(E_CPHS_SET_SIM_FIELD, &read_sim_entry); | |
3931 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; | |
3932 } | |
3933 | |
3934 #ifdef FF_CPHS_REL4 | |
3935 | |
3936 UBYTE mfw_cphs_get_reg_profile(void) | |
3937 { | |
3938 TRACE_FUNCTION("mfw_cphs_get_reg_profile"); | |
3939 TRACE_EVENT_P1(" Get registered profile - %d", mspinfo.registered_profile); | |
3940 return mspinfo.registered_profile; | |
3941 } | |
3942 | |
3943 UBYTE mfw_cphs_get_default_profile(void) | |
3944 { | |
3945 TRACE_FUNCTION("mfw_cphs_get_default_profile"); | |
3946 TRACE_EVENT_P1(" Get default profile - %d", mspinfo.default_profile); | |
3947 return mspinfo.default_profile; | |
3948 } | |
3949 | |
3950 void mfw_cphs_set_reg_profile(UBYTE profile_id) | |
3951 { | |
3952 TRACE_FUNCTION("mfw_cphs_set_reg_profile"); | |
3953 TRACE_EVENT_P1(" Set registered profile - %d", profile_id); | |
3954 mspinfo.registered_profile = profile_id; | |
3955 } | |
3956 | |
3957 void mfw_cphs_set_default_profile(UBYTE profile_id) | |
3958 { | |
3959 TRACE_FUNCTION("mfw_cphs_set_default_profile"); | |
3960 TRACE_EVENT_P1(" Set default profile - %d", profile_id); | |
3961 mspinfo.default_profile = profile_id; | |
3962 } | |
3963 | |
3964 T_MFW_CPHS_MSP_INFO* mfw_cphs_get_msp(void) | |
3965 { | |
3966 TRACE_FUNCTION("mfw_cphs_get_msp"); | |
3967 TRACE_EVENT_P3("msp count - %d, def profile - %d, reg profile - %d ",mspinfo.count, mspinfo.default_profile, mspinfo.registered_profile); | |
3968 | |
3969 return &mspinfo; | |
3970 } | |
3971 | |
3972 UBYTE mfw_cphs_get_no_profile(void) | |
3973 { | |
3974 TRACE_FUNCTION("mfw_cphs_get_no_profile"); | |
3975 return mspinfo.count; | |
3976 } | |
3977 | |
3978 | |
3979 /* | |
3980 +----------------------------------------------------------------------+ | |
3981 | PROJECT: MMI-Framework MODULE: MFW_CPHS | | |
3982 | STATE : code ROUTINE: mfw_cphs_get_msp_info | | |
3983 +----------------------------------------------------------------------+ | |
3984 | |
3985 | |
3986 PURPOSE : query for MSP | |
3987 | |
3988 */ | |
3989 void mfw_cphs_get_msp_info(void) | |
3990 { | |
3991 TRACE_FUNCTION("mfw_cphs_get_msp_info()"); | |
3992 qAT_PlusCNUM(CMD_SRC_LCL, 0); | |
3993 | |
3994 } | |
3995 | |
3996 /* | |
3997 +----------------------------------------------------------------------+ | |
3998 | PROJECT: MMI-Framework MODULE: MFW_CPHS | | |
3999 | STATE : code ROUTINE: check_msp_rec | | |
4000 +----------------------------------------------------------------------+ | |
4001 | |
4002 | |
4003 PURPOSE : check for valid records in sim | |
4004 | |
4005 */ | |
4006 int check_msp_rec(T_ACI_CNUM_MSISDN *msisdn, int i) | |
4007 { | |
4008 TRACE_FUNCTION("check_msp_rec()"); | |
4009 if(msisdn->vldFlag == TRUE) | |
4010 { | |
4011 strcpy(mspinfo.profile[i].alpha, msisdn->alpha); | |
4012 strcpy(mspinfo.profile[i].number, msisdn->number); | |
4013 TRACE_EVENT_P1("profile alpha %s",mspinfo.profile[i].alpha); | |
4014 TRACE_EVENT_P1("profile number %s",mspinfo.profile[i].number); | |
4015 return TRUE; | |
4016 } | |
4017 return FALSE; | |
4018 } | |
4019 | |
4020 /* | |
4021 +----------------------------------------------------------------------+ | |
4022 | PROJECT: MMI-Framework MODULE: MFW_CPHS | | |
4023 | STATE : code ROUTINE: send_msp_signal | | |
4024 +----------------------------------------------------------------------+ | |
4025 | |
4026 | |
4027 PURPOSE : send event to MMI | |
4028 | |
4029 */ | |
4030 void send_msp_signal(UBYTE count) | |
4031 { | |
4032 TRACE_EVENT_P1("msp profile count %d", count); | |
4033 mspinfo.count = count; | |
4034 cphs_signal(E_CPHS_MSP_IND, &mspinfo); | |
4035 } | |
4036 | |
4037 #endif | |
4038 /* | |
4039 +----------------------------------------------------------------------+ | |
4040 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | | |
4041 | STATE : code ROUTINE: mfw_cphs_get_als_info | | |
4042 +----------------------------------------------------------------------+ | |
4043 PURPOSE : Returns the current active line | |
4044 */ | |
4045 | |
4046 //x0pleela 25 May, 2006 DR: OMAPS00070657 | |
4047 #ifdef FF_CPHS | |
4048 T_MFW mfw_cphs_get_als_info(void) | |
4049 { | |
4050 T_ACI_ALS_MOD ALSmode = ALS_MOD_NOTPRESENT; /*a0393213 compiler warnings removal - 0 changed to ALS_MOD_NOTPRESENT*/ | |
4051 TRACE_FUNCTION("mfw_cphs_get_als_info"); | |
4052 | |
4053 if( qAT_PercentALS( CMD_SRC_LCL, &ALSmode )!= AT_CMPL ) | |
4054 return ALS_MOD_NOTPRESENT; | |
4055 else | |
4056 return ALSmode; | |
4057 } | |
4058 #endif | |
4059 |