FreeCalypso > hg > fc-tourmaline
comparison src/ui/mfw/mfw_nm.c @ 3:67bfe9f274f6
src/ui: import of src/ui3 from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Oct 2020 06:33:10 +0000 |
parents | |
children | 92abb46dc1ba |
comparison
equal
deleted
inserted
replaced
2:3a14ee9a9843 | 3:67bfe9f274f6 |
---|---|
1 /* | |
2 +--------------------------------------------------------------------+ | |
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_nm.c $| | |
4 | $Author:: Es $Revision:: 1 $| | |
5 | CREATED: 07.10.98 $Modtime:: 2.03.00 16:28 $| | |
6 | STATE : code | | |
7 +--------------------------------------------------------------------+ | |
8 | |
9 MODULE : MFW_NM | |
10 | |
11 PURPOSE : This modul contains the functions for network management. | |
12 | |
13 | |
14 $History:: mfw_nm.c | |
15 | |
16 Aug 07, 2007 DR:OMAPS00137726 x0066814(Geetha) | |
17 Description:HPLMN Manual Selection at power on - | |
18 unable to perform manual selection at power ON | |
19 Solution: Added a new function nm_get_plmn_list_during_bootup() | |
20 to get the PLMN list during boot up. | |
21 | |
22 | |
23 Apr 13, 2007 DRT:OMAPS00122739 x0066814(Geetha) | |
24 Description: With Orange SIM card, once attached (at+cgatt=1), "5201" is displayed instead of "Orange" | |
25 Solution: In nm_nitz_info_ind(), commented the code to copy mnc, mcc, long name and short anme | |
26 to net_ind from mmr_info_ind. | |
27 May 31, 2007 DR: OMAPS00133201 x0pleela | |
28 Description: MS keeps searching networks and doesn't list available PLMNs after | |
29 performing manual selection | |
30 Solution : Modified the function nm_error_cops() to check for | |
31 CME_ERR_AbortedByNetwork error and send event | |
32 E_NM_ABORT_NETWORK to BMI to destroy the n/w searching dialog | |
33 | |
34 Mar 12 2007 ,x0061088 (Prachi) | |
35 Removed function nm_restrict_bands()as function pl_pei_config() is no | |
36 more avalilable in g23m. | |
37 | |
38 | |
39 Oct 30 2006, OMAPS00098881 x0039928(sumanth) | |
40 Removal of power variant | |
41 | |
42 Sep 18,2006 DRT: OMAPS0090268 x0061088(Prachi) | |
43 Description : To check for Forbidden network (for denied services),it takes long time. | |
44 Solution : Function rAT_PercentCREG() has now be implemented to handle CREG_STAT_Denied, | |
45 which sends nm_signal(NETWORK_FORBIDDEN_NETWORK) to Bmi . | |
46 | |
47 June 02, 2006 DR: OMAPS00078005 x0021334 | |
48 Descripton: Test for NITZ (Network Identity and Timezone) support - No New time was displayed | |
49 Solution: New Time/Date received from network is sent to MFW by lower layer by invoking 'rAT_PercentCTZV' | |
50 function. This function has now been implemented to pass on the received values to MMI | |
51 for user confirmation and RTC updation. | |
52 | |
53 Jun 23, 2006 DR: OMAPS00082374 x0pleela | |
54 Description: EONS Failures - unexpected output from the MMI: 2 carriers; on the top always T-Mobile | |
55 Solution: a) Removed the usage of globals gEons_alloc_active and opn_sel_done | |
56 b) Removed the check if( plmn_ident->opn_read_from EQ NM_EONS ) in function nm_update_plmn_data | |
57 c) Updating the long name and short name lengths in function nm_update_plmn_data | |
58 d) Removed the code where plmn_ident was updated with new MNC and MCC after qat_%COPN in function nm_update_plmn_data | |
59 e) Updated function nm_get_opername() by calling only sat_%CNIV() | |
60 f) Removed the function definitions of set_opn_sel_done and get_opn_sel_done | |
61 | |
62 May 15, 2006 OMAPS00075777 a0393213 (R.Prabakar) | |
63 Description : It is supposed that the sample register itself automatically (in Manual Mode) | |
64 to the last manual selected HPLMN cell before the power cycle, and this does not happen; | |
65 instead this, the sample shows up the available networks list | |
66 Fix : call to nm_avail_plmn_list() is changed to call to sAT_PercentNRG() | |
67 | |
68 Feb 15, 2006 ER: OMAPS00065203 x0pleela | |
69 Description: Cingular Operator Name Prioritization implementation required | |
70 Solution: Incorporated review comments | |
71 - Changed from NEQ NM_CPHS to EQ NM_ROM as we know %CNIV will | |
72 be called only if source id is ROM or CPHS and not roaming in nm_get_opername() | |
73 - set_opn_sel_done(): sets opn_sel_done flag to TRUE or FALSE. | |
74 - get_opn_sel_done(): returns the current value of flag opn_sel_done. | |
75 | |
76 Feb 09, 2006 ER: OMAPS00065203 x0pleela | |
77 Description: Cingular Operator Name Prioritization implementation required | |
78 Solution: Handling E_NM_OPN for operator name display | |
79 Query for COPN in rAT_PlusCREG and update plmn data | |
80 Defined following new functions: | |
81 nm_decodeSourceId:to convert the source id used by ACI to the source id used by MFW | |
82 nm_update_plmn_data: update plmn data after querying COPN | |
83 nm_get_COPN: query COPN | |
84 nm_get_opername: updates operator name based on cingular's prioritization requirement. | |
85 Priority would be in order ONS->NITZ->ROM | |
86 nm_get_network_data: gets operator name from network | |
87 | |
88 Nov 24, 2005 DR: OMAPS00045909 - Shashi Shekar B.S. | |
89 Description: Improve IMEI control mechanism | |
90 Solution : When MMI calls sAT_PLUSCFUN, if an IMEI invalid error is returned, | |
91 we will block on that screen & will not allow the user to browse menus further, | |
92 since the PS will not be booted at all!!! | |
93 | |
94 July 14, 2005 REF: CRR 31916 x0021334 | |
95 Description: rCI_PercentCOPS() and rAT_PercentCOPS() is not implemented | |
96 Solution: rAT_PercentCOPS() is implemented. | |
97 | |
98 Mar 01, 2005 REF: ENH 29327 xdeepadh | |
99 Bug:Locosto MMI Optimization | |
100 Fix:The changes done for the Golite optimization have been utilised for color build. | |
101 This is done by removing the functions under #ifndef MMI_LITE. | |
102 The static vaiable T_MFW_PLMN_LIST plmn_list has been made local variable. | |
103 It has been dynamically allocated and deallocated. | |
104 | |
105 Aug 16, 2004 REF: CRR 24293 Deepa M.D | |
106 Bug:Go-lite optimisation dynamic allocation of variable 'plmn_list' | |
107 Fix:The static vaiable T_MFW_PLMN_LIST plmn_list has been made local variable. | |
108 It has been dynamically allocated and deallocated. | |
109 | |
110 | |
111 Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
112 Bug:Clenup of sprintf used for tracing | |
113 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX $ | |
114 | |
115 Sep 23, 2004 REF: CRR 24562 xvilliva | |
116 Bug: Enable/disable the manual network selection option depending | |
117 on ENS. | |
118 Fix: If the manual network selection is disabled we check if an | |
119 error is returned and set the global g_ensErr. | |
120 | |
121 | |
122 May 22, 2006 X0047685 | |
123 Removed pref_plmn for if not defined FF_2TO1_PS | |
124 | |
125 | |
126 * | |
127 * ***************** Version 39 ***************** | |
128 * User: Es Date: 2.03.00 Time: 16:31 | |
129 * Updated in $/GSM/Condat/MS/SRC/MFW | |
130 * use 'aci_delete()' to clear the primitive routing for mfw_nm. | |
131 * | |
132 * ***************** Version 38 ***************** | |
133 * User: Vo Date: 16.02.00 Time: 14:22 | |
134 * Updated in $/GSM/Condat/MS/SRC/MFW | |
135 * | |
136 * ***************** Version 37 ***************** | |
137 * User: Vo Date: 11.02.00 Time: 12:57 | |
138 * Updated in $/GSM/Condat/MS/SRC/MFW | |
139 * Bug fix: limited service | |
140 * | |
141 * ***************** Version 36 ***************** | |
142 * User: Vo Date: 11.02.00 Time: 11:01 | |
143 * Updated in $/GSM/Condat/MS/SRC/MFW | |
144 * add limited service indication | |
145 * | |
146 * ***************** Version 35 ***************** | |
147 * User: Vo Date: 28.01.00 Time: 12:48 | |
148 * Updated in $/GSM/Condat/MS/SRC/MFW | |
149 * Limited service | |
150 * | |
151 * ***************** Version 34 ***************** | |
152 * User: Vo Date: 20.01.00 Time: 13:17 | |
153 * Updated in $/GSM/Condat/MS/SRC/MFW | |
154 * Add new methodes to save preferred PLMN entry (change interface | |
155 * function nm_change_pref_plmn()) | |
156 * | |
157 * ***************** Version 33 ***************** | |
158 * User: Vo Date: 22.12.99 Time: 15:59 | |
159 * Updated in $/GSM/Condat/MS/SRC/MFW | |
160 * New: Request of preferred PLMN memory of SIM card | |
161 * | |
162 * ***************** Version 32 ***************** | |
163 * User: Vo Date: 3.12.99 Time: 12:16 | |
164 * Updated in $/GSM/Condat/MS/SRC/MFW | |
165 * remove the request of maximum/used preferred PLMN list | |
166 * | |
167 * ***************** Version 31 ***************** | |
168 * User: Vo Date: 2.12.99 Time: 13:28 | |
169 * Updated in $/GSM/Condat/MS/SRC/MFW | |
170 * | |
171 * ***************** Version 30 ***************** | |
172 * User: Vo Date: 2.12.99 Time: 13:25 | |
173 * Updated in $/GSM/Condat/MS/SRC/MFW | |
174 * New: request of max/used perferred PLMN list | |
175 * | |
176 * ***************** Version 29 ***************** | |
177 * User: Vo Date: 21.10.99 Time: 13:24 | |
178 * Updated in $/GSM/Condat/MS/SRC/MFW | |
179 * changed of read/change perferred PLMN list | |
180 * add event for successful de-registration | |
181 | | |
182 | ***************** Version 28 ***************** | |
183 | User: Le Date: 8.10.99 Time: 13:38 | |
184 | Updated in $/GSM/Condat/MS/SRC/MFW | |
185 * | |
186 * ***************** Version 27 ***************** | |
187 * User: Es Date: 16.09.99 Time: 16:56 | |
188 * Updated in $/GSM/DEV/MS/SRC/MFW | |
189 * reordered include statements due to addons in mfw_phb.h | |
190 * | |
191 * ***************** Version 26 ***************** | |
192 * User: Vo Date: 13.09.99 Time: 11:39 | |
193 * Updated in $/GSM/DEV/MS/SRC/MFW | |
194 * Bug fix: registration with numeric network format | |
195 * | |
196 * ***************** Version 25 ***************** | |
197 * User: Vo Date: 30.08.99 Time: 14:03 | |
198 * Updated in $/GSM/DEV/MS/SRC/MFW | |
199 * bug fix | |
200 * new function | |
201 * | |
202 * ***************** Version 24 ***************** | |
203 * User: Vo Date: 2.07.99 Time: 18:16 | |
204 * Updated in $/GSM/DEV/MS/SRC/MFW | |
205 * | |
206 * ***************** Version 23 ***************** | |
207 * User: Vo Date: 20.05.99 Time: 17:39 | |
208 * Updated in $/GSM/DEV/MS/SRC/MFW | |
209 * | |
210 * ***************** Version 22 ***************** | |
211 * User: Vo Date: 28.04.99 Time: 16:11 | |
212 * Updated in $/GSM/DEV/MS/SRC/MFW | |
213 * | |
214 * ***************** Version 21 ***************** | |
215 * User: Vo Date: 31.03.99 Time: 14:09 | |
216 * Updated in $/GSM/DEV/MS/SRC/MFW | |
217 * | |
218 * ***************** Version 20 ***************** | |
219 * User: Es Date: 15.03.99 Time: 18:21 | |
220 * Updated in $/GSM/DEV/MS/SRC/MFW | |
221 * recode | |
222 * | |
223 * ***************** Version 19 ***************** | |
224 * User: Vo Date: 17.02.99 Time: 19:03 | |
225 * Updated in $/GSM/DEV/MS/SRC/MFW | |
226 * | |
227 * ***************** Version 18 ***************** | |
228 * User: Vo Date: 12.02.99 Time: 18:59 | |
229 * Updated in $/GSM/DEV/MS/SRC/MFW | |
230 * | |
231 * ***************** Version 17 ***************** | |
232 * User: Vo Date: 9.02.99 Time: 14:54 | |
233 * Updated in $/GSM/DEV/MS/SRC/MFW | |
234 * | |
235 * ***************** Version 16 ***************** | |
236 * User: Vo Date: 12.01.99 Time: 14:55 | |
237 * Updated in $/GSM/DEV/MS/SRC/MFW | |
238 * | |
239 * ***************** Version 15 ***************** | |
240 * User: Es Date: 23.12.98 Time: 15:47 | |
241 * Updated in $/GSM/DEV/MS/SRC/MFW | |
242 * | |
243 * ***************** Version 14 ***************** | |
244 * User: Es Date: 18.12.98 Time: 13:04 | |
245 * Updated in $/GSM/DEV/MS/SRC/MFW | |
246 * | |
247 * ***************** Version 13 ***************** | |
248 * User: Es Date: 8.12.98 Time: 16:53 | |
249 * Updated in $/GSM/DEV/MS/SRC/MFW | |
250 * | |
251 * ***************** Version 11 ***************** | |
252 * User: Vo Date: 1.12.98 Time: 15:43 | |
253 * Updated in $/GSM/DEV/MS/SRC/MFW | |
254 * | |
255 * ***************** Version 10 ***************** | |
256 * User: Vo Date: 30.11.98 Time: 17:49 | |
257 * Updated in $/GSM/DEV/MS/SRC/MFW | |
258 * | |
259 * ***************** Version 9 ***************** | |
260 * User: Vo Date: 24.11.98 Time: 21:40 | |
261 * Updated in $/GSM/DEV/MS/SRC/MFW | |
262 * first successful compilation of MFW | |
263 * | |
264 * ***************** Version 8 ***************** | |
265 * User: Vo Date: 13.11.98 Time: 16:21 | |
266 * Updated in $/GSM/DEV/MS/SRC/MFW | |
267 * | |
268 * ***************** Version 7 ***************** | |
269 * User: Es Date: 12.11.98 Time: 13:50 | |
270 * Updated in $/GSM/DEV/MS/SRC/MFW | |
271 | | |
272 | ***************** Version 6 ***************** | |
273 | User: Le Date: 11.11.98 Time: 13:35 | |
274 | Updated in $/GSM/DEV/MS/SRC/MFW | |
275 | | |
276 | ***************** Version 5 ***************** | |
277 | User: Le Date: 10.11.98 Time: 16:07 | |
278 | Updated in $/GSM/DEV/MS/SRC/MFW | |
279 | | |
280 | ***************** Version 4 ***************** | |
281 | User: Le Date: 10.11.98 Time: 11:08 | |
282 | Updated in $/GSM/DEV/MS/SRC/MFW | |
283 | | |
284 | ***************** Version 3 ***************** | |
285 | User: Le Date: 27.10.98 Time: 15:59 | |
286 | Updated in $/GSM/DEV/MS/SRC/MFW | |
287 | | |
288 | ***************** Version 2 ***************** | |
289 | User: Le Date: 21.10.98 Time: 16:20 | |
290 | Updated in $/GSM/DEV/MS/SRC/MFW | |
291 | | |
292 | ***************** Version 1 ***************** | |
293 | User: Le Date: 21.10.98 Time: 10:33 | |
294 | Created in $/GSM/DEV/MS/SRC/MFW | |
295 */ | |
296 | |
297 #define ENTITY_MFW | |
298 | |
299 #include <string.h> | |
300 #include <stdio.h> | |
301 #include <stdlib.h> | |
302 | |
303 #if defined (NEW_FRAME) | |
304 | |
305 #include "typedefs.h" | |
306 #include "vsi.h" | |
307 #include "pei.h" | |
308 #include "custom.h" | |
309 #include "gsm.h" | |
310 | |
311 #else | |
312 | |
313 #include "STDDEFS.H" | |
314 #include "custom.h" | |
315 #include "gsm.h" | |
316 #include "vsi.h" | |
317 | |
318 #endif | |
319 | |
320 #include "prim.h" | |
321 | |
322 #include "mfw_mfw.h" | |
323 #include "mfw_nm.h" | |
324 #include "mfw_sim.h" | |
325 #include "mfw_sima.h" | |
326 #include "mfw_nmi.h" | |
327 #include "mfw_simi.h" | |
328 #include "mfw_nma.h" | |
329 #include "mfw_acie.h" | |
330 #include "mfw_phb.h" | |
331 #include "mfw_cm.h" | |
332 #include "mfw_sms.h" | |
333 #include "mfw_win.h" | |
334 | |
335 // June 02, 2006 DR: OMAPS00078005 x0021334 | |
336 #ifdef FF_TIMEZONE | |
337 #include "mfw_td.h" | |
338 #endif | |
339 | |
340 #include "ksd.h" | |
341 #include "psa.h" | |
342 | |
343 #include "mfw_ss.h" | |
344 #include "mfw_ssi.h" | |
345 | |
346 #if defined (FAX_AND_DATA) | |
347 #include "aci_fd.h" | |
348 #endif | |
349 | |
350 #include "mfw_ffs.h" | |
351 | |
352 #include "message.h" | |
353 #include "prim.h" | |
354 #include "aci_cmh.h" //GW 22-11-01 - Added | |
355 | |
356 #ifdef SIM_TOOLKIT | |
357 #include "mfw_sat.h" | |
358 #endif | |
359 | |
360 #ifndef NEPTUNE_BOARD | |
361 | |
362 #ifdef TI_PS_OP_OPN_TAB_ROMBASED | |
363 /* Changes for ROM data */ | |
364 /* Operator List size in ROM. Should go to where the decompression algo is present*/ | |
365 #define PLMN_OPER_LST_SIZE_ROM 628 | |
366 /* Changes for ROM data | |
367 extern const T_OPER_NTRY_FIXED operListFixed[]; | |
368 Side access into cus_aci.h | |
369 Above decl no more required */ | |
370 EXTERN const UBYTE *ptr_plmn_compressed; | |
371 EXTERN SHORT cmhMM_decodePlmn (T_OPER_ENTRY *oper, const UBYTE *plmn_comp_entry); | |
372 EXTERN USHORT cmhMM_PlmnEntryLength (const UBYTE *plmn_comp_entry); | |
373 #else | |
374 extern const T_OPER_NTRY_FIXED operListFixed[]; /* Side access into cus_aci.h */ | |
375 #endif | |
376 | |
377 #else | |
378 extern const T_OPER_NTRY operList[]; | |
379 #endif | |
380 EXTERN MfwHdr * current_mfw_elem; | |
381 | |
382 U8 mfw_IMSI [LONG_NAME]; /* expanded IMSI (ASCIIZ) */ | |
383 | |
384 static U8 last_selected_mode = NOT_PRESENT_8BIT; | |
385 static U8 reg_stat; | |
386 static U8 reg_flag; | |
387 #ifdef NO_ASCIIZ | |
388 static T_MFW_SP_NAME service_provider_name; | |
389 #else | |
390 static U8 service_provider_name [LONG_NAME]; | |
391 #endif | |
392 static U8 display_condition; | |
393 static T_MFW_PREF_PLMN_LIST pplmn_list; | |
394 static T_MFW_NET_IND net_ind; | |
395 static T_MFW_TIME_IND tim_ind; | |
396 static UBYTE mfwPplmnReq; | |
397 static BOOL sat_update = FALSE; | |
398 // Sep 23, 2004 REF: CRR 24562 xvilliva | |
399 int g_ensErr = 0; | |
400 | |
401 /*SPR#2122 - DS - Commented out. Now operator list is dynamically allocated in nm_avail_plmn_list() | |
402 *static T_ACI_COPS_OPDESC oper_list [MAX_OPER]; | |
403 */ | |
404 | |
405 static int nmCommand (U32 cmd, void *h); /* handle window commands */ | |
406 static void nm_search_reg_status(void); | |
407 | |
408 U8 pplmnCnt; | |
409 U8 pplmnCmd; | |
410 | |
411 static int pSlot; /* primitive handler slot */ | |
412 | |
413 /* | |
414 +--------------------------------------------------------------------+ | |
415 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
416 | STATE : code ROUTINE : nm_init | | |
417 +--------------------------------------------------------------------+ | |
418 | |
419 PURPOSE : Initialize network manager | |
420 | |
421 */ | |
422 int nm_init (void) | |
423 { | |
424 | |
425 TRACE_FUNCTION("nm_init()"); | |
426 | |
427 if (last_selected_mode == NOT_PRESENT_8BIT) | |
428 { | |
429 last_selected_mode = FFS_flashData.PLMN_selection_mode; | |
430 } | |
431 /* install prim handler */ | |
432 pSlot = aci_create(nma_response_cb,NULL); | |
433 | |
434 reg_flag = 0; | |
435 mfwPplmnReq = 0; | |
436 reg_stat = NOT_PRESENT_8BIT; | |
437 sat_update = FALSE; | |
438 mfwCommand[MfwTypNm] = (MfwCb) nmCommand; | |
439 | |
440 return last_selected_mode; | |
441 } | |
442 | |
443 | |
444 /* | |
445 +--------------------------------------------------------------------+ | |
446 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
447 | STATE : code ROUTINE : nm_exit | | |
448 +--------------------------------------------------------------------+ | |
449 | |
450 PURPOSE : Finalize network manager | |
451 | |
452 */ | |
453 | |
454 void nm_exit (void) | |
455 { | |
456 /* remove prim handler */ | |
457 aci_delete(pSlot); | |
458 last_selected_mode = NOT_PRESENT_8BIT; | |
459 reg_stat = NOT_PRESENT_8BIT; | |
460 } | |
461 | |
462 | |
463 /* | |
464 +--------------------------------------------------------------------+ | |
465 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
466 | STATE : code ROUTINE : nm_create | | |
467 +--------------------------------------------------------------------+ | |
468 | |
469 PURPOSE : Create network manager | |
470 | |
471 */ | |
472 | |
473 MfwHnd nm_create (MfwHnd hWin, MfwEvt event, MfwCb cbfunc) | |
474 { | |
475 MfwHdr *hdr; | |
476 T_MFW_NM *nm_para; | |
477 MfwHdr *insert_status =0; | |
478 | |
479 TRACE_FUNCTION("nm_create()"); | |
480 | |
481 hdr = (MfwHdr *) mfwAlloc(sizeof(MfwHdr)); | |
482 nm_para = (T_MFW_NM *) mfwAlloc(sizeof(T_MFW_NM)); | |
483 | |
484 if (!hdr || !nm_para) | |
485 { | |
486 TRACE_ERROR("ERROR: nm_create() Mem Alloc Failed."); | |
487 | |
488 if(hdr) | |
489 mfwFree((U8*)hdr,sizeof(MfwHdr)); | |
490 if(nm_para) | |
491 mfwFree((U8*)nm_para,sizeof(T_MFW_NM)); | |
492 | |
493 return FALSE; | |
494 } | |
495 | |
496 nm_para->emask = event; | |
497 nm_para->handler = cbfunc; | |
498 | |
499 hdr->data = nm_para; /* store parameter in node */ | |
500 hdr->type = MfwTypNm; /* type of event handler */ | |
501 | |
502 insert_status = mfwInsert((MfwHdr *) hWin,hdr); | |
503 if(!insert_status) | |
504 { | |
505 TRACE_ERROR("ERROR: nm_create() Failed to Install Handler. "); | |
506 mfwFree((U8*)hdr,sizeof(MfwHdr)); | |
507 mfwFree((U8*)nm_para ,sizeof(T_MFW_NM)); | |
508 return 0; | |
509 } | |
510 return insert_status; | |
511 } | |
512 | |
513 | |
514 /* | |
515 +--------------------------------------------------------------------+ | |
516 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
517 | STATE : code ROUTINE : nm_delete | | |
518 +--------------------------------------------------------------------+ | |
519 | |
520 PURPOSE : delete network manager | |
521 | |
522 */ | |
523 | |
524 MfwRes nm_delete (MfwHnd h) | |
525 { | |
526 TRACE_FUNCTION("nm_delete()"); | |
527 | |
528 if (!h || !((MfwHdr *) h)->data) | |
529 return MfwResIllHnd; | |
530 | |
531 if (!mfwRemove((MfwHdr *) h)) | |
532 return MfwResIllHnd; | |
533 | |
534 mfwFree(((MfwHdr *) h)->data,sizeof(T_MFW_NM)); | |
535 mfwFree(h,sizeof(MfwHdr)); | |
536 | |
537 return MfwResOk; | |
538 } | |
539 | |
540 | |
541 /* | |
542 +--------------------------------------------------------------------+ | |
543 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
544 | STATE : code ROUTINE : nm_sign_exec | | |
545 +--------------------------------------------------------------------+ | |
546 | |
547 PURPOSE : dispatch network management signal | |
548 | |
549 */ | |
550 | |
551 static int nm_sign_exec (MfwHdr *cur_elem, MfwEvt event, | |
552 T_MFW_NM_PARA * para) | |
553 { | |
554 TRACE_FUNCTION("nm_sign_exec()"); | |
555 | |
556 while (cur_elem) | |
557 { | |
558 if (cur_elem->type == MfwTypNm) | |
559 { | |
560 T_MFW_NM *nm_data; | |
561 | |
562 nm_data = (T_MFW_NM *) cur_elem->data; | |
563 if (nm_data->emask & event) | |
564 { | |
565 nm_data->event = event; | |
566 switch (event) | |
567 { | |
568 case E_NM_FULL_SERVICE: | |
569 //x0pleela 9 Feb, 2006 ER:OMAPS00065203 | |
570 //Handling E_NM_OPN for operator name display | |
571 case E_NM_OPN: | |
572 memcpy(&nm_data->para.ident,para, | |
573 sizeof(T_MFW_NETWORK_STRUCT)); | |
574 break; | |
575 case E_NM_PLMN_LIST: | |
576 memcpy(&nm_data->para.plmns,para, | |
577 sizeof(T_MFW_PLMN_LIST)); | |
578 break; | |
579 case E_NM_PREF_PLMN_LIST: | |
580 memcpy(&nm_data->para.pplmns,para, | |
581 sizeof(T_MFW_PREF_PLMN_LIST)); | |
582 break; | |
583 case E_NM_PPLMN_MEM: | |
584 memcpy(&nm_data->para.pplmn_mem,para, | |
585 sizeof(T_MFW_PPLMN_MEM)); | |
586 break; | |
587 case E_NM_CELL_SELECT: | |
588 memcpy(&nm_data->para.cell_info,para, | |
589 sizeof(T_MFW_CELL_STRUCT)); | |
590 break; | |
591 case E_MFW_NET_IND: | |
592 memcpy(&nm_data->para.net_info,para, | |
593 sizeof(T_MFW_NET_IND)); | |
594 break; | |
595 case E_MFW_TIME_IND: | |
596 memcpy(&nm_data->para.tim_info,para, | |
597 sizeof(T_MFW_TIME_IND)); | |
598 break; | |
599 } | |
600 if (nm_data->handler) | |
601 { | |
602 // PATCH LE 06.06.00 | |
603 // store current mfw elem | |
604 current_mfw_elem = cur_elem; | |
605 // END PATCH LE 06.06.00 | |
606 if ((*(nm_data->handler)) (nm_data->event, | |
607 (void *) &nm_data->para)) | |
608 return TRUE; | |
609 } | |
610 } | |
611 } | |
612 cur_elem = cur_elem->next; | |
613 } | |
614 | |
615 return FALSE; | |
616 } | |
617 | |
618 | |
619 /* | |
620 +--------------------------------------------------------------------+ | |
621 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
622 | STATE : code ROUTINE : nm_signal | | |
623 +--------------------------------------------------------------------+ | |
624 | |
625 PURPOSE : Send a signal | |
626 | |
627 */ | |
628 | |
629 static void nm_signal (MfwEvt event, void *para) | |
630 { | |
631 UBYTE temp=0; | |
632 TRACE_FUNCTION("nm_signal()"); | |
633 | |
634 #ifndef FF_POWER_MANAGEMENT | |
635 temp = dspl_Enable(0); | |
636 #else | |
637 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
638 display is enabled only when lcd refresh is needed*/ | |
639 if(FFS_flashData.refresh == 1) | |
640 temp = dspl_Enable(0); | |
641 #endif | |
642 if (mfwSignallingMethod EQ 0) | |
643 { | |
644 if (mfwFocus) | |
645 if (nm_sign_exec(mfwFocus,event,para)) | |
646 { | |
647 #ifndef FF_POWER_MANAGEMENT | |
648 dspl_Enable(temp); | |
649 #else | |
650 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
651 display is enabled only when lcd refresh is needed*/ | |
652 if(FFS_flashData.refresh == 1) | |
653 dspl_Enable(temp); | |
654 #endif | |
655 return; | |
656 } | |
657 if (mfwRoot) | |
658 nm_sign_exec(mfwRoot,event,para); | |
659 } | |
660 else | |
661 { | |
662 MfwHdr * h = 0; | |
663 | |
664 /* | |
665 * Focus set, then start here | |
666 */ | |
667 if (mfwFocus) | |
668 h = mfwFocus; | |
669 /* | |
670 * Focus not set, then start root | |
671 */ | |
672 if (!h) | |
673 h = mfwRoot; | |
674 | |
675 /* | |
676 * No elements available, return | |
677 */ | |
678 | |
679 while (h) | |
680 | |
681 | |
682 { | |
683 /* | |
684 * Signal consumed, then return | |
685 */ | |
686 if (nm_sign_exec (h, event, para)) | |
687 { | |
688 #ifndef FF_POWER_MANAGEMENT | |
689 dspl_Enable(temp); | |
690 #else | |
691 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
692 display is enabled only when lcd refresh is needed*/ | |
693 if(FFS_flashData.refresh == 1) | |
694 dspl_Enable(temp); | |
695 #endif | |
696 return; | |
697 } | |
698 | |
699 /* | |
700 * All windows tried inclusive root | |
701 */ | |
702 if (h == mfwRoot) | |
703 { | |
704 #ifndef FF_POWER_MANAGEMENT | |
705 dspl_Enable(temp); | |
706 #else | |
707 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
708 display is enabled only when lcd refresh is needed*/ | |
709 if(FFS_flashData.refresh == 1) | |
710 dspl_Enable(temp); | |
711 #endif | |
712 return; | |
713 } | |
714 | |
715 /* | |
716 * get parent window | |
717 */ | |
718 h = mfwParent(mfwParent(h)); | |
719 if(h) | |
720 h = ((MfwWin * )(h->data))->elems; | |
721 } | |
722 nm_sign_exec (mfwRoot, event, para); | |
723 } | |
724 #ifndef FF_POWER_MANAGEMENT | |
725 dspl_Enable(temp); | |
726 #else | |
727 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) | |
728 display is enabled only when lcd refresh is needed*/ | |
729 if(FFS_flashData.refresh == 1) | |
730 dspl_Enable(temp); | |
731 #endif | |
732 } | |
733 | |
734 | |
735 | |
736 /* | |
737 +--------------------------------------------------------------------+ | |
738 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
739 | STATE : code ROUTINE : nm_set_mode | | |
740 +--------------------------------------------------------------------+ | |
741 | |
742 PURPOSE : Change registration mode | |
743 | |
744 */ | |
745 | |
746 void nm_set_mode (U8 mode) | |
747 { | |
748 | |
749 TRACE_FUNCTION("nm_set_mode()"); | |
750 | |
751 if (mode != NM_AUTOMATIC && mode != NM_MANUAL) | |
752 return; | |
753 | |
754 if (mode != last_selected_mode) | |
755 { | |
756 last_selected_mode = mode; | |
757 { | |
758 FFS_flashData.PLMN_selection_mode = mode; | |
759 flash_write(); | |
760 } | |
761 } | |
762 } | |
763 | |
764 | |
765 /* | |
766 +--------------------------------------------------------------------+ | |
767 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
768 | STATE : code ROUTINE : nm_get_mode | | |
769 +--------------------------------------------------------------------+ | |
770 | |
771 PURPOSE : Get registration mode | |
772 | |
773 */ | |
774 | |
775 T_MFW nm_get_mode () | |
776 { | |
777 return last_selected_mode; | |
778 } | |
779 | |
780 | |
781 /* | |
782 +--------------------------------------------------------------------+ | |
783 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
784 | STATE : code ROUTINE : nm_activate | | |
785 +--------------------------------------------------------------------+ | |
786 | |
787 PURPOSE : Notify about SIM card activation | |
788 | |
789 */ | |
790 | |
791 void nm_activate (U8 result) | |
792 { | |
793 //TRACE_FUNCTION("nm_activate()"); | |
794 | |
795 } | |
796 | |
797 | |
798 /* | |
799 +--------------------------------------------------------------------+ | |
800 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
801 | STATE : code ROUTINE : nm_reg_flag_req | | |
802 +--------------------------------------------------------------------+ | |
803 | |
804 PURPOSE : Notify about SIM card activation | |
805 | |
806 */ | |
807 | |
808 T_MFW nm_reg_flag_req() | |
809 { | |
810 return reg_flag; | |
811 } | |
812 | |
813 | |
814 /* | |
815 +--------------------------------------------------------------------+ | |
816 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
817 | STATE : code ROUTINE : nm_mmi_parameters | | |
818 +--------------------------------------------------------------------+ | |
819 | |
820 PURPOSE : Notify about relevant parameters | |
821 | |
822 */ | |
823 | |
824 #ifdef FF_2TO1_PS | |
825 void nm_mmi_parameters (T_SIM_imsi_field *imsi, T_SIM_pref_plmn *plmn) | |
826 { | |
827 void simDecodeIMSI (U8 *ci, U8 li, U8 *di); | |
828 | |
829 TRACE_FUNCTION("nm_mmi_parameters()"); | |
830 | |
831 simDecodeIMSI(imsi->field,imsi->c_field,mfw_IMSI); | |
832 } | |
833 #else | |
834 void nm_mmi_parameters (T_imsi_field *imsi) | |
835 { | |
836 void simDecodeIMSI (U8 *ci, U8 li, U8 *di); | |
837 | |
838 TRACE_FUNCTION("nm_mmi_parameters()"); | |
839 | |
840 simDecodeIMSI(imsi->field,imsi->c_field,mfw_IMSI); | |
841 } | |
842 #endif | |
843 | |
844 | |
845 /* | |
846 +--------------------------------------------------------------------+ | |
847 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
848 | STATE : code ROUTINE : nm_pref_plmn_list | | |
849 +--------------------------------------------------------------------+ | |
850 | |
851 PURPOSE : Request preferred PLMN list | |
852 | |
853 */ | |
854 | |
855 void nm_pref_plmn_list(T_MFW_NETWORK_STRUCT *pplmn, UBYTE count, SHORT start) | |
856 { | |
857 SHORT lastIdx; | |
858 T_ACI_CPOL_OPDESC operLst[MAX_OPER]; | |
859 T_ACI_RETURN res; | |
860 UBYTE i, j; | |
861 | |
862 TRACE_FUNCTION("nm_pref_plmn_list()"); | |
863 | |
864 pplmn_list.count = 0; | |
865 pplmn_list.plmn = pplmn; | |
866 pplmnCnt = count; | |
867 | |
868 j = 0; | |
869 while (1) | |
870 { | |
871 res = qAT_PlusCPOL(CMD_SRC_LCL, | |
872 start, | |
873 &lastIdx, | |
874 operLst, | |
875 CPOL_MOD_CompactList); | |
876 if (res == AT_EXCT) | |
877 return; | |
878 | |
879 if (res == AT_CMPL) | |
880 { | |
881 for (i=0; i<MAX_OPER; i++) | |
882 { | |
883 if (operLst[i].index == -1 OR pplmn_list.count >= pplmnCnt) | |
884 break; | |
885 | |
886 pplmn_list.plmn[j].index = operLst[i].index; | |
887 #ifdef NO_ASCIIZ | |
888 sAT_PlusCOPSE((UBYTE *)operLst[i].oper, | |
889 (UBYTE)operLst[i].format, | |
890 &pplmn_list.plmn[j].network_long, | |
891 &pplmn_list.plmn[j].network_short, | |
892 pplmn_list.plmn[j].network_numeric); | |
893 #else | |
894 sAT_PlusCOPSE((UBYTE *)operLst[i].oper, | |
895 (UBYTE)operLst[i].format, | |
896 pplmn_list.plmn[j].network_long, | |
897 pplmn_list.plmn[j].network_short, | |
898 pplmn_list.plmn[j].network_numeric); | |
899 #endif | |
900 pplmn_list.count++; | |
901 j++; | |
902 } | |
903 if (i < MAX_OPER OR (j EQ pplmnCnt)) | |
904 { | |
905 nm_signal(E_NM_PREF_PLMN_LIST, &pplmn_list); | |
906 return; | |
907 } | |
908 start = lastIdx + 1; | |
909 } | |
910 else | |
911 { | |
912 nm_signal(E_NM_PREF_PLMN_LIST, &pplmn_list); | |
913 return; | |
914 } | |
915 } | |
916 } | |
917 | |
918 | |
919 /* | |
920 +--------------------------------------------------------------------+ | |
921 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
922 | STATE : code ROUTINE : rAT_PlusCPOL | | |
923 +--------------------------------------------------------------------+ | |
924 | |
925 PURPOSE : callback of preferred PLMN list | |
926 | |
927 */ | |
928 | |
929 void rAT_PlusCPOL(SHORT startIdx, SHORT lastIdx, | |
930 T_ACI_CPOL_OPDESC *operLst, | |
931 SHORT usdNtry) | |
932 { | |
933 UBYTE i, j; | |
934 SHORT endIdx; | |
935 T_MFW_PPLMN_MEM pplmn_mem; | |
936 | |
937 TRACE_FUNCTION("nm_pref_plmn_list()"); | |
938 | |
939 if (mfwPplmnReq) | |
940 { | |
941 mfwPplmnReq = 0; | |
942 pplmn_mem.maxRcd = (UBYTE)lastIdx; | |
943 pplmn_mem.usedRcd = (UBYTE)usdNtry; | |
944 nm_signal(E_NM_PPLMN_MEM, &pplmn_mem); | |
945 return; | |
946 } | |
947 | |
948 endIdx = lastIdx; | |
949 j = 0; | |
950 while (1) | |
951 { | |
952 for (i=0; i<MAX_OPER; i++) | |
953 { | |
954 if (operLst[i].index == -1 OR pplmn_list.count >= pplmnCnt) | |
955 break; | |
956 | |
957 pplmn_list.plmn[j].index = operLst[i].index; | |
958 #ifdef NO_ASCIIZ | |
959 sAT_PlusCOPSE((UBYTE *)operLst[i].oper, | |
960 (UBYTE)operLst[i].format, | |
961 &pplmn_list.plmn[j].network_long, | |
962 &pplmn_list.plmn[j].network_short, | |
963 pplmn_list.plmn[j].network_numeric); | |
964 #else | |
965 sAT_PlusCOPSE((UBYTE *)operLst[i].oper, | |
966 (UBYTE)operLst[i].format, | |
967 pplmn_list.plmn[j].network_long, | |
968 pplmn_list.plmn[j].network_short, | |
969 pplmn_list.plmn[j].network_numeric); | |
970 #endif | |
971 pplmn_list.count++; | |
972 j++; | |
973 } | |
974 if ((i<MAX_OPER) OR (j EQ pplmnCnt)) | |
975 { | |
976 nm_signal(E_NM_PREF_PLMN_LIST, &pplmn_list); | |
977 return; | |
978 } | |
979 startIdx = endIdx + 1; | |
980 if (qAT_PlusCPOL(CMD_SRC_LCL, startIdx, &endIdx, | |
981 operLst, CPOL_MOD_CompactList) != AT_CMPL) | |
982 { | |
983 nm_signal(E_NM_PREF_PLMN_LIST, &pplmn_list); | |
984 return; | |
985 } | |
986 } | |
987 } | |
988 | |
989 | |
990 /* | |
991 +----------------------------------------------------------------------+ | |
992 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
993 | STATE : code ROUTINE : nm_change_pref_plmn | | |
994 +----------------------------------------------------------------------+ | |
995 | |
996 PURPOSE : Save/Change/Delete a preferred PLMN | |
997 | |
998 */ | |
999 | |
1000 T_MFW_NM_RETURN nm_change_pref_plmn(T_MFW_PPLMN_MODE mode, | |
1001 SHORT index, SHORT index2, | |
1002 UBYTE *network_numeric) | |
1003 { | |
1004 SHORT idx; | |
1005 T_ACI_CPOL_FRMT format; | |
1006 CHAR * oper; | |
1007 SHORT idx2; | |
1008 T_ACI_CPOL_MOD md; | |
1009 | |
1010 TRACE_FUNCTION("nm_change_pref_plmn()"); | |
1011 | |
1012 switch (mode) | |
1013 { | |
1014 case NEW_PREF_PLMN: | |
1015 idx = -1; | |
1016 idx2 = -1; | |
1017 format = CPOL_FRMT_Numeric; | |
1018 oper = (CHAR *)network_numeric; | |
1019 md = CPOL_MOD_CompactList; | |
1020 break; | |
1021 case REPLACE_PREF_PLMN: | |
1022 idx = index; | |
1023 idx2 = -1; | |
1024 format = CPOL_FRMT_Numeric; | |
1025 oper = (CHAR *)network_numeric; | |
1026 md = CPOL_MOD_CompactList; | |
1027 break; | |
1028 case DELETE_PREF_PLMN: | |
1029 idx = index; | |
1030 idx2 = -1; | |
1031 format = CPOL_FRMT_NotPresent; | |
1032 oper = NULL; | |
1033 md = CPOL_MOD_CompactList; | |
1034 break; | |
1035 case INSERT_PREF_PLMN: | |
1036 idx = index; | |
1037 idx2 = -1; | |
1038 format = CPOL_FRMT_Numeric; | |
1039 oper = (CHAR *)network_numeric; | |
1040 md = CPOL_MOD_Insert; | |
1041 break; | |
1042 case CHANGE_PREF_PLMN: | |
1043 idx = index; | |
1044 idx2 = index2; | |
1045 format = CPOL_FRMT_Numeric; | |
1046 oper = (CHAR *)network_numeric; | |
1047 md = CPOL_MOD_CompactList; | |
1048 break; | |
1049 default: | |
1050 return NM_ERR; | |
1051 } | |
1052 | |
1053 if (sAT_PlusCPOL(CMD_SRC_LCL, idx, format, | |
1054 oper, idx2, md) != AT_EXCT) | |
1055 return NM_ERR; | |
1056 pplmnCmd = CHANGE_PREF_PLMN; | |
1057 return NM_OK; | |
1058 } | |
1059 | |
1060 | |
1061 /* | |
1062 +----------------------------------------------------------------------+ | |
1063 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1064 | STATE : code ROUTINE : nm_change_pref_plmn_longname | | |
1065 +----------------------------------------------------------------------+ | |
1066 | |
1067 PURPOSE : Change a preferred PLMN using longname. added for SPR 2635. | |
1068 | |
1069 */ | |
1070 | |
1071 T_MFW_NM_RETURN nm_change_pref_plmn_longname(T_MFW_PPLMN_MODE mode, | |
1072 SHORT index, SHORT index2, | |
1073 char *network_long) | |
1074 { | |
1075 SHORT idx; | |
1076 T_ACI_CPOL_FRMT format; | |
1077 CHAR * oper; | |
1078 SHORT idx2; | |
1079 T_ACI_CPOL_MOD md; | |
1080 | |
1081 TRACE_FUNCTION("nm_change_pref_plmn()"); | |
1082 | |
1083 switch (mode) | |
1084 { | |
1085 | |
1086 case REPLACE_PREF_PLMN: | |
1087 idx = index; | |
1088 idx2 = -1; | |
1089 format = CPOL_FRMT_Long; | |
1090 oper = (CHAR *)network_long; | |
1091 md = CPOL_MOD_CompactList; | |
1092 break; | |
1093 | |
1094 default: | |
1095 return NM_ERR; | |
1096 } | |
1097 | |
1098 if (sAT_PlusCPOL(CMD_SRC_LCL, idx, format, | |
1099 oper, idx2, md) != AT_EXCT) | |
1100 return NM_ERR; | |
1101 pplmnCmd = CHANGE_PREF_PLMN; | |
1102 return NM_OK; | |
1103 } | |
1104 | |
1105 /* | |
1106 +--------------------------------------------------------------------+ | |
1107 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1108 | STATE : code ROUTINE : nm_ok_pref_plmn | | |
1109 +--------------------------------------------------------------------+ | |
1110 | |
1111 | |
1112 PURPOSE : The change of preferred PLMN is successful. | |
1113 | |
1114 */ | |
1115 | |
1116 void nm_ok_pref_plmn(void) | |
1117 { | |
1118 TRACE_FUNCTION("nm_ok_pref_plmn()"); | |
1119 | |
1120 if (pplmnCmd == CHANGE_PREF_PLMN) | |
1121 { | |
1122 pplmnCmd = CMD_NOT_PRESENT; | |
1123 nm_signal(E_NM_CHANGE_PPLMN_OK, 0); | |
1124 } | |
1125 } | |
1126 | |
1127 | |
1128 /* | |
1129 +--------------------------------------------------------------------+ | |
1130 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1131 | STATE : code ROUTINE : nm_error_pref_plmn | | |
1132 +--------------------------------------------------------------------+ | |
1133 | |
1134 | |
1135 PURPOSE : The change of preferred PLMN is failed. | |
1136 | |
1137 */ | |
1138 | |
1139 void nm_error_pref_plmn(void) | |
1140 { | |
1141 TRACE_FUNCTION("nm_error_pref_plmn()"); | |
1142 | |
1143 if (pplmnCmd == CHANGE_PREF_PLMN) | |
1144 { | |
1145 pplmnCmd = CMD_NOT_PRESENT; | |
1146 nm_signal(E_NM_CHANGE_PPLMN_ERR, 0); | |
1147 return; | |
1148 } | |
1149 if (mfwPplmnReq) | |
1150 mfwPplmnReq = 0; | |
1151 pplmn_list.count = 0; | |
1152 nm_signal(E_NM_PREF_PLMN_LIST, &pplmn_list); | |
1153 } | |
1154 | |
1155 | |
1156 /* | |
1157 +--------------------------------------------------------------------+ | |
1158 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1159 | STATE : code ROUTINE : nm_copy_plmn_list | | |
1160 +--------------------------------------------------------------------+ | |
1161 | |
1162 | |
1163 PURPOSE : Write the PLMN information in PLMN list | |
1164 | |
1165 */ | |
1166 | |
1167 void nm_copy_plmn_list (T_MFW_NETWORK_STRUCT *plmn, T_ACI_COPS_OPDESC *operLst) | |
1168 { | |
1169 U8 *forbidden_id; | |
1170 U8 *fieldstrength; | |
1171 | |
1172 TRACE_FUNCTION("nm_copy_plmn_list()"); | |
1173 #ifdef NO_ASCIIZ | |
1174 plmn->network_long.len = 0; | |
1175 plmn->network_short.len = 0; | |
1176 memset(plmn->network_numeric, 0, NUMERIC_LENGTH); | |
1177 | |
1178 if (operLst->longOper) | |
1179 { | |
1180 USHORT length=strlen((const char *)operLst->longOper); | |
1181 plmn->network_long.len = MINIMUM(LONG_NAME-1, length); | |
1182 memcpy (plmn->network_long.data, operLst->longOper, plmn->network_long.len); | |
1183 plmn->network_long.data[plmn->network_long.len] = '\0'; | |
1184 plmn->network_long.dcs = MFW_ASCII; | |
1185 } | |
1186 | |
1187 if (operLst->shortOper) | |
1188 { | |
1189 USHORT length=strlen((const char *)operLst->shortOper); | |
1190 plmn->network_short.len = MINIMUM(SHORT_NAME-1, length); | |
1191 memcpy (plmn->network_short.data, operLst->shortOper, plmn->network_short.len); | |
1192 plmn->network_short.data[plmn->network_short.len] = '\0'; | |
1193 plmn->network_short.dcs = MFW_ASCII; | |
1194 } | |
1195 #else | |
1196 memset(plmn->network_long, 0, LONG_NAME); | |
1197 memset(plmn->network_short, 0, SHORT_NAME); | |
1198 memset(plmn->network_numeric, 0, NUMERIC_LENGTH); | |
1199 | |
1200 if (operLst->longOper) | |
1201 strncpy((char *)plmn->network_long, (char *)operLst->longOper, LONG_NAME-1); | |
1202 | |
1203 if (operLst->shortOper) | |
1204 strncpy((char *)plmn->network_short, (char *)operLst->shortOper, SHORT_NAME-1); | |
1205 #endif | |
1206 if (operLst->numOper) | |
1207 strncpy((char *)plmn->network_numeric, (char *)operLst->numOper, NUMERIC_LENGTH-1); | |
1208 | |
1209 if (operLst->status == COPS_STAT_Available | |
1210 || operLst->status == COPS_STAT_Current) | |
1211 plmn->forbidden_indicator = MFW_PLMN_AVAILABLE; | |
1212 else | |
1213 plmn->forbidden_indicator = MFW_PLMN_FORBIDDEN; | |
1214 | |
1215 if (!strncmp((char *) mfw_IMSI,(char *) plmn->network_numeric,5)) | |
1216 plmn->roaming_indicator = 0; | |
1217 else | |
1218 plmn->roaming_indicator = 1; | |
1219 | |
1220 sAT_PlusCOPSF(&forbidden_id,&fieldstrength); | |
1221 plmn->fieldstrength = fieldstrength; | |
1222 } | |
1223 | |
1224 | |
1225 /* | |
1226 +---------------------------------------------------------------------+ | |
1227 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1228 | STATE : code ROUTINE : nm_pplmn_mem_req | | |
1229 +---------------------------------------------------------------------+ | |
1230 | |
1231 PURPOSE : Request the maximum number of preferred PLMN records | |
1232 in SIM card | |
1233 | |
1234 */ | |
1235 | |
1236 T_MFW_NM_RETURN nm_pplmn_mem_req(void) | |
1237 { | |
1238 T_ACI_RETURN res; | |
1239 SHORT maxRcd, usedRcd; | |
1240 T_MFW_PPLMN_MEM pplmn_mem; | |
1241 | |
1242 TRACE_FUNCTION("nm_pplmn_mem_req()"); | |
1243 | |
1244 res = tAT_PlusCPOL(CMD_SRC_LCL, &maxRcd, &usedRcd); | |
1245 if (res == AT_EXCT) | |
1246 { | |
1247 mfwPplmnReq = 1; | |
1248 return NM_OK; | |
1249 } | |
1250 if (res == AT_CMPL) | |
1251 { | |
1252 pplmn_mem.maxRcd = (UBYTE)maxRcd; | |
1253 pplmn_mem.usedRcd = (UBYTE)usedRcd; | |
1254 nm_signal(E_NM_PPLMN_MEM, &pplmn_mem); | |
1255 return NM_OK; | |
1256 } | |
1257 | |
1258 return NM_ERR; | |
1259 } | |
1260 | |
1261 | |
1262 /* | |
1263 +--------------------------------------------------------------------+ | |
1264 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1265 | STATE : code ROUTINE : nm_registration | | |
1266 +--------------------------------------------------------------------+ | |
1267 | |
1268 PURPOSE : Start registration | |
1269 | |
1270 */ | |
1271 | |
1272 T_MFW nm_registration (U8 mode, U8 freq_bands, U8 limited) | |
1273 { | |
1274 U8 sim_stat; | |
1275 | |
1276 TRACE_FUNCTION("nm_registration()"); | |
1277 | |
1278 sAT_Abort(CMD_SRC_LCL, AT_CMD_NRG); | |
1279 | |
1280 sim_stat = sim_status_check(); | |
1281 reg_flag = 1; | |
1282 | |
1283 if (limited) | |
1284 { | |
1285 if (sAT_PercentNRG(CMD_SRC_LCL, | |
1286 NRG_RGMD_Auto, | |
1287 NRG_SVMD_Limited, | |
1288 NRG_FRMT_Numeric, | |
1289 NULL) != AT_EXCT) | |
1290 TRACE_EVENT("Limited Service error: SAT_PercentNRG"); | |
1291 return sim_stat; | |
1292 } | |
1293 | |
1294 // Nov 24, 2005, a0876501, DR: OMAPS00045909 | |
1295 if (!limited && sim_stat == IMEI_NOT_VALID) | |
1296 return IMEI_NOT_VALID; | |
1297 | |
1298 if (!limited && sim_stat != SIM_ACTIVE) | |
1299 return SIM_NOT_ACTIVE; | |
1300 | |
1301 | |
1302 if (mode == NM_MANUAL) | |
1303 { | |
1304 /* | |
1305 Apr 13, 2004 REF: CRR 16303 JuanVi Jativa-Villoldo | |
1306 sim_spn_req(); Moved to the function rAT_PlusCFUNP | |
1307 */ | |
1308 /* May 15, 2006, a0393213 (R.Prabakar), OMAPS00075777 | |
1309 Description : It is supposed that the sample register itself automatically (in Manual Mode) | |
1310 to the last manual selected HPLMN cell before the power cycle, and this does not happen; | |
1311 instead this, the sample shows up the available networks list | |
1312 Fix : call to nm_avail_plmn_list() is changed to call to sAT_PercentNRG() */ | |
1313 if (sAT_PercentNRG(CMD_SRC_LCL, | |
1314 NRG_RGMD_Manual, | |
1315 NRG_SVMD_Full, | |
1316 NRG_FRMT_Numeric, | |
1317 NULL) != AT_EXCT) | |
1318 { | |
1319 TRACE_ERROR("sAT_PercentNRG error"); | |
1320 } | |
1321 } | |
1322 else | |
1323 { | |
1324 if (sAT_PercentNRG(CMD_SRC_LCL, | |
1325 NRG_RGMD_Auto, | |
1326 NRG_SVMD_Full, | |
1327 NRG_FRMT_Numeric, | |
1328 NULL) != AT_EXCT) | |
1329 { | |
1330 TRACE_ERROR("sAT_PercentNRG error"); | |
1331 } | |
1332 /* | |
1333 Apr 13, 2004 REF: CRR 16303 JuanVi Jativa-Villoldo | |
1334 sim_spn_req(); Moved to the function rAT_PlusCFUNP | |
1335 */ } | |
1336 return SIM_ACTIVE; | |
1337 } | |
1338 | |
1339 | |
1340 /* | |
1341 +--------------------------------------------------------------------+ | |
1342 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1343 | STATE : code ROUTINE : nm_avail_plmn_list | | |
1344 +--------------------------------------------------------------------+ | |
1345 | |
1346 PURPOSE : Request the available PLMN list | |
1347 | |
1348 SPR#2122 - DS - Restructured to make oper_list dynamically allocated | |
1349 */ | |
1350 | |
1351 | |
1352 | |
1353 void nm_avail_plmn_list () | |
1354 { | |
1355 T_ACI_RETURN result; | |
1356 int i; | |
1357 SHORT last_ind = 0; | |
1358 T_ACI_COPS_OPDESC* oper_list = NULL; | |
1359 //Mar 01, 2005 REF: ENH 29327 xdeepadh | |
1360 //Dynamically allocate the plmn_list. | |
1361 T_MFW_PLMN_LIST* plmn_list; | |
1362 plmn_list = (T_MFW_PLMN_LIST*)mfwAlloc(sizeof(T_MFW_PLMN_LIST)); | |
1363 if(plmn_list == NULL) | |
1364 { | |
1365 TRACE_EVENT("plmn_list malloc failed"); | |
1366 return ; | |
1367 } | |
1368 | |
1369 TRACE_FUNCTION("nm_avail_plmn_list()"); | |
1370 | |
1371 /* Dynamically allocate operator list buffer */ | |
1372 oper_list = (T_ACI_COPS_OPDESC*)mfwAlloc(sizeof(T_ACI_COPS_OPDESC)*MAX_OPER); | |
1373 | |
1374 if (oper_list == NULL) | |
1375 { | |
1376 TRACE_ERROR("ERROR: Failed to allocate oper list buffer"); | |
1377 //Mar 01, 2005 REF: ENH 29327 xdeepadh | |
1378 //Deallocate the plmn_list | |
1379 if(plmn_list !=NULL) | |
1380 { | |
1381 mfwFree((U8*)plmn_list,sizeof(T_MFW_PLMN_LIST)); | |
1382 plmn_list=NULL; | |
1383 } | |
1384 return; | |
1385 } | |
1386 | |
1387 | |
1388 // PATCH JVU - PLMN selection during registration | |
1389 sAT_Abort(CMD_SRC_LCL, AT_CMD_NRG); | |
1390 // END PATCH JVU - PLMN selection during registration | |
1391 | |
1392 plmn_list->count = 0; | |
1393 result = tAT_PlusCOPS(CMD_SRC_LCL,0,&last_ind,oper_list); | |
1394 if (result == AT_FAIL || result == AT_BUSY) | |
1395 { | |
1396 TRACE_ERROR("ERROR: tAT_PlusCOPS error"); | |
1397 //Sep 23, 2004 REF: CRR 24562 xvilliva | |
1398 //If AT_FAIL is returned, we query for the exact error | |
1399 //and set a variable accordingly. | |
1400 if(result == AT_FAIL) | |
1401 { | |
1402 ULONG err; | |
1403 | |
1404 err = qAT_ErrDesc(); | |
1405 switch (ACI_ERR_DESC_CLASS( err )) | |
1406 { | |
1407 case ACI_ERR_CLASS_Cme: | |
1408 if (ACI_ERR_DESC_NR( err ) == CME_ERR_OpNotAllow) | |
1409 { | |
1410 g_ensErr = 1; | |
1411 } | |
1412 break; | |
1413 } | |
1414 } | |
1415 | |
1416 /* Deallocate operator list buffer */ | |
1417 if (oper_list != NULL) | |
1418 { | |
1419 mfwFree((U8*)oper_list, sizeof(T_ACI_COPS_OPDESC)*MAX_OPER); | |
1420 oper_list = NULL; | |
1421 } | |
1422 | |
1423 nm_signal(E_NM_PLMN_LIST,plmn_list); | |
1424 //Mar 01, 2005 REF: ENH 29327 xdeepadh | |
1425 //Deallocate the plmn_list | |
1426 if(plmn_list !=NULL) | |
1427 { | |
1428 mfwFree((U8*)plmn_list,sizeof(T_MFW_PLMN_LIST)); | |
1429 plmn_list=NULL; | |
1430 } | |
1431 return; | |
1432 } | |
1433 if (result == AT_EXCT) | |
1434 { | |
1435 /* Deallocate operator list buffer */ | |
1436 if (oper_list != NULL) | |
1437 { | |
1438 mfwFree((U8*)oper_list, sizeof(T_ACI_COPS_OPDESC)*MAX_OPER); | |
1439 oper_list = NULL; | |
1440 } | |
1441 //Mar 01, 2005 REF: ENH 29327 xdeepadh | |
1442 //Deallocate the plmn_list | |
1443 if(plmn_list !=NULL) | |
1444 { | |
1445 mfwFree((U8*)plmn_list,sizeof(T_MFW_PLMN_LIST)); | |
1446 plmn_list=NULL; | |
1447 } | |
1448 return; /* wait for rAT_PlusCOPS() */ | |
1449 } | |
1450 | |
1451 if (last_ind > MAX_OPER) | |
1452 last_ind = MAX_OPER; | |
1453 | |
1454 for (i = 0; i <= last_ind; i++) | |
1455 nm_copy_plmn_list(&plmn_list->plmn[i], &oper_list[i]); | |
1456 | |
1457 /* Deallocate operator list buffer */ | |
1458 if (oper_list != NULL) | |
1459 { | |
1460 mfwFree((U8*)oper_list, sizeof(T_ACI_COPS_OPDESC)*MAX_OPER); | |
1461 oper_list = NULL; | |
1462 } | |
1463 | |
1464 plmn_list->count = i; | |
1465 nm_signal(E_NM_PLMN_LIST,plmn_list); | |
1466 //Mar 01, 2005 REF: ENH 29327 xdeepadh | |
1467 //Deallocate the plmn_list | |
1468 if(plmn_list !=NULL) | |
1469 { | |
1470 mfwFree((U8*)plmn_list,sizeof(T_MFW_PLMN_LIST)); | |
1471 plmn_list=NULL; | |
1472 } | |
1473 } | |
1474 | |
1475 | |
1476 /* | |
1477 +--------------------------------------------------------------------+ | |
1478 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1479 | STATE : code ROUTINE : nm_home_plmn | | |
1480 +--------------------------------------------------------------------+ | |
1481 | |
1482 PURPOSE : Get the home PLMN name | |
1483 | |
1484 */ | |
1485 | |
1486 void nm_home_plmn (T_MFW_NETWORK_STRUCT *hplmn) | |
1487 { | |
1488 U8 oper[6]; | |
1489 | |
1490 /* get network operator */ | |
1491 strncpy((char *)oper, (char *)mfw_IMSI, 5); | |
1492 oper[5] = 0; | |
1493 | |
1494 #ifdef NO_ASCIIZ | |
1495 sAT_PlusCOPSE(oper, | |
1496 COPS_FRMT_Numeric, | |
1497 &hplmn->network_long, | |
1498 &hplmn->network_short, | |
1499 hplmn->network_numeric); | |
1500 | |
1501 #else | |
1502 sAT_PlusCOPSE(oper, | |
1503 COPS_FRMT_Numeric, | |
1504 hplmn->network_long, | |
1505 hplmn->network_short, | |
1506 hplmn->network_numeric); | |
1507 #endif | |
1508 } | |
1509 | |
1510 | |
1511 /* | |
1512 +--------------------------------------------------------------------+ | |
1513 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1514 | STATE : code ROUTINE : nm_plmn_list | | |
1515 +--------------------------------------------------------------------+ | |
1516 | |
1517 PURPOSE : Request existing network list | |
1518 | |
1519 */ | |
1520 #ifndef NEPTUNE_BOARD | |
1521 #ifdef TI_PS_OP_OPN_TAB_ROMBASED | |
1522 int nm_plnm_list(T_MFW_NETWORK_STRUCT *plmn_list, int start, int count) | |
1523 { | |
1524 int i; | |
1525 | |
1526 /* Changes for ROM data */ | |
1527 const UBYTE *plmn_comp_entry; /* get a local pointer holder */ | |
1528 T_OPER_ENTRY oper; | |
1529 | |
1530 | |
1531 TRACE_FUNCTION("nm_plnm_list()"); | |
1532 | |
1533 /* | |
1534 PLMN_OPER_LST_SIZE_ROM is size of the PLMN operlist | |
1535 */ | |
1536 | |
1537 if (start >= PLMN_OPER_LST_SIZE_ROM) | |
1538 return 0; | |
1539 | |
1540 | |
1541 /* Changes for ROM data */ | |
1542 plmn_comp_entry = ptr_plmn_compressed; | |
1543 | |
1544 | |
1545 /* skip the first (start-1) number of plmn entries. */ | |
1546 i=0; | |
1547 while (i < start) { | |
1548 plmn_comp_entry += cmhMM_PlmnEntryLength (plmn_comp_entry); | |
1549 i+=1; | |
1550 } | |
1551 | |
1552 /* for each pointer in the list plmn_list */ | |
1553 i=0; | |
1554 do | |
1555 { | |
1556 /* Get first compressed PLMN entry */ | |
1557 cmhMM_decodePlmn (&oper, plmn_comp_entry); | |
1558 | |
1559 if (oper.longName NEQ NULL) | |
1560 { | |
1561 plmn_list[i].index = start+1; | |
1562 #ifdef NO_ASCIIZ | |
1563 sAT_PlusCOPSE((UBYTE *)oper.longName, | |
1564 COPS_FRMT_Long, | |
1565 &plmn_list[i].network_long, | |
1566 &plmn_list[i].network_short, | |
1567 plmn_list[i].network_numeric); | |
1568 #else | |
1569 sAT_PlusCOPSE((UBYTE *)oper.longName, | |
1570 COPS_FRMT_Long, | |
1571 plmn_list[i].network_long, | |
1572 plmn_list[i].network_short, | |
1573 plmn_list[i].network_numeric); | |
1574 #endif | |
1575 start++; | |
1576 } | |
1577 else | |
1578 { | |
1579 #ifdef NO_ASCIIZ | |
1580 plmn_list[i].network_long.len = 0; | |
1581 plmn_list[i].network_short.len = 0; | |
1582 plmn_list[i].network_numeric[0] = 0; | |
1583 #else | |
1584 plmn_list[i].network_long[0] = 0; | |
1585 plmn_list[i].network_short[0] = 0; | |
1586 plmn_list[i].network_numeric[0] = 0; | |
1587 #endif | |
1588 break; | |
1589 } | |
1590 | |
1591 /* Next compressed PLMN entry */ | |
1592 plmn_comp_entry += cmhMM_PlmnEntryLength (plmn_comp_entry); | |
1593 | |
1594 i+=1; | |
1595 } while (i < count); | |
1596 | |
1597 return PLMN_OPER_LST_SIZE_ROM; | |
1598 } | |
1599 | |
1600 #else | |
1601 | |
1602 int nm_plnm_list(T_MFW_NETWORK_STRUCT *plmn_list, int start, int count) | |
1603 { | |
1604 int i; | |
1605 int sum; | |
1606 | |
1607 TRACE_FUNCTION("nm_plnm_list()"); | |
1608 sum = 0; | |
1609 while (operListFixed[sum].longName != NULL) | |
1610 sum++; | |
1611 | |
1612 if (start >= sum) | |
1613 return 0; | |
1614 for (i=0; i<count; i++) | |
1615 { | |
1616 if (operListFixed[start].longName != NULL) | |
1617 { | |
1618 plmn_list[i].index = start+1; | |
1619 #ifdef NO_ASCIIZ | |
1620 sAT_PlusCOPSE((UBYTE *)operListFixed[start].longName, | |
1621 COPS_FRMT_Long, | |
1622 &plmn_list[i].network_long, | |
1623 &plmn_list[i].network_short, | |
1624 plmn_list[i].network_numeric); | |
1625 #else | |
1626 sAT_PlusCOPSE((UBYTE *)operListFixed[start].longName, | |
1627 COPS_FRMT_Long, | |
1628 plmn_list[i].network_long, | |
1629 plmn_list[i].network_short, | |
1630 plmn_list[i].network_numeric); | |
1631 #endif | |
1632 start++; | |
1633 } | |
1634 else | |
1635 { | |
1636 #ifdef NO_ASCIIZ | |
1637 plmn_list[i].network_long.len = 0; | |
1638 plmn_list[i].network_short.len = 0; | |
1639 plmn_list[i].network_numeric[0] = 0; | |
1640 #else | |
1641 plmn_list[i].network_long[0] = 0; | |
1642 plmn_list[i].network_short[0] = 0; | |
1643 plmn_list[i].network_numeric[0] = 0; | |
1644 #endif | |
1645 break; | |
1646 } | |
1647 } | |
1648 return sum; | |
1649 } | |
1650 | |
1651 #endif | |
1652 | |
1653 #else | |
1654 int nm_plnm_list(T_MFW_NETWORK_STRUCT *plmn_list, int start, int count) | |
1655 { | |
1656 int i; | |
1657 int sum; | |
1658 | |
1659 TRACE_FUNCTION("nm_plnm_list()"); | |
1660 sum = 0; | |
1661 while (operList[sum].longName != NULL) | |
1662 sum++; | |
1663 | |
1664 if (start >= sum) | |
1665 return 0; | |
1666 | |
1667 for (i=0; i<count; i++) | |
1668 { | |
1669 if (operList[start].longName != NULL) | |
1670 { | |
1671 plmn_list[i].index = start+1; | |
1672 #ifdef NO_ASCIIZ | |
1673 sAT_PlusCOPSE((UBYTE *)operList[start].longName, | |
1674 COPS_FRMT_Long, | |
1675 &plmn_list[i].network_long, | |
1676 &plmn_list[i].network_short, | |
1677 plmn_list[i].network_numeric); | |
1678 #else | |
1679 sAT_PlusCOPSE((UBYTE *)operList[start].longName, | |
1680 COPS_FRMT_Long, | |
1681 plmn_list[i].network_long, | |
1682 plmn_list[i].network_short, | |
1683 plmn_list[i].network_numeric); | |
1684 #endif | |
1685 start++; | |
1686 } | |
1687 else | |
1688 { | |
1689 #ifdef NO_ASCIIZ | |
1690 plmn_list[i].network_long.len = 0; | |
1691 plmn_list[i].network_short.len = 0; | |
1692 plmn_list[i].network_numeric[0] = 0; | |
1693 #else | |
1694 plmn_list[i].network_long[0] = 0; | |
1695 plmn_list[i].network_short[0] = 0; | |
1696 plmn_list[i].network_numeric[0] = 0; | |
1697 #endif | |
1698 break; | |
1699 } | |
1700 } | |
1701 return sum; | |
1702 } | |
1703 #endif | |
1704 /* | |
1705 +--------------------------------------------------------------------+ | |
1706 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1707 | STATE : code ROUTINE : nm_plmn_list_longnames | | |
1708 +--------------------------------------------------------------------+ | |
1709 | |
1710 PURPOSE : Request existing network list longnames. added for SPR 2635. | |
1711 | |
1712 */ | |
1713 | |
1714 #ifndef NEPTUNE_BOARD | |
1715 #ifdef TI_PS_OP_OPN_TAB_ROMBASED | |
1716 int nm_plnm_list_longnames(char**plmn_ln_list, int start, int count) | |
1717 { | |
1718 int i; | |
1719 /* Changes for ROM data */ | |
1720 const UBYTE *plmn_comp_entry; /* get a local pointer holder */ | |
1721 T_OPER_ENTRY oper; | |
1722 | |
1723 | |
1724 TRACE_FUNCTION("nm_plnm_list_longnames()"); | |
1725 | |
1726 /* | |
1727 PLMN_OPER_LST_SIZE_ROM is size of the PLMN operlist | |
1728 */ | |
1729 | |
1730 if (start >= PLMN_OPER_LST_SIZE_ROM) | |
1731 return 0; | |
1732 | |
1733 /* skip the first (start-1) number of plmn entries. */ | |
1734 i=0; | |
1735 while (i < start) { | |
1736 plmn_comp_entry += cmhMM_PlmnEntryLength (plmn_comp_entry); | |
1737 i+=1; | |
1738 } | |
1739 | |
1740 /* for each pointer in the list plmn_list */ | |
1741 i=0; | |
1742 do | |
1743 { | |
1744 /* Get first compressed PLMN entry */ | |
1745 cmhMM_decodePlmn (&oper, plmn_comp_entry); | |
1746 | |
1747 if (oper.longName NEQ NULL) | |
1748 { | |
1749 /*just set pointer to point at longname in ROM in ACI*/ | |
1750 plmn_ln_list[i] = (char*)oper.longName; | |
1751 | |
1752 start++; | |
1753 } | |
1754 else | |
1755 { | |
1756 plmn_ln_list[i] = NULL; | |
1757 break; | |
1758 } | |
1759 | |
1760 /* Next compressed PLMN entry */ | |
1761 plmn_comp_entry += cmhMM_PlmnEntryLength (plmn_comp_entry); | |
1762 | |
1763 i+=1; | |
1764 } while (i < count); | |
1765 | |
1766 return PLMN_OPER_LST_SIZE_ROM; | |
1767 } | |
1768 | |
1769 #else | |
1770 | |
1771 int nm_plnm_list_longnames(char**plmn_ln_list, int start, int count) | |
1772 { | |
1773 int i; | |
1774 int sum; | |
1775 | |
1776 TRACE_FUNCTION("nm_plnm_list_longnames()"); | |
1777 | |
1778 sum = 0; | |
1779 | |
1780 /*count the number of longnames*/ | |
1781 while (operListFixed[sum].longName != NULL) | |
1782 sum++; | |
1783 /*if we attempt read past the end of the list*/ | |
1784 if (start >= sum) | |
1785 return 0; | |
1786 | |
1787 /*for each pointer in the list*/ | |
1788 for (i=0; i<count; i++) | |
1789 { | |
1790 if (operListFixed[start].longName != NULL) | |
1791 { | |
1792 /*just set pointer to point at longname in ROM in ACI*/ | |
1793 plmn_ln_list[i] = (char*)operListFixed[start].longName; | |
1794 | |
1795 start++; | |
1796 } | |
1797 else | |
1798 { | |
1799 plmn_ln_list[i] = NULL; | |
1800 break; | |
1801 } | |
1802 } | |
1803 return sum; | |
1804 } | |
1805 #endif | |
1806 | |
1807 #else | |
1808 int nm_plnm_list_longnames(char**plmn_ln_list, int start, int count) | |
1809 { | |
1810 int i; | |
1811 int sum; | |
1812 | |
1813 TRACE_FUNCTION("nm_plnm_list_longnames()"); | |
1814 | |
1815 sum = 0; | |
1816 | |
1817 /*count the number of longnames*/ | |
1818 while (operList[sum].longName != NULL) | |
1819 sum++; | |
1820 /*if we attempt read past the end of the list*/ | |
1821 if (start >= sum) | |
1822 return 0; | |
1823 | |
1824 /*for each pointer in the list*/ | |
1825 for (i=0; i<count; i++) | |
1826 { | |
1827 if (operList[start].longName != NULL) | |
1828 { | |
1829 /*just set pointer to point at longname in ROM in ACI*/ | |
1830 plmn_ln_list[i] = (char*)operList[start].longName; | |
1831 | |
1832 start++; | |
1833 } | |
1834 else | |
1835 { | |
1836 plmn_ln_list[i] = NULL; | |
1837 break; | |
1838 } | |
1839 } | |
1840 return sum; | |
1841 } | |
1842 #endif | |
1843 | |
1844 /* | |
1845 +--------------------------------------------------------------------+ | |
1846 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1847 | STATE : code ROUTINE : nm_select_plmn | | |
1848 +--------------------------------------------------------------------+ | |
1849 | |
1850 PURPOSE : Select PLMN for registration | |
1851 | |
1852 */ | |
1853 | |
1854 void nm_select_plmn (U8 *network) | |
1855 { | |
1856 T_ACI_RETURN result; | |
1857 TRACE_FUNCTION("nm_select_plmn()"); | |
1858 | |
1859 result = sAT_PercentNRG(CMD_SRC_LCL, | |
1860 NRG_RGMD_Manual, | |
1861 NRG_SVMD_Full, | |
1862 NRG_FRMT_Numeric, | |
1863 (char *) network); | |
1864 result = AT_FAIL; | |
1865 if (result != AT_EXCT) | |
1866 { | |
1867 TRACE_ERROR("sAT_PercentNRG error"); | |
1868 //Sep 23, 2004 REF: CRR 24562 xvilliva | |
1869 //If AT_FAIL is returned, we query for the exact error | |
1870 //and set a variable accordingly. | |
1871 if(result == AT_FAIL) | |
1872 { | |
1873 ULONG err; | |
1874 | |
1875 err = qAT_ErrDesc(); | |
1876 switch (ACI_ERR_DESC_CLASS( err )) | |
1877 { | |
1878 case ACI_ERR_CLASS_Cme: | |
1879 if (ACI_ERR_DESC_NR( err ) == CME_ERR_OpNotAllow) | |
1880 { | |
1881 g_ensErr = 1; | |
1882 } | |
1883 break; | |
1884 } | |
1885 } | |
1886 } | |
1887 } | |
1888 | |
1889 | |
1890 /* | |
1891 +--------------------------------------------------------------------+ | |
1892 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1893 | STATE : code ROUTINE : nm_spn_cnf | | |
1894 +--------------------------------------------------------------------+ | |
1895 | |
1896 PURPOSE : Notify about service provider name | |
1897 | |
1898 */ | |
1899 /*a0393213 lint warnings removal - type of error changed from SHORT to USHORT*/ | |
1900 void nm_spn_cnf (USHORT error, T_EF_SPN *efspn) | |
1901 { | |
1902 U8 i; | |
1903 | |
1904 USHORT simErr; | |
1905 TRACE_FUNCTION("nm_spn_cnf()"); | |
1906 | |
1907 | |
1908 #ifdef FF_2TO1_PS | |
1909 simErr = CAUSE_SIM_NO_ERROR; | |
1910 #else | |
1911 simErr = SIM_NO_ERROR; | |
1912 #endif | |
1913 | |
1914 #ifdef NO_ASCIIZ | |
1915 memset (service_provider_name.data, 0, sizeof(service_provider_name.data)); | |
1916 service_provider_name.len = 0; | |
1917 | |
1918 if (error EQ simErr) | |
1919 { | |
1920 for (i=0; (efspn->service_provider[i] != 0xFF) && (i < SP_NAME); i++) | |
1921 service_provider_name.data[i] = efspn->service_provider[i]; | |
1922 | |
1923 service_provider_name.len = i; | |
1924 } | |
1925 #else | |
1926 memset (service_provider_name, 0, sizeof(service_provider_name)); | |
1927 | |
1928 if (error EQ simErr) | |
1929 { | |
1930 for (i=0; (efspn->service_provider[i] != 0xFF) && (i < SP_NAME-1); i++) | |
1931 service_provider_name[i] = efspn->service_provider[i]; | |
1932 } | |
1933 #endif | |
1934 display_condition = efspn->display_condition & 0x01; | |
1935 | |
1936 #ifdef SIM_TOOLKIT | |
1937 if (sat_update) | |
1938 { | |
1939 sat_update = FALSE; | |
1940 satUpdateFiles ( TRUE, SIM_SPN ); | |
1941 } | |
1942 #endif | |
1943 } | |
1944 | |
1945 #ifdef SIM_TOOLKIT | |
1946 /* | |
1947 +---------------------------------------------------------------------+ | |
1948 | PROJECT : MMI-Framework (8417) MODULE : MFW_SIM | | |
1949 | STATE : code ROUTINE : nm_sat_file_update | | |
1950 +---------------------------------------------------------------------+ | |
1951 | |
1952 PURPOSE : SIM file change indication | |
1953 | |
1954 */ | |
1955 | |
1956 void nm_sat_file_update(USHORT dataId) | |
1957 { | |
1958 /*a0393213 compiler warnings removal - removed serv_stat*/ | |
1959 | |
1960 TRACE_FUNCTION("nm_sat_file_update()"); | |
1961 | |
1962 switch (dataId) | |
1963 { | |
1964 case SIM_SPN: | |
1965 if (sim_serv_table_check(17) NEQ NO_ALLOCATED) | |
1966 { | |
1967 sat_update = TRUE; | |
1968 sim_read_sim(SIM_SPN, NOT_PRESENT_8BIT, 17); | |
1969 } | |
1970 else | |
1971 satUpdateFiles ( TRUE, SIM_SPN ); | |
1972 break; | |
1973 default: | |
1974 break; | |
1975 } | |
1976 } | |
1977 #endif | |
1978 | |
1979 | |
1980 /* | |
1981 +--------------------------------------------------------------------+ | |
1982 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
1983 | STATE : code ROUTINE : nm_deregistration | | |
1984 +--------------------------------------------------------------------+ | |
1985 | |
1986 PURPOSE : Delete registration | |
1987 | |
1988 */ | |
1989 | |
1990 void nm_deregistration (void) | |
1991 { | |
1992 TRACE_FUNCTION ("nm_deregistration()"); | |
1993 | |
1994 if (sAT_PlusCFUN(CMD_SRC_LCL,CFUN_FUN_Minimum,CFUN_RST_NotPresent) | |
1995 != AT_EXCT) | |
1996 { | |
1997 TRACE_ERROR("sAT_PlusCFUN error"); | |
1998 } | |
1999 } | |
2000 | |
2001 | |
2002 /* | |
2003 +-----------------------------------------------------------------------+ | |
2004 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2005 | STATE : code ROUTINE : nm_ok_deregistration | | |
2006 +-----------------------------------------------------------------------+ | |
2007 | |
2008 PURPOSE : de-registration successful | |
2009 | |
2010 */ | |
2011 | |
2012 void nm_ok_deregistration (void) | |
2013 { | |
2014 TRACE_FUNCTION ("nm_ok_deregistration()"); | |
2015 nm_signal(E_NM_DEREGISTRATION, 0); | |
2016 } | |
2017 | |
2018 | |
2019 /* | |
2020 +--------------------------------------------------------------------+ | |
2021 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2022 | STATE : code ROUTINE : nm_ok_cops | | |
2023 +--------------------------------------------------------------------+ | |
2024 | |
2025 PURPOSE : Successful end of operator selection | |
2026 | |
2027 */ | |
2028 | |
2029 void nm_ok_cops (void) | |
2030 { | |
2031 TRACE_FUNCTION("nm_ok_cops()"); | |
2032 | |
2033 nm_search_reg_status(); | |
2034 reg_flag = 0; | |
2035 } | |
2036 | |
2037 | |
2038 /* | |
2039 +--------------------------------------------------------------------+ | |
2040 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2041 | STATE : code ROUTINE : nm_ok_cops | | |
2042 +--------------------------------------------------------------------+ | |
2043 | |
2044 PURPOSE : Successful selection of band | |
2045 SPR919 - SH - added this function. | |
2046 */ | |
2047 | |
2048 void nm_ok_band (void) | |
2049 { | |
2050 TRACE_FUNCTION("nm_ok_band()"); | |
2051 | |
2052 nm_signal(E_NM_BAND, 0); | |
2053 } | |
2054 | |
2055 | |
2056 | |
2057 /* | |
2058 +--------------------------------------------------------------------+ | |
2059 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2060 | STATE : code ROUTINE : nm_error_cops | | |
2061 +--------------------------------------------------------------------+ | |
2062 | |
2063 PURPOSE : error end of operator selection | |
2064 | |
2065 */ | |
2066 //x0pleela 30 May, 2007 DR: OMAPS00133201 | |
2067 //Passing T_ACI_CME_ERR as parameter | |
2068 void nm_error_cops ( T_ACI_CME_ERR err) | |
2069 { | |
2070 TRACE_FUNCTION("nm_error_cops()"); | |
2071 | |
2072 //x0pleela 30 May, 2007 DR: OMAPS00133201 | |
2073 if( err == CME_ERR_AbortedByNetwork ) | |
2074 nm_signal(E_NM_ABORT_NETWORK, 0); | |
2075 else | |
2076 nm_search_reg_status(); | |
2077 reg_flag = 0; | |
2078 } | |
2079 | |
2080 | |
2081 /* | |
2082 +--------------------------------------------------------------------+ | |
2083 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2084 | STATE : code ROUTINE : nm_reg_status | | |
2085 +--------------------------------------------------------------------+ | |
2086 | |
2087 PURPOSE : Check the registration status | |
2088 | |
2089 */ | |
2090 | |
2091 T_MFW nm_reg_status (void) | |
2092 { | |
2093 TRACE_FUNCTION("nm_reg_status()"); | |
2094 | |
2095 return reg_stat; | |
2096 } | |
2097 | |
2098 | |
2099 /* | |
2100 +--------------------------------------------------------------------+ | |
2101 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2102 | STATE : code ROUTINE : rAT_PlusCOPS | | |
2103 +--------------------------------------------------------------------+ | |
2104 | |
2105 PURPOSE : Notify about available PLMN list | |
2106 NOTE : oper_list defines as char * | |
2107 Every operator (PLMN) uses 3 bytes | |
2108 | |
2109 // July 14, 2005 REF: CRR 31916 x0021334 | |
2110 // The functionality in rAT_PlusCOPS has been moved to new function 'nm_Plus_Percent_COPS()' | |
2111 which is common for rAT_PercentCOPS as well. | |
2112 | |
2113 //SPR#0777 - DS - Added check to make sure last_ind is valid. If invalid set to 0. | |
2114 // - Changed check to make last_ind equal to MAX_OPER-1 if last_ind is greater than MAX_OPER. | |
2115 // - Changed <= to < in nm_copy_plmn_list for loop. | |
2116 | |
2117 */ | |
2118 | |
2119 void rAT_PlusCOPS (S16 last_ind, T_ACI_COPS_OPDESC *operLst) | |
2120 { | |
2121 TRACE_FUNCTION ("rAT_PlusCOPS()"); | |
2122 | |
2123 nm_Plus_Percent_COPS(last_ind, operLst); | |
2124 } | |
2125 | |
2126 | |
2127 /* | |
2128 +--------------------------------------------------------------------+ | |
2129 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2130 | STATE : code ROUTINE : rAT_PercentCOPS | | |
2131 +--------------------------------------------------------------------+ | |
2132 | |
2133 PURPOSE : Notify about available PLMN list. Call is made to nm_Plus_Percent_COPS(). | |
2134 | |
2135 // July 14, 2005 REF: CRR 31916 x0021334 | |
2136 // New function 'rAT_PercentCOPS()' implemented. | |
2137 | |
2138 */ | |
2139 | |
2140 void rAT_PercentCOPS (S16 last_ind, T_ACI_COPS_OPDESC *operLst) | |
2141 { | |
2142 TRACE_FUNCTION ("rAT_PercentCOPS()"); | |
2143 | |
2144 nm_Plus_Percent_COPS(last_ind, operLst); | |
2145 } | |
2146 | |
2147 | |
2148 /* | |
2149 +--------------------------------------------------------------------+ | |
2150 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2151 | STATE : code ROUTINE : nm_Plus_Percent_COPS | | |
2152 +--------------------------------------------------------------------+ | |
2153 | |
2154 PURPOSE : Notify about available PLMN list. Common function called from rAT_PlusCOPS | |
2155 and rAT_PercentCOPS | |
2156 | |
2157 // July 14, 2005 REF: CRR 31916 x0021334 | |
2158 // New function 'nm_Plus_Percent_COPS()' implemented. | |
2159 | |
2160 */ | |
2161 | |
2162 void nm_Plus_Percent_COPS (S16 last_ind, T_ACI_COPS_OPDESC *operLst) | |
2163 { | |
2164 int i; | |
2165 //Mar 01, 2005 REF: ENH 29327 xdeepadh | |
2166 //Dynamically allocate the plmn_list | |
2167 T_MFW_PLMN_LIST *plmn_list; | |
2168 /* Aug 09, 2007 REF: OMAPS00140507 x0045876 | |
2169 Added patch given by Dong Feng */ | |
2170 char longName[MAX_ALPHA_OPER_LEN] = { '\0' }; | |
2171 char shrtName[MAX_ALPHA_OPER_LEN] = { '\0' }; | |
2172 plmn_list=(T_MFW_PLMN_LIST*)mfwAlloc(sizeof(T_MFW_PLMN_LIST)); | |
2173 if(plmn_list==NULL) | |
2174 { | |
2175 TRACE_EVENT("plmn_list malloc failed"); | |
2176 return; | |
2177 } | |
2178 TRACE_FUNCTION ("nm_Plus_Percent_COPS()"); | |
2179 | |
2180 memset(plmn_list, 0, sizeof(T_MFW_PLMN_LIST)); | |
2181 | |
2182 if (operLst[0].status == COPS_STAT_Unknown) | |
2183 { | |
2184 nm_signal(E_NM_PLMN_LIST,plmn_list); | |
2185 //Mar 01, 2005 REF: ENH 29327 xdeepadh | |
2186 //Deallocate the plmn_list | |
2187 if(plmn_list !=NULL) | |
2188 { | |
2189 mfwFree((U8*)plmn_list,sizeof(T_MFW_PLMN_LIST)); | |
2190 plmn_list = NULL; | |
2191 } | |
2192 return; | |
2193 } | |
2194 /***************************Go-lite Optimization changes Start***********************/ | |
2195 // Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
2196 TRACE_EVENT_P1("rAT_PlusCOPS: last_ind: %d",last_ind); | |
2197 /***************************Go-lite Optimization changes END***********************/ | |
2198 if (last_ind > 128) //Invalid index passed in. | |
2199 { | |
2200 last_ind = -1; | |
2201 } | |
2202 else | |
2203 { | |
2204 if (last_ind >= MAX_OPER) //Index is larger than max number of operators. | |
2205 { | |
2206 last_ind = MAX_OPER-1; | |
2207 } | |
2208 } | |
2209 | |
2210 | |
2211 //DS 27/5/2002 - changed <= to < | |
2212 for (i = 0; i <= last_ind; i++) /* operLst == oper_list !! */ | |
2213 { | |
2214 nm_copy_plmn_list(&plmn_list->plmn[i], &operLst[i]); | |
2215 } | |
2216 | |
2217 | |
2218 /* BEGIN: Aug 09, 2007 REF: OMAPS00140507 x0045876 | |
2219 Added patch given by Dong Feng */ | |
2220 for(i=0; i < MAX_OPER; i++) | |
2221 { | |
2222 if (operLst[i].status < 0) | |
2223 { | |
2224 break; | |
2225 } | |
2226 if (operLst[i].pnn) | |
2227 { | |
2228 if (operLst[i].long_len) | |
2229 { | |
2230 switch (operLst[i].long_ext_dcs>>4 & 0x07) | |
2231 { | |
2232 case 0x00: /* GSM default alphabet */ | |
2233 utl_cvtPnn7To8((UBYTE *)operLst[i].longOper, | |
2234 operLst[i].long_len, | |
2235 operLst[i].long_ext_dcs, | |
2236 (UBYTE *)longName); | |
2237 #ifdef NO_ASCIIZ | |
2238 plmn_list->plmn[i].network_long.len = 0; | |
2239 plmn_list->plmn[i].network_short.len = 0; | |
2240 | |
2241 if (operLst->longOper) | |
2242 { | |
2243 plmn_list->plmn[i].network_long.len = MINIMUM(LONG_NAME-1, strlen((char *)longName)); | |
2244 memcpy (plmn_list->plmn[i].network_long.data, longName, plmn_list->plmn[i].network_long.len); | |
2245 plmn_list->plmn[i].network_long.data[plmn_list->plmn[i].network_long.len] = '\0'; | |
2246 plmn_list->plmn[i].network_long.dcs = MFW_ASCII; | |
2247 } | |
2248 #else | |
2249 memset(plmn_list->plmn[i].network_long, 0, LONG_NAME); | |
2250 | |
2251 if (operLst->longOper) | |
2252 strncpy((char *)plmn_list->plmn[i].network_long, (char *)longName, LONG_NAME-1); | |
2253 #endif | |
2254 break; | |
2255 case 0x01: /* UCS2 */ | |
2256 TRACE_ERROR ("Unhandled UCS2 in PNN entry"); | |
2257 break; | |
2258 default: | |
2259 TRACE_ERROR ("Unknown DCS in PNN entry"); | |
2260 break; | |
2261 } | |
2262 } | |
2263 if (operLst[i].shrt_len) | |
2264 { | |
2265 switch (operLst[i].shrt_ext_dcs>>4 & 0x07) | |
2266 { | |
2267 case 0x00: /* GSM default alphabet */ | |
2268 utl_cvtPnn7To8((UBYTE *)operLst[i].shortOper, | |
2269 operLst[i].shrt_len, | |
2270 operLst[i].shrt_ext_dcs, | |
2271 (UBYTE *)shrtName); | |
2272 | |
2273 #ifdef NO_ASCIIZ | |
2274 plmn_list->plmn[i].network_short.len = 0; | |
2275 | |
2276 if (operLst->shortOper) | |
2277 { | |
2278 plmn_list->plmn[i].network_short.len = MINIMUM(SHORT_NAME-1, strlen((char *)shrtName)); | |
2279 memcpy (plmn_list->plmn[i].network_short.data, shrtName, plmn_list->plmn[i].network_short.len); | |
2280 plmn_list->plmn[i].network_short.data[plmn_list->plmn[i].network_short.len] = '\0'; | |
2281 plmn_list->plmn[i].network_short.dcs = MFW_ASCII; | |
2282 } | |
2283 #else | |
2284 memset(plmn_list->plmn[i].network_short, 0, SHORT_NAME); | |
2285 | |
2286 if (operLst->shortOper) | |
2287 strncpy((char *)plmn_list->plmn[i].network_short, (char *)shrtName, SHORT_NAME-1); | |
2288 #endif | |
2289 break; | |
2290 case 0x01: /* UCS2 */ | |
2291 TRACE_ERROR ("ERROR: Unhandled UCS2"); | |
2292 break; | |
2293 default: | |
2294 TRACE_ERROR ("ERROR: Unknown DCS"); | |
2295 break; | |
2296 } | |
2297 } | |
2298 } | |
2299 } | |
2300 /* END: Aug 09, 2007 REF: OMAPS00140507 x0045876 | |
2301 Added patch given by Dong Feng */ | |
2302 /***************************Go-lite Optimization changes Start***********************/ | |
2303 // Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
2304 TRACE_EVENT_P1("rAT_PlusCOPS: Loop i val is %d",i); | |
2305 /***************************Go-lite Optimization changes END***********************/ | |
2306 plmn_list->count = i; | |
2307 | |
2308 nm_signal(E_NM_PLMN_LIST,plmn_list); | |
2309 //Mar 01, 2005 REF: ENH 29327 xdeepadh | |
2310 //Deallocate the plmn_list | |
2311 if(plmn_list !=NULL) | |
2312 { | |
2313 mfwFree((U8*)plmn_list,sizeof(T_MFW_PLMN_LIST)); | |
2314 plmn_list =NULL; | |
2315 } | |
2316 } | |
2317 | |
2318 | |
2319 | |
2320 | |
2321 /* | |
2322 +----------------------------------------------------------------------+ | |
2323 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2324 | STATE : code ROUTINE : nm_search_reg_status | | |
2325 +----------------------------------------------------------------------+ | |
2326 | |
2327 PURPOSE : Change registration status | |
2328 | |
2329 */ | |
2330 | |
2331 void nm_search_reg_status(void) | |
2332 { | |
2333 T_ACI_NRG_RGMD regMode; | |
2334 T_ACI_NRG_SVMD srvMode; | |
2335 T_ACI_NRG_FRMT oprFrmt; | |
2336 T_ACI_NRG_SVMD srvStat; | |
2337 U8 oper[LONG_NAME]; | |
2338 | |
2339 qAT_PercentNRG(CMD_SRC_LCL, | |
2340 ®Mode, | |
2341 &srvMode, | |
2342 &oprFrmt, | |
2343 &srvStat, | |
2344 (char *)oper); | |
2345 | |
2346 if (srvStat == NRG_SVMD_Limited) | |
2347 { | |
2348 reg_stat = MFW_LIMITED_SERVICE; | |
2349 nm_signal(E_NM_LIMITED_SERVICE,NULL); | |
2350 } | |
2351 if (srvStat == NRG_SVMD_NoSrv) | |
2352 { | |
2353 reg_stat = MFW_NO_SERVICE; | |
2354 nm_signal(E_NM_NO_SERVICE,NULL); | |
2355 } | |
2356 } | |
2357 | |
2358 | |
2359 /* | |
2360 +--------------------------------------------------------------------+ | |
2361 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2362 | STATE : code ROUTINE : rAT_PlusCREG | | |
2363 +--------------------------------------------------------------------+ | |
2364 | |
2365 PURPOSE : Change registration status | |
2366 | |
2367 */ | |
2368 | |
2369 void rAT_PlusCREG (T_ACI_CREG_STAT stat, | |
2370 USHORT lac, | |
2371 USHORT cid) | |
2372 { | |
2373 T_MFW_NETWORK_STRUCT plmn_ident; | |
2374 T_MFW_CELL_STRUCT cell; | |
2375 T_ACI_NRG_RGMD regMode; | |
2376 T_ACI_NRG_SVMD srvMode; | |
2377 T_ACI_NRG_FRMT oprFrmt; | |
2378 T_ACI_NRG_SVMD srvStat; | |
2379 USHORT cause; //Added for OMAPS00134509/ASTec32515 | |
2380 U8 oper[LONG_NAME]; | |
2381 | |
2382 TRACE_FUNCTION("rAT_PlusCREG()"); | |
2383 | |
2384 switch (stat) | |
2385 { | |
2386 case CREG_STAT_Reg: | |
2387 case CREG_STAT_Roam: | |
2388 reg_stat = MFW_FULL_SERVICE; | |
2389 qAT_PercentNRG(CMD_SRC_LCL, | |
2390 ®Mode, | |
2391 &srvMode, | |
2392 &oprFrmt, | |
2393 &srvStat, | |
2394 (char *)oper); | |
2395 #ifdef NO_ASCIIZ | |
2396 sAT_PlusCOPSE(oper,(U8) oprFrmt,&plmn_ident.network_long, | |
2397 &plmn_ident.network_short, | |
2398 plmn_ident.network_numeric); | |
2399 memcpy(plmn_ident.service_provider.data, | |
2400 service_provider_name.data, | |
2401 service_provider_name.len); | |
2402 plmn_ident.service_provider.len = service_provider_name.len; | |
2403 #else | |
2404 sAT_PlusCOPSE(oper,(U8) oprFrmt,plmn_ident.network_long, | |
2405 plmn_ident.network_short, | |
2406 plmn_ident.network_numeric); | |
2407 strcpy((char *) plmn_ident.service_provider, | |
2408 (char *) service_provider_name); | |
2409 #endif | |
2410 plmn_ident.display_condition = display_condition & 0x01; | |
2411 if (stat == CREG_STAT_Reg) | |
2412 plmn_ident.roaming_indicator = 0; | |
2413 if (stat == CREG_STAT_Roam) | |
2414 plmn_ident.roaming_indicator = 1; | |
2415 | |
2416 //x0pleela 08 Feb, 2006 ER: OMAPS00065203 | |
2417 nm_get_COPN( &plmn_ident ); | |
2418 | |
2419 nm_signal(E_NM_FULL_SERVICE,&plmn_ident); | |
2420 | |
2421 /* Cell ReSelection Code */ | |
2422 cell.ci = cid; | |
2423 cell.lid = lac; | |
2424 nm_signal(E_NM_CELL_SELECT,&cell); | |
2425 break; | |
2426 | |
2427 case CREG_STAT_NoSearch: | |
2428 case CREG_STAT_NotPresent: | |
2429 if (!reg_flag) | |
2430 nm_search_reg_status(); | |
2431 break; | |
2432 case CREG_STAT_Search: | |
2433 if (reg_flag) | |
2434 { | |
2435 reg_stat = MFW_SEARCH_NETWORK; | |
2436 nm_signal(E_NM_SEARCH_NETWORK,NULL); | |
2437 } | |
2438 else | |
2439 nm_search_reg_status(); | |
2440 break; | |
2441 //Sep 18,2006 DRT: OMAPS0090268 x0061088(Prachi) | |
2442 //Description : added case for Denied services,which send nm_signal. | |
2443 case CREG_STAT_Denied: | |
2444 //TISH, patch for ASTec32515/OMAPS00134509 | |
2445 //start | |
2446 qAT_PlusCEER( CMD_SRC_LCL, &cause); | |
2447 if (cause EQ 0x8488) // If SIM is rejected in authentification | |
2448 sim_invalid_ind(); | |
2449 else | |
2450 //end | |
2451 nm_signal(E_NM_FORBIDDEN_NETWORK, NULL); | |
2452 break; | |
2453 default: | |
2454 nm_search_reg_status(); | |
2455 break; | |
2456 } | |
2457 } | |
2458 | |
2459 | |
2460 /* | |
2461 +--------------------------------------------------------------------+ | |
2462 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2463 | STATE : code ROUTINE : nm_abort_avail_plmn| | |
2464 +--------------------------------------------------------------------+ | |
2465 | |
2466 PURPOSE : Change registration status | |
2467 | |
2468 */ | |
2469 | |
2470 void nm_abort_avail_plmn(void) | |
2471 { | |
2472 sAT_Abort(CMD_SRC_LCL, AT_CMD_COPS); | |
2473 } | |
2474 | |
2475 /* | |
2476 +--------------------------------------------------------------------+ | |
2477 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2478 | STATE : code ROUTINE : nm_nitz_info_ind | | |
2479 +--------------------------------------------------------------------+ | |
2480 | |
2481 PURPOSE : NITZ information indication | |
2482 | |
2483 */ | |
2484 | |
2485 #ifdef FF_2TO1_PS | |
2486 void nm_nitz_info_ind(T_MMREG_INFO_IND * mmr_info_ind) | |
2487 | |
2488 | |
2489 { | |
2490 UBYTE flag; | |
2491 | |
2492 TRACE_FUNCTION("nm_nitz_info_ind() "); | |
2493 | |
2494 flag = 0; | |
2495 | |
2496 /* BEGIN ADD: SUMIT: REQ : aligning to 5.x SAP definitions */ | |
2497 #ifdef NEPTUNE_BOARD | |
2498 | |
2499 /* copy country code and network code */ | |
2500 memset (net_ind.mcc, 0, PS_SIZE_MCC); | |
2501 memset (net_ind.mnc, 0, PS_SIZE_MNC_MAX); | |
2502 if (mmr_info_ind->v_plmn_id EQ TRUE) | |
2503 { | |
2504 flag = 1; | |
2505 memcpy (net_ind.mcc, mmr_info_ind->plmn_id.mcc, PS_SIZE_MCC); | |
2506 memcpy (net_ind.mnc, mmr_info_ind->plmn_id.mnc, PS_SIZE_MNC_MAX); | |
2507 } | |
2508 | |
2509 /* copy long name */ | |
2510 memset(&net_ind.long_name, 0, sizeof(T_MFW_NET_NAME)); | |
2511 | |
2512 if (mmr_info_ind->v_full_net_name EQ TRUE) | |
2513 { | |
2514 flag = 1; | |
2515 net_ind.long_name.dcs = mmr_info_ind->full_net_name.cs; | |
2516 net_ind.long_name.add_ci = mmr_info_ind->full_net_name.add_ci; | |
2517 net_ind.long_name.num_spare = mmr_info_ind->full_net_name.num_spare; | |
2518 net_ind.long_name.len = MINIMUM (MMREG_MAX_TEXT_LEN, mmr_info_ind->full_net_name.c_text); | |
2519 memcpy (net_ind.long_name.data, | |
2520 mmr_info_ind->full_net_name.text, | |
2521 net_ind.long_name.len); | |
2522 } | |
2523 | |
2524 /* copy short name */ | |
2525 memset(&net_ind.short_name, 0, sizeof(T_MFW_NET_NAME)); | |
2526 if (mmr_info_ind->v_short_net_name EQ TRUE) | |
2527 { | |
2528 flag = 1; | |
2529 net_ind.short_name.dcs = mmr_info_ind->short_net_name.cs; | |
2530 net_ind.short_name.add_ci = mmr_info_ind->short_net_name.add_ci; | |
2531 net_ind.short_name.num_spare = mmr_info_ind->short_net_name.num_spare; | |
2532 net_ind.short_name.len = MINIMUM (MMREG_MAX_TEXT_LEN, mmr_info_ind->short_net_name.c_text); | |
2533 memcpy (net_ind.short_name.data, | |
2534 mmr_info_ind->short_net_name.text, | |
2535 net_ind.short_name.len); | |
2536 } | |
2537 | |
2538 if (flag) | |
2539 nm_signal(E_MFW_NET_IND, &net_ind); | |
2540 | |
2541 flag = 0; | |
2542 memset(&tim_ind, 0, sizeof(T_MFW_TIME_IND)); | |
2543 /* copy time */ | |
2544 if (mmr_info_ind->v_universal_time EQ TRUE AND | |
2545 mmr_info_ind->v_local_time_zone EQ TRUE ) | |
2546 { | |
2547 flag = 1; | |
2548 tim_ind.timezone = mmr_info_ind->local_time_zone.time_zone; | |
2549 tim_ind.year = (mmr_info_ind->universal_time.year); | |
2550 tim_ind.month = (mmr_info_ind->universal_time.month); | |
2551 tim_ind.day = (mmr_info_ind->universal_time.day); | |
2552 tim_ind.hour = (mmr_info_ind->universal_time.hour); | |
2553 tim_ind.minute =(mmr_info_ind->universal_time.minute); | |
2554 tim_ind.second = (mmr_info_ind->universal_time.second ); | |
2555 } | |
2556 else if (mmr_info_ind->v_local_time_zone EQ TRUE AND | |
2557 mmr_info_ind->v_universal_time NEQ TRUE ) | |
2558 { | |
2559 flag = 1; | |
2560 tim_ind.timezone = mmr_info_ind->local_time_zone.time_zone; | |
2561 } | |
2562 | |
2563 #else | |
2564 /* END ADD: Sumit */ | |
2565 | |
2566 //Apr 13, 2007 DRT:OMAPS00122739 x0066814(Geetha) | |
2567 #if(0) | |
2568 /* copy country code and network code */ | |
2569 memset (net_ind.mcc, 0, PS_SIZE_MCC); | |
2570 memset (net_ind.mnc, 0, PS_SIZE_MNC_MAX); | |
2571 if (mmr_info_ind->plmn.plmn_presence EQ TRUE) | |
2572 { | |
2573 flag = 1; | |
2574 memcpy (net_ind.mcc, mmr_info_ind->plmn.plmn_id.mcc, PS_SIZE_MCC); | |
2575 memcpy (net_ind.mnc, mmr_info_ind->plmn.plmn_id.mnc, PS_SIZE_MNC_MAX); | |
2576 } | |
2577 | |
2578 /* copy long name */ | |
2579 memset(&net_ind.long_name, 0, sizeof(T_MFW_NET_NAME)); | |
2580 if (mmr_info_ind->full_net_name.v_name EQ TRUE) | |
2581 { | |
2582 flag = 1; | |
2583 net_ind.long_name.dcs = mmr_info_ind->full_net_name.cs; | |
2584 net_ind.long_name.add_ci = mmr_info_ind->full_net_name.add_ci; | |
2585 net_ind.long_name.num_spare = mmr_info_ind->full_net_name.num_spare; | |
2586 net_ind.long_name.len = MINIMUM (MMREG_MAX_TEXT_LEN, mmr_info_ind->full_net_name.c_text); | |
2587 memcpy (net_ind.long_name.data, | |
2588 mmr_info_ind->full_net_name.text, | |
2589 net_ind.long_name.len); | |
2590 } | |
2591 | |
2592 /* copy short name */ | |
2593 memset(&net_ind.short_name, 0, sizeof(T_MFW_NET_NAME)); | |
2594 if (mmr_info_ind->short_net_name.v_name EQ TRUE) | |
2595 { | |
2596 flag = 1; | |
2597 net_ind.short_name.dcs = mmr_info_ind->short_net_name.cs; | |
2598 net_ind.short_name.add_ci = mmr_info_ind->short_net_name.add_ci; | |
2599 net_ind.short_name.num_spare = mmr_info_ind->short_net_name.num_spare; | |
2600 net_ind.short_name.len = MINIMUM (MMREG_MAX_TEXT_LEN, mmr_info_ind->short_net_name.c_text); | |
2601 memcpy (net_ind.short_name.data, | |
2602 mmr_info_ind->short_net_name.text, | |
2603 net_ind.short_name.len); | |
2604 } | |
2605 | |
2606 if (flag) | |
2607 nm_signal(E_MFW_NET_IND, &net_ind); | |
2608 #endif | |
2609 flag = 0; | |
2610 memset(&tim_ind, 0, sizeof(T_MFW_TIME_IND)); | |
2611 /* copy time */ | |
2612 if (mmr_info_ind->net_time_zone.v_time_zone EQ TRUE AND | |
2613 mmr_info_ind->net_time.v_time EQ TRUE ) | |
2614 { | |
2615 flag = 1; | |
2616 tim_ind.timezone = mmr_info_ind->net_time_zone.time_zone; | |
2617 tim_ind.year = ((mmr_info_ind->net_time.year[0]-'0') * 10 + (mmr_info_ind->net_time.year[1]-'0') ); | |
2618 tim_ind.month = ((mmr_info_ind->net_time.month[0]-'0') * 10 + (mmr_info_ind->net_time.month[1]-'0') ); | |
2619 tim_ind.day = ((mmr_info_ind->net_time.day[0]-'0') * 10 + (mmr_info_ind->net_time.day[1]-'0') ); | |
2620 tim_ind.hour = ((mmr_info_ind->net_time.hour[0]-'0') * 10 + (mmr_info_ind->net_time.hour[1]-'0') ); | |
2621 tim_ind.minute = ((mmr_info_ind->net_time.minute[0]-'0') * 10 + (mmr_info_ind->net_time.minute[1]-'0') ); | |
2622 tim_ind.second = ((mmr_info_ind->net_time.second[0]-'0') * 10 + (mmr_info_ind->net_time.second[1]-'0') ); | |
2623 } | |
2624 else if (mmr_info_ind->net_time_zone.v_time_zone EQ TRUE AND | |
2625 mmr_info_ind->net_time.v_time NEQ TRUE ) | |
2626 { | |
2627 flag = 1; | |
2628 tim_ind.timezone = mmr_info_ind->net_time_zone.time_zone; | |
2629 } | |
2630 /*BEGIN ADD: Neptune */ | |
2631 #endif | |
2632 /*END ADD: Neptune */ | |
2633 if (flag) | |
2634 nm_signal(E_MFW_TIME_IND, &tim_ind); | |
2635 } | |
2636 #else | |
2637 void nm_nitz_info_ind(T_MMR_INFO_IND * mmr_info_ind) | |
2638 { | |
2639 UBYTE flag; | |
2640 | |
2641 TRACE_FUNCTION("nm_nitz_info_ind() "); | |
2642 //Apr 13, 2007 DRT:OMAPS00122739 x0066814(Geetha) | |
2643 #if(0) | |
2644 flag = 0; | |
2645 /* copy country code and network code */ | |
2646 memset (net_ind.mcc, 0, SIZE_MCC); | |
2647 memset (net_ind.mnc, 0, SIZE_MNC); | |
2648 if (mmr_info_ind->plmn.v_plmn EQ TRUE) | |
2649 { | |
2650 flag = 1; | |
2651 memcpy (net_ind.mcc, mmr_info_ind->plmn.mcc, SIZE_MCC); | |
2652 memcpy (net_ind.mnc, mmr_info_ind->plmn.mnc, SIZE_MNC); | |
2653 } | |
2654 | |
2655 /* copy long name */ | |
2656 memset(&net_ind.long_name, 0, sizeof(T_MFW_NET_NAME)); | |
2657 if (mmr_info_ind->full_name.v_name EQ TRUE) | |
2658 { | |
2659 flag = 1; | |
2660 net_ind.long_name.dcs = mmr_info_ind->full_name.dcs; | |
2661 net_ind.long_name.add_ci = mmr_info_ind->full_name.add_ci; | |
2662 net_ind.long_name.num_spare = mmr_info_ind->full_name.num_spare; | |
2663 net_ind.long_name.len = MINIMUM (MMR_MAX_TEXT_LEN, mmr_info_ind->full_name.c_text); | |
2664 memcpy (net_ind.long_name.data, | |
2665 mmr_info_ind->full_name.text, | |
2666 net_ind.long_name.len); | |
2667 } | |
2668 | |
2669 /* copy short name */ | |
2670 memset(&net_ind.short_name, 0, sizeof(T_MFW_NET_NAME)); | |
2671 if (mmr_info_ind->short_name.v_name EQ TRUE) | |
2672 { | |
2673 flag = 1; | |
2674 net_ind.short_name.dcs = mmr_info_ind->short_name.dcs; | |
2675 net_ind.short_name.add_ci = mmr_info_ind->short_name.add_ci; | |
2676 net_ind.short_name.num_spare = mmr_info_ind->short_name.num_spare; | |
2677 net_ind.short_name.len = MINIMUM (MMR_MAX_TEXT_LEN, mmr_info_ind->short_name.c_text); | |
2678 memcpy (net_ind.short_name.data, | |
2679 mmr_info_ind->short_name.text, | |
2680 net_ind.short_name.len); | |
2681 } | |
2682 | |
2683 if (flag) | |
2684 nm_signal(E_MFW_NET_IND, &net_ind); | |
2685 #endif | |
2686 | |
2687 flag = 0; | |
2688 memset(&tim_ind, 0, sizeof(T_MFW_TIME_IND)); | |
2689 /* copy time */ | |
2690 if (mmr_info_ind->ntz.v_tz EQ TRUE AND | |
2691 mmr_info_ind->time.v_time EQ TRUE ) | |
2692 { | |
2693 flag = 1; | |
2694 tim_ind.timezone = mmr_info_ind->ntz.tz; | |
2695 tim_ind.year = mmr_info_ind->time.year; | |
2696 tim_ind.month = mmr_info_ind->time.month; | |
2697 tim_ind.day = mmr_info_ind->time.day; | |
2698 tim_ind.hour = mmr_info_ind->time.hour; | |
2699 tim_ind.minute = mmr_info_ind->time.minute; | |
2700 tim_ind.second = mmr_info_ind->time.second; | |
2701 } | |
2702 else if (mmr_info_ind->ntz.v_tz EQ TRUE AND | |
2703 mmr_info_ind->time.v_time NEQ TRUE ) | |
2704 { | |
2705 flag = 1; | |
2706 tim_ind.timezone = mmr_info_ind->ntz.tz; | |
2707 } | |
2708 | |
2709 if (flag) | |
2710 nm_signal(E_MFW_TIME_IND, &tim_ind); | |
2711 } | |
2712 #endif | |
2713 | |
2714 /* | |
2715 +--------------------------------------------------------------------+ | |
2716 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2717 | STATE : code ROUTINE : nmCommand | | |
2718 +--------------------------------------------------------------------+ | |
2719 | |
2720 PURPOSE : handle mfw windows command | |
2721 | |
2722 */ | |
2723 | |
2724 static int nmCommand (U32 cmd, void *h) | |
2725 { | |
2726 switch (cmd) | |
2727 { | |
2728 case MfwCmdDelete: /* delete me */ | |
2729 if (!h) | |
2730 return 0; | |
2731 nm_delete(h); | |
2732 return 1; | |
2733 default: | |
2734 break; | |
2735 } | |
2736 | |
2737 return 0; | |
2738 } | |
2739 | |
2740 | |
2741 | |
2742 #ifdef NO_ASCIIZ | |
2743 /* | |
2744 +--------------------------------------------------------------------+ | |
2745 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2746 | STATE : code ROUTINE : nm_get_spn | | |
2747 +--------------------------------------------------------------------+ | |
2748 | |
2749 PURPOSE : Function to give access to the service provider string | |
2750 | |
2751 Parameters : None | |
2752 | |
2753 Return: Service provider string | |
2754 | |
2755 */ | |
2756 | |
2757 void nm_get_spn (T_MFW_SP_NAME *name) | |
2758 { | |
2759 if (name NEQ NULL) | |
2760 memcpy(name, &service_provider_name, sizeof(T_MFW_SP_NAME)); | |
2761 } | |
2762 | |
2763 #else | |
2764 /* PATCH PMC 000804 */ | |
2765 /* | |
2766 +--------------------------------------------------------------------+ | |
2767 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2768 | STATE : code ROUTINE : nm_get_spn | | |
2769 +--------------------------------------------------------------------+ | |
2770 | |
2771 PURPOSE : Function to give access to the service provider string | |
2772 | |
2773 Parameters : None | |
2774 | |
2775 Return: Service provider string | |
2776 | |
2777 */ | |
2778 | |
2779 void nm_get_spn (char *name) | |
2780 { | |
2781 if (name NEQ NULL) | |
2782 strncpy (name, service_provider_name, LONG_NAME); | |
2783 } | |
2784 /* END PATCH PMC */ | |
2785 #endif | |
2786 | |
2787 /* | |
2788 +---------------------------------------------------------------------+ | |
2789 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2790 | STATE : code ROUTINE : nm_abort_registraion| | |
2791 +---------------------------------------------------------------------+ | |
2792 | |
2793 PURPOSE : abort current registration | |
2794 | |
2795 Parameters : None | |
2796 | |
2797 */ | |
2798 void nm_abort_registraion(void) | |
2799 { | |
2800 sAT_Abort(CMD_SRC_LCL, AT_CMD_NRG); | |
2801 } | |
2802 | |
2803 /* | |
2804 +--------------------------------------------------------------------+ | |
2805 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2806 | STATE : code ROUTINE : nm_decodeSourceId | | |
2807 +--------------------------------------------------------------------+ | |
2808 | |
2809 PURPOSE : This function is used to convert the source id | |
2810 used by ACI to the source id used by MFW. | |
2811 */ | |
2812 | |
2813 //x0pleela 09 Feb, 2006 ER: OMAPS00065203 | |
2814 int nm_decodeSourceId( UBYTE sourceId) | |
2815 { | |
2816 TRACE_FUNCTION("nm_decodeSourceId()"); | |
2817 #ifndef NEPTUNE_BOARD | |
2818 switch (sourceId) | |
2819 { | |
2820 case Read_ROM_TABLE: return NM_ROM; | |
2821 case Read_EONS: return NM_EONS; | |
2822 case Read_CPHS: return NM_CPHS; | |
2823 case Read_INVALID: | |
2824 default: return NM_NONE; | |
2825 } | |
2826 #endif | |
2827 /* to remove warning Aug -11 */ | |
2828 #ifdef NEPTUNE_BOARD | |
2829 return NM_NONE; | |
2830 #endif | |
2831 } | |
2832 | |
2833 /* | |
2834 +--------------------------------------------------------------------+ | |
2835 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2836 | STATE : code ROUTINE : nm_update_plmn_data | | |
2837 +--------------------------------------------------------------------+ | |
2838 | |
2839 PURPOSE : This function is used to update plmn data after querying COPN | |
2840 */ | |
2841 //x0pleela 09 Feb, 2006 ER: OMAPS00065203 | |
2842 void nm_update_plmn_data( T_MFW_NETWORK_STRUCT *plmn_ident, | |
2843 T_ACI_OPER_NTRY oper_ntry) | |
2844 { | |
2845 TRACE_FUNCTION("nm_update_plmn_data()"); | |
2846 | |
2847 #ifndef NEPTUNE_BOARD | |
2848 plmn_ident->opn_read_from = (T_MFW_NM_OPN)nm_decodeSourceId(oper_ntry.source); /*a0393213 compiler warnings removal - explicit typecast done*/ | |
2849 #endif | |
2850 | |
2851 | |
2852 //update plmn_ident with EONS | |
2853 #ifdef NO_ASCIIZ | |
2854 memset(plmn_ident->network_long.data, 0, LONG_NAME); | |
2855 memset(plmn_ident->network_short.data, 0, SHORT_NAME); | |
2856 memcpy( plmn_ident->network_long.data, | |
2857 oper_ntry.longName, | |
2858 strlen(oper_ntry.longName) ); | |
2859 | |
2860 memcpy( plmn_ident->network_short.data, | |
2861 oper_ntry.shrtName, | |
2862 strlen(oper_ntry.shrtName)); | |
2863 | |
2864 plmn_ident->network_long.len = strlen((const char*)(plmn_ident->network_long.data)); /*a0393213 warnings removal - explicit typecasting done*/ | |
2865 plmn_ident->network_short.len = strlen((const char*)(plmn_ident->network_short.data)); | |
2866 | |
2867 #else | |
2868 memset(plmn_ident->network_long, 0, LONG_NAME); | |
2869 memset(plmn_ident->network_short, 0, SHORT_NAME); | |
2870 strcpy( plmn_ident->network_long, | |
2871 oper_ntry.longName); | |
2872 strcpy( plmn_ident->network_short, | |
2873 oper_ntry.shrtName); | |
2874 #endif | |
2875 } | |
2876 | |
2877 /* | |
2878 +--------------------------------------------------------------------+ | |
2879 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2880 | STATE : code ROUTINE : nm_get_COPN | | |
2881 +--------------------------------------------------------------------+ | |
2882 | |
2883 PURPOSE : This function is used to query for COPS and COPN which will indicate from | |
2884 where the operator name was read | |
2885 */ | |
2886 //x0pleela 09 Feb, 2006 ER: OMAPS00065203 | |
2887 void nm_get_COPN( T_MFW_NETWORK_STRUCT *plmn_ident ) | |
2888 { | |
2889 T_ACI_COPS_MOD mode; | |
2890 T_ACI_COPS_FRMT format; | |
2891 T_ACI_OPER_NTRY oper_ntry; | |
2892 char opername[LONG_NAME]; | |
2893 | |
2894 TRACE_FUNCTION("nm_get_COPN()"); | |
2895 | |
2896 memset (&oper_ntry, 0, sizeof( T_ACI_OPER_NTRY )); | |
2897 //Check where MS is registered | |
2898 if( qAT_PlusCOPS ( CMD_SRC_LCL, &mode, | |
2899 &format, (char *)opername ) EQ AT_CMPL ) | |
2900 { | |
2901 //Request info about operator name | |
2902 if(qAT_PercentCOPN(CMD_SRC_LCL, | |
2903 format, | |
2904 (char *)opername, | |
2905 &oper_ntry) EQ AT_CMPL ) | |
2906 { | |
2907 nm_update_plmn_data(plmn_ident, oper_ntry); | |
2908 } | |
2909 } | |
2910 } | |
2911 | |
2912 /* | |
2913 +--------------------------------------------------------------------+ | |
2914 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2915 | STATE : code ROUTINE : nm_get_opername | | |
2916 +--------------------------------------------------------------------+ | |
2917 | |
2918 PURPOSE : This function updates operator name based on cingular's prioritization requirement. | |
2919 Priority would be in order ONS->NITZ->ROM | |
2920 | |
2921 */ | |
2922 //x0pleela 09 Feb, 2006 ER: OMAPS00065203 | |
2923 void nm_get_opername(T_MFW_NETWORK_STRUCT * plmn_ident) | |
2924 { | |
2925 TRACE_FUNCTION("nm_get_opername()"); | |
2926 sAT_PercentCNIV(CMD_SRC_LCL, CNIV_MODE_ON); | |
2927 | |
2928 return; | |
2929 } | |
2930 | |
2931 | |
2932 // June 02, 2006 DR: OMAPS00078005 x0021334 | |
2933 /* | |
2934 +--------------------------------------------------------------------+ | |
2935 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2936 | STATE : code ROUTINE : nm_get_network_time | | |
2937 +--------------------------------------------------------------------+ | |
2938 | |
2939 PURPOSE : This function sets the PCTZV mode on. | |
2940 | |
2941 */ | |
2942 #ifdef FF_TIMEZONE | |
2943 void nm_get_network_time(void) | |
2944 { | |
2945 TRACE_FUNCTION("nm_get_network_time()"); | |
2946 | |
2947 // Put PCTZV mode on to get time and date updates | |
2948 //x0066814(Geetha), OMAPS00098351, Timezone information is update through nm_nitz_info_ind() function | |
2949 //sAT_PercentCTZV(CMD_SRC_LCL, PCTZV_MODE_ON); | |
2950 } | |
2951 #endif | |
2952 | |
2953 | |
2954 /* | |
2955 +--------------------------------------------------------------------+ | |
2956 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2957 | STATE : code ROUTINE : nm_get_opername | | |
2958 +--------------------------------------------------------------------+ | |
2959 | |
2960 PURPOSE : This function gets operator name from network. | |
2961 */ | |
2962 //x0pleela 09 Feb, 2006 ER: OMAPS00065203 | |
2963 | |
2964 void nm_get_network_data(T_MFW_NETWORK_STRUCT *plmn_netw_data) | |
2965 { | |
2966 TRACE_FUNCTION("nm_get_network_data()"); | |
2967 | |
2968 //send E_NM_OPN event | |
2969 nm_signal(E_NM_OPN, plmn_netw_data); | |
2970 } | |
2971 | |
2972 | |
2973 // June 02, 2006 DR: OMAPS00078005 x0021334 | |
2974 /* | |
2975 +--------------------------------------------------------------------+ | |
2976 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2977 | STATE : code ROUTINE : nm_set_network_time | | |
2978 +--------------------------------------------------------------------+ | |
2979 | |
2980 PURPOSE : This function sets time and date info received from network. | |
2981 */ | |
2982 #ifdef FF_TIMEZONE | |
2983 void nm_set_network_time(T_MFW_TIME_IND *currclock) | |
2984 { | |
2985 TRACE_FUNCTION("nm_set_network_time()"); | |
2986 | |
2987 //send E_MFW_TIME_IND event | |
2988 nm_signal(E_MFW_TIME_IND, currclock); | |
2989 } | |
2990 #endif | |
2991 | |
2992 /* Aug 07, 2007 DR:OMAPS00137726 x0066814(Geetha)*/ | |
2993 /* | |
2994 +--------------------------------------------------------------------+ | |
2995 | PROJECT : MMI-Framework (8417) MODULE : MFW_NM | | |
2996 | STATE : code ROUTINE : nm_get_plmn_list_during_bootup | | |
2997 +--------------------------------------------------------------------+ | |
2998 | |
2999 PURPOSE : This function gets the plmn list during bootup | |
3000 */ | |
3001 void nm_get_plmn_list_during_bootup(void) | |
3002 { | |
3003 TRACE_FUNCTION ("nm_get_plmn_list_during_bootup()"); | |
3004 nm_signal(E_NM_PLMN_LIST_BOOTUP,0); | |
3005 | |
3006 } |