FreeCalypso > hg > fc-tourmaline
comparison src/ui/mfw/mfw_nma.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_nma.c $| | |
4 | $Author:: Es $Revision:: 1 $| | |
5 | CREATED: 13.10.98 $Modtime:: 2.03.00 16:26 $| | |
6 | STATE : code | | |
7 +--------------------------------------------------------------------+ | |
8 | |
9 MODULE : MFW_NMA | |
10 | |
11 PURPOSE : This modul contains the functions for network management. | |
12 | |
13 | |
14 $History:: mfw_nma.c $ | |
15 * | |
16 * ***************** Version 17 ***************** | |
17 * User: Es Date: 2.03.00 Time: 16:31 | |
18 * Updated in $/GSM/Condat/MS/SRC/MFW | |
19 * use 'aci_delete()' to clear the primitive routing for mfw_nm. | |
20 * | |
21 * ***************** Version 16 ***************** | |
22 * User: Vo Date: 10.01.00 Time: 14:41 | |
23 * Updated in $/GSM/Condat/MS/SRC/MFW | |
24 * Bug fix: search operator list for long name, short name and numeric | |
25 * name | |
26 * | |
27 * ***************** Version 15 ***************** | |
28 * User: Vo Date: 2.07.99 Time: 17:55 | |
29 * Updated in $/GSM/DEV/MS/SRC/MFW | |
30 * | |
31 * ***************** Version 14 ***************** | |
32 * User: Vo Date: 20.05.99 Time: 17:40 | |
33 * Updated in $/GSM/DEV/MS/SRC/MFW | |
34 * | |
35 * ***************** Version 13 ***************** | |
36 * User: Es Date: 15.03.99 Time: 18:22 | |
37 * Updated in $/GSM/DEV/MS/SRC/MFW | |
38 * | |
39 * ***************** Version 12 ***************** | |
40 * User: Vo Date: 11.03.99 Time: 14:38 | |
41 * Updated in $/GSM/DEV/MS/SRC/MFW | |
42 * | |
43 * ***************** Version 11 ***************** | |
44 * User: Vo Date: 17.02.99 Time: 19:03 | |
45 * Updated in $/GSM/DEV/MS/SRC/MFW | |
46 * | |
47 * ***************** Version 10 ***************** | |
48 * User: Vo Date: 12.02.99 Time: 18:59 | |
49 * Updated in $/GSM/DEV/MS/SRC/MFW | |
50 * | |
51 * ***************** Version 9 ***************** | |
52 * User: Vo Date: 9.02.99 Time: 14:54 | |
53 * Updated in $/GSM/DEV/MS/SRC/MFW | |
54 * | |
55 * ***************** Version 8 ***************** | |
56 * User: Es Date: 8.12.98 Time: 16:53 | |
57 * Updated in $/GSM/DEV/MS/SRC/MFW | |
58 * | |
59 * ***************** Version 7 ***************** | |
60 * User: Vo Date: 24.11.98 Time: 21:40 | |
61 * Updated in $/GSM/DEV/MS/SRC/MFW | |
62 * first successful compilation of MFW | |
63 | | |
64 | ***************** Version 6 ***************** | |
65 | User: Le Date: 11.11.98 Time: 13:35 | |
66 | Updated in $/GSM/DEV/MS/SRC/MFW | |
67 | | |
68 | ***************** Version 5 ***************** | |
69 | User: Le Date: 10.11.98 Time: 16:07 | |
70 | Updated in $/GSM/DEV/MS/SRC/MFW | |
71 | | |
72 | ***************** Version 4 ***************** | |
73 | User: Le Date: 10.11.98 Time: 11:08 | |
74 | Updated in $/GSM/DEV/MS/SRC/MFW | |
75 | | |
76 | ***************** Version 3 ***************** | |
77 | User: Le Date: 27.10.98 Time: 15:59 | |
78 | Updated in $/GSM/DEV/MS/SRC/MFW | |
79 | | |
80 | ***************** Version 2 ***************** | |
81 | User: Le Date: 21.10.98 Time: 16:20 | |
82 | Updated in $/GSM/DEV/MS/SRC/MFW | |
83 */ | |
84 | |
85 #define ENTITY_MFW | |
86 | |
87 #include "mfw_sys.h" | |
88 | |
89 #if defined (NEW_FRAME) | |
90 | |
91 #include "typedefs.h" | |
92 #include "vsi.h" | |
93 #include "custom.h" | |
94 #include "gsm.h" | |
95 | |
96 #else | |
97 | |
98 #include "STDDEFS.H" | |
99 #include "custom.h" | |
100 #include "gsm.h" | |
101 #include "vsi.h" | |
102 | |
103 #endif | |
104 | |
105 #include "message.h" | |
106 #include "prim.h" | |
107 #include "aci_cmh.h" | |
108 #include "cus_aci.h" | |
109 #include "mfw_mfw.h" | |
110 #include "mfw_nm.h" | |
111 #include "mfw_sima.h" | |
112 #include "mfw_nmi.h" | |
113 #include "mfw_sim.h" | |
114 #include "mfw_simi.h" | |
115 #include "mfw_nma.h" | |
116 | |
117 #include "mfw_phb.h" | |
118 #include "mfw_cm.h" | |
119 | |
120 #include "ksd.h" | |
121 | |
122 #include "mfw_ss.h" | |
123 | |
124 #include <string.h> | |
125 | |
126 #define hCommMM _ENTITY_PREFIXED(hCommMM) | |
127 #if defined (NEW_FRAME) | |
128 EXTERN T_HANDLE hCommMM; /* MM Communication */ | |
129 #else | |
130 EXTERN T_VSI_CHANDLE hCommMM; /* MM Communication */ | |
131 #endif | |
132 #ifndef NEPTUNE_BOARD | |
133 EXTERN BOOL cmhMM_FindNumeric ( T_OPER_ENTRY * plmnDesc, /* Side access into cmh_mmf.c */ | |
134 const CHAR *numStr ); | |
135 EXTERN BOOL cmhMM_FindName ( T_OPER_ENTRY * plmnDesc, /* Side access into cmh_mmf.c */ | |
136 const CHAR *string, T_ACI_CPOL_FRMT format ); | |
137 #else | |
138 EXTERN T_OPER_NTRY * cmhMM_FindNumeric ( CHAR * numStr ); | |
139 //EXTERN T_OPER_NTRY * cmhMM_FindLongName( CHAR * longStr ); | |
140 //EXTERN T_OPER_NTRY * cmhMM_FindShrtName( CHAR * shrtStr ); | |
141 EXTERN T_OPER_NTRY * cmhMM_FindName( const CHAR *string, T_ACI_CPOL_FRMT format); | |
142 #endif | |
143 | |
144 EXTERN void aci_create (BOOL (*r_cb)(ULONG opc, void * data), | |
145 BOOL (*cmd)(char *)); | |
146 | |
147 | |
148 typedef struct | |
149 { | |
150 #ifdef FF_2TO1_PS | |
151 T_CAUSE_ps_cause nreg_cause; | |
152 #else | |
153 USHORT nreg_cause; /* nreg cause from MMR_NREG_IND */ | |
154 #endif | |
155 UBYTE forbidden_id[30]; /* forbidden indicator from MMR_PLMN_IND */ | |
156 UBYTE fieldstrength [30]; /* fieldstrength from MMR_PLMN_IND */ | |
157 } T_NM_ACI_DATA; | |
158 | |
159 T_NM_ACI_DATA nm_aci_data; | |
160 | |
161 | |
162 /* | |
163 +--------------------------------------------------------------------+ | |
164 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
165 | STATE : code ROUTINE: nma_response_cb | | |
166 +--------------------------------------------------------------------+ | |
167 | |
168 PURPOSE : Response Callback Handler. | |
169 | |
170 */ | |
171 | |
172 #ifdef FF_2TO1_PS | |
173 GLOBAL BOOL nma_response_cb (ULONG opc, void * data) | |
174 { | |
175 /* BEGIN ADD: Neptune alignment*/ | |
176 #ifdef NEPTUNE_BOARD | |
177 TRACE_FUNCTION ("nma_response_cb()"); | |
178 | |
179 if (opc EQ MMREG_INFO_IND) | |
180 { | |
181 /* | |
182 * send this NITZ information to MMI | |
183 */ | |
184 nm_nitz_info_ind((T_MMREG_INFO_IND *)data); | |
185 return FALSE; /* normal processing of ACI */ | |
186 } | |
187 | |
188 #else | |
189 /* END ADD: Neptune Alignment*/ | |
190 T_MMREG_DETACH_IND * nreg_ind;//x0066814 (Geetha), OMAPS00098351 | |
191 T_MMREG_INFO_IND * mmr_nitz_ind; //x0066814 (Geetha), OMAPS00098351 | |
192 TRACE_FUNCTION ("nma_response_cb()"); | |
193 | |
194 switch (opc) | |
195 { | |
196 case MMREG_PLMN_IND: | |
197 /* | |
198 * available PLMN list, store fieldstrength | |
199 * and forbidden indicator (not yet included) | |
200 */ | |
201 return FALSE; /* normal processing of ACI */ | |
202 | |
203 case MMREG_DETACH_IND: | |
204 /* | |
205 * store the nreg cause | |
206 */ | |
207 nreg_ind = (T_MMREG_DETACH_IND *)data; | |
208 nm_aci_data.nreg_cause = nreg_ind->ps_cause; | |
209 return FALSE; /* normal processing of ACI */ | |
210 | |
211 case MMREG_INFO_IND: | |
212 | |
213 /* send this NITZ information to MMI | |
214 */ | |
215 TRACE_FUNCTION(" case MMREG_INFO_IND: "); | |
216 nm_nitz_info_ind((T_MMREG_INFO_IND *)data); | |
217 return FALSE; /* normal processing of ACI */ | |
218 | |
219 //x0066814 (Geetha), OMAPS00098351, To get time and timezone from network | |
220 case GMMREG_INFO_IND: | |
221 TRACE_FUNCTION(" case GMMREG_INFO_IND: "); | |
222 memcpy (&(mmr_nitz_ind->plmn), &(gmmreg_info_ind->plmn), sizeof(T_plmn)); | |
223 | |
224 memcpy (&(mmr_nitz_ind->full_name),&(gmmreg_info_ind->full_net_name_gmm), sizeof (T_full_net_name_gmm)); | |
225 | |
226 memcpy (&(mmr_nitz_ind->short_name),&(gmmreg_info_ind->short_net_name_gmm), sizeof (T_short_net_name_gmm)); | |
227 | |
228 memcpy (&(mmr_nitz_ind->ntz), &(gmmreg_info_ind->net_time_zone),sizeof (T_net_time_zone)); | |
229 | |
230 memcpy (&(mmr_nitz_ind->time), &(gmmreg_info_ind->net_time), sizeof(T_net_time)); | |
231 | |
232 | |
233 nm_nitz_info_ind(* mmr_nitz_ind ); | |
234 return FALSE; /* normal processing of ACI */ | |
235 } | |
236 | |
237 /* BEGIN ADD: Neptune alignment*/ | |
238 #endif | |
239 /* END ADD: Neptune alignment*/ | |
240 return FALSE; /* not processed by extension */ | |
241 } | |
242 #else | |
243 GLOBAL BOOL nma_response_cb (ULONG opc, void * data) | |
244 { | |
245 T_MMR_NREG_IND * nreg_ind; | |
246 T_MMR_INFO_IND mmr_nitz_ind;//x0066814 (Geetha), OMAPS00098351 | |
247 #ifdef GPRS | |
248 T_GMMREG_INFO_IND *gmmreg_info_ind;//x0066814 (Geetha), OMAPS00098351 | |
249 #endif | |
250 | |
251 TRACE_FUNCTION ("nma_response_cb()"); | |
252 | |
253 switch (opc) | |
254 { | |
255 case MMR_PLMN_IND: | |
256 /* | |
257 * available PLMN list, store fieldstrength | |
258 * and forbidden indicator (not yet included) | |
259 */ | |
260 return FALSE; /* normal processing of ACI */ | |
261 | |
262 case MMR_NREG_IND: | |
263 /* | |
264 * store the nreg cause | |
265 */ | |
266 nreg_ind = (T_MMR_NREG_IND *)data; | |
267 nm_aci_data.nreg_cause = nreg_ind->cause; | |
268 return FALSE; /* normal processing of ACI */ | |
269 | |
270 case MMR_INFO_IND: | |
271 TRACE_FUNCTION(" case MMREG_INFO_IND: "); | |
272 /* | |
273 * send this NITZ information to MMI | |
274 */ | |
275 nm_nitz_info_ind((T_MMR_INFO_IND *)data); | |
276 return FALSE; /* normal processing of ACI */ | |
277 | |
278 // x0066814 (Geetha), OMAPS00098351 (NITZ), Timezone info handling | |
279 #ifdef GPRS | |
280 case GMMREG_INFO_IND: | |
281 TRACE_FUNCTION(" case GMMREG_INFO_IND: "); | |
282 | |
283 gmmreg_info_ind= (T_GMMREG_INFO_IND *)data; | |
284 memcpy (&(mmr_nitz_ind.plmn), &(gmmreg_info_ind->plmn), sizeof(T_plmn)); | |
285 | |
286 memcpy (&(mmr_nitz_ind.full_name),&(gmmreg_info_ind->full_net_name_gmm), sizeof (T_full_name)); | |
287 memcpy (&(mmr_nitz_ind.short_name),&(gmmreg_info_ind->short_net_name_gmm), sizeof (T_short_name)); | |
288 | |
289 memcpy (&(mmr_nitz_ind.ntz), &(gmmreg_info_ind->net_time_zone),sizeof (T_ntz)); | |
290 memcpy (&(mmr_nitz_ind.time), &(gmmreg_info_ind->net_time), sizeof(T_time)); | |
291 | |
292 | |
293 nm_nitz_info_ind(&mmr_nitz_ind); | |
294 return FALSE; /* normal processing of ACI */ | |
295 #endif | |
296 } | |
297 | |
298 return FALSE; /* not processed by extension */ | |
299 } | |
300 #endif | |
301 | |
302 /* | |
303 +--------------------------------------------------------------------+ | |
304 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
305 | STATE : code ROUTINE: nma_init | | |
306 +--------------------------------------------------------------------+ | |
307 | |
308 PURPOSE : Install AT-Command Extension. | |
309 | |
310 */ | |
311 | |
312 GLOBAL void nma_init () | |
313 { | |
314 TRACE_FUNCTION ("nma_init()"); | |
315 } | |
316 | |
317 | |
318 /* | |
319 +--------------------------------------------------------------------+ | |
320 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
321 | STATE : code ROUTINE: sAT_PlusCOPSE | | |
322 +--------------------------------------------------------------------+ | |
323 | |
324 PURPOSE : Converts a given PLMN indication into the two other formats. | |
325 | |
326 */ | |
327 #ifdef NO_ASCIIZ | |
328 GLOBAL void sAT_PlusCOPSE(UBYTE *oper, UBYTE format, | |
329 T_MFW_LNAME *long_name, | |
330 T_MFW_SNAME *short_name, | |
331 UBYTE *numeric_name) | |
332 { | |
333 #ifndef NEPTUNE_BOARD | |
334 T_OPER_ENTRY plmnDesc; | |
335 BOOL found; | |
336 #else | |
337 T_OPER_NTRY * network_entry; | |
338 #endif | |
339 | |
340 TRACE_FUNCTION ("sAT_PlusCOPSE()"); | |
341 | |
342 long_name->len = 0; | |
343 short_name->len = 0; | |
344 strcpy ((char *)numeric_name, ""); | |
345 | |
346 switch (format) | |
347 { | |
348 case COPS_FRMT_Numeric: | |
349 #ifndef NEPTUNE_BOARD | |
350 strcpy ((char *)numeric_name, (char *)oper); | |
351 found = cmhMM_FindNumeric (&plmnDesc, (char *)oper); | |
352 if (found) | |
353 { | |
354 UBYTE length=strlen((const char*)plmnDesc.longName); | |
355 long_name->len = MINIMUM(LONG_NAME-1, length); | |
356 memcpy (long_name->data, plmnDesc.longName, long_name->len); | |
357 long_name->data[long_name->len] = '\0'; | |
358 long_name->dcs = MFW_ASCII; | |
359 length=strlen((const char*)plmnDesc.shrtName); | |
360 short_name->len = MINIMUM(SHORT_NAME-1, length); | |
361 memcpy (short_name->data, plmnDesc.shrtName, short_name->len); | |
362 short_name->data[short_name->len] = '\0'; | |
363 short_name->dcs = MFW_ASCII; | |
364 } | |
365 #else | |
366 strcpy ((char *)numeric_name, (char *)oper); | |
367 network_entry = cmhMM_FindNumeric ((char *)oper); | |
368 if (network_entry NEQ NULL) | |
369 { | |
370 if (network_entry->longName) | |
371 { | |
372 long_name->len = MINIMUM(LONG_NAME-1, strlen((char *)network_entry->longName)); | |
373 memcpy (long_name->data, network_entry->longName, long_name->len); | |
374 long_name->data[long_name->len] = '\0'; | |
375 long_name->dcs = MFW_ASCII; | |
376 } | |
377 if (network_entry->shrtName) | |
378 { | |
379 short_name->len = MINIMUM(SHORT_NAME-1, strlen((char *)network_entry->shrtName)); | |
380 memcpy (short_name->data, network_entry->shrtName, short_name->len); | |
381 short_name->data[short_name->len] = '\0'; | |
382 short_name->dcs = MFW_ASCII; | |
383 } | |
384 } | |
385 #endif | |
386 break; | |
387 | |
388 case COPS_FRMT_Long: | |
389 if (oper) | |
390 { | |
391 UBYTE length=strlen((const char *)oper); | |
392 long_name->len = MINIMUM(LONG_NAME-1, length); | |
393 memcpy (long_name->data, oper, long_name->len); | |
394 long_name->data[long_name->len] = '\0'; | |
395 long_name->dcs = MFW_ASCII; | |
396 } | |
397 #ifndef NEPTUNE_BOARD | |
398 found = cmhMM_FindName (&plmnDesc, (char *)oper, CPOL_FRMT_Long); /*a0393213 compiler warning removal - COPS_FRMT_Long changed to CPOL_FRMT_Long*/ | |
399 if (found) | |
400 { | |
401 UBYTE length; | |
402 numeric_name[0] = ((plmnDesc.mcc >> 8) & 0xf) + '0'; | |
403 numeric_name[1] = ((plmnDesc.mcc >> 4) & 0xf) + '0'; | |
404 numeric_name[2] = ( plmnDesc.mcc & 0xf) + '0'; | |
405 numeric_name[3] = ((plmnDesc.mnc >> 8) & 0xf) + '0'; | |
406 numeric_name[4] = ((plmnDesc.mnc >> 4) & 0xf) + '0'; | |
407 if ((plmnDesc.mnc & 0xf) EQ 0xf) | |
408 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
409 else | |
410 numeric_name[5] = ( plmnDesc.mnc & 0xf) + '0'; | |
411 numeric_name[6] = '\0'; | |
412 length=strlen((const char*)plmnDesc.shrtName); | |
413 short_name->len = MINIMUM(SHORT_NAME-1, length); | |
414 memcpy (short_name->data, plmnDesc.shrtName, short_name->len); | |
415 short_name->data[short_name->len] = '\0'; | |
416 short_name->dcs = MFW_ASCII; | |
417 } | |
418 #else | |
419 | |
420 network_entry = cmhMM_FindName ((char *)oper, (T_ACI_CPOL_FRMT) COPS_FRMT_Long); | |
421 if (network_entry NEQ NULL) | |
422 { | |
423 numeric_name[0] = ((network_entry->mcc >> 8) & 0xf) + '0'; | |
424 numeric_name[1] = ((network_entry->mcc >> 4) & 0xf) + '0'; | |
425 numeric_name[2] = ( network_entry->mcc & 0xf) + '0'; | |
426 numeric_name[3] = ((network_entry->mnc >> 8) & 0xf) + '0'; | |
427 numeric_name[4] = ((network_entry->mnc >> 4) & 0xf) + '0'; | |
428 if ((network_entry->mnc & 0xf) EQ 0xf) | |
429 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
430 else | |
431 numeric_name[5] = ( network_entry->mnc & 0xf) + '0'; | |
432 numeric_name[6] = '\0'; | |
433 | |
434 if (network_entry->shrtName) | |
435 { | |
436 short_name->len = MINIMUM(SHORT_NAME-1, strlen((char *)network_entry->shrtName)); | |
437 memcpy (short_name->data, network_entry->shrtName, short_name->len); | |
438 short_name->data[short_name->len] = '\0'; | |
439 short_name->dcs = MFW_ASCII; | |
440 } | |
441 } | |
442 #endif | |
443 break; | |
444 | |
445 case COPS_FRMT_Short: | |
446 if (oper) | |
447 { | |
448 UBYTE length=strlen((const char *)oper); | |
449 short_name->len = MINIMUM(SHORT_NAME-1, length); | |
450 memcpy (short_name->data, oper, short_name->len); | |
451 short_name->data[short_name->len] = '\0'; | |
452 short_name->dcs = MFW_ASCII; | |
453 } | |
454 #ifndef NEPTUNE_BOARD | |
455 found = cmhMM_FindName (&plmnDesc, (char *)oper, CPOL_FRMT_Short); /*a0393213 compiler warnings removal - COPS_FRMT_Short changed to CPOL_FRMT_Short*/ | |
456 if (found) | |
457 { | |
458 UBYTE length; | |
459 numeric_name[0] = ((plmnDesc.mcc >> 8) & 0xf) + '0'; | |
460 numeric_name[1] = ((plmnDesc.mcc >> 4) & 0xf) + '0'; | |
461 numeric_name[2] = ( plmnDesc.mcc & 0xf) + '0'; | |
462 numeric_name[3] = ((plmnDesc.mnc >> 8) & 0xf) + '0'; | |
463 numeric_name[4] = ((plmnDesc.mnc >> 4) & 0xf) + '0'; | |
464 if ((plmnDesc.mnc & 0xf) EQ 0xf) | |
465 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
466 else | |
467 numeric_name[5] = ( plmnDesc.mnc & 0xf) + '0'; | |
468 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
469 length=strlen((const char*)plmnDesc.longName); | |
470 long_name->len = MINIMUM(LONG_NAME-1, length); | |
471 memcpy (long_name->data, plmnDesc.longName, long_name->len); | |
472 long_name->data[long_name->len] = '\0'; | |
473 long_name->dcs = MFW_ASCII; | |
474 } | |
475 #else | |
476 network_entry = cmhMM_FindName ((char *)oper, (T_ACI_CPOL_FRMT)COPS_FRMT_Short); | |
477 if (network_entry NEQ NULL) | |
478 { | |
479 numeric_name[0] = ((network_entry->mcc >> 8) & 0xf) + '0'; | |
480 numeric_name[1] = ((network_entry->mcc >> 4) & 0xf) + '0'; | |
481 numeric_name[2] = ( network_entry->mcc & 0xf) + '0'; | |
482 numeric_name[3] = ((network_entry->mnc >> 8) & 0xf) + '0'; | |
483 numeric_name[4] = ((network_entry->mnc >> 4) & 0xf) + '0'; | |
484 if ((network_entry->mnc & 0xf) EQ 0xf) | |
485 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
486 else | |
487 numeric_name[5] = ( network_entry->mnc & 0xf) + '0'; | |
488 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
489 | |
490 if (network_entry->longName) | |
491 { | |
492 long_name->len = MINIMUM(LONG_NAME-1, strlen((char *)network_entry->longName)); | |
493 memcpy (long_name->data, network_entry->longName, long_name->len); | |
494 long_name->data[long_name->len] = '\0'; | |
495 long_name->dcs = MFW_ASCII; | |
496 } | |
497 } | |
498 #endif | |
499 break; | |
500 } | |
501 } | |
502 #else | |
503 GLOBAL void sAT_PlusCOPSE(UBYTE *oper, UBYTE format, UBYTE *long_name, | |
504 UBYTE *short_name, UBYTE *numeric_name) | |
505 { | |
506 #ifndef NEPTUNE_BOARD | |
507 T_OPER_ENTRY plmnDesc; | |
508 BOOL found; | |
509 #else | |
510 T_OPER_NTRY * network_entry; | |
511 #endif | |
512 | |
513 TRACE_FUNCTION ("sAT_PlusCOPSE()"); | |
514 | |
515 strcpy ((char *)long_name, ""); | |
516 strcpy ((char *)short_name, ""); | |
517 strcpy ((char *)numeric_name, ""); | |
518 | |
519 switch (format) | |
520 { | |
521 case COPS_FRMT_Numeric: | |
522 #ifndef NEPTUNE_BOARD | |
523 strcpy ((char *)numeric_name, (char *)oper); | |
524 found = cmhMM_FindNumeric (&plmnDesc, (char *)oper); | |
525 if (found) | |
526 { | |
527 strncpy ((char *)long_name, plmnDesc.longName, LONG_NAME-1); | |
528 long_name[LONG_NAME-1] = '\0'; | |
529 | |
530 strncpy ((char *)short_name, plmnDesc.shrtName, SHORT_NAME-1); | |
531 short_name[SHORT_NAME-1] = '\0'; | |
532 } | |
533 #else | |
534 strcpy ((char *)numeric_name, (char *)oper); | |
535 network_entry = cmhMM_FindNumeric ((char *)oper); | |
536 if (network_entry NEQ NULL) | |
537 { | |
538 if (network_entry->longName) | |
539 { | |
540 strncpy ((char *)long_name, (char *)network_entry->longName, LONG_NAME-1); | |
541 long_name[LONG_NAME-1] = '\0'; | |
542 } | |
543 if (network_entry->shrtName) | |
544 { | |
545 strncpy ((char *)short_name, (char *)network_entry->shrtName, SHORT_NAME-1); | |
546 short_name[SHORT_NAME-1] = '\0'; | |
547 } | |
548 } | |
549 #endif | |
550 break; | |
551 | |
552 case COPS_FRMT_Long: | |
553 if (oper) | |
554 { | |
555 strncpy ((char *)long_name, (char *)oper, LONG_NAME-1); | |
556 long_name[LONG_NAME-1] = '\0'; | |
557 } | |
558 #ifndef NEPTUNE_BOARD | |
559 found = cmhMM_FindName (&plmnDesc, (char *)oper, COPS_FRMT_Long); | |
560 if (found) | |
561 { | |
562 numeric_name[0] = ((plmnDesc.mcc >> 8) & 0xf) + '0'; | |
563 numeric_name[1] = ((plmnDesc.mcc >> 4) & 0xf) + '0'; | |
564 numeric_name[2] = ( plmnDesc.mcc & 0xf) + '0'; | |
565 numeric_name[3] = ((plmnDesc.mnc >> 8) & 0xf) + '0'; | |
566 numeric_name[4] = ((plmnDesc.mnc >> 4) & 0xf) + '0'; | |
567 if ((plmnDesc.mnc & 0xf) EQ 0xf) | |
568 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
569 else | |
570 numeric_name[5] = ( plmnDesc.mnc & 0xf) + '0'; | |
571 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
572 | |
573 strncpy ((char *)short_name, plmnDesc.shrtName, SHORT_NAME-1); | |
574 short_name[SHORT_NAME-1] = '\0'; | |
575 } | |
576 #else | |
577 network_entry = cmhMM_FindName ((char *)oper, COPS_FRMT_Long); | |
578 if (network_entry NEQ NULL) | |
579 { | |
580 numeric_name[0] = ((network_entry->mcc >> 8) & 0xf) + '0'; | |
581 numeric_name[1] = ((network_entry->mcc >> 4) & 0xf) + '0'; | |
582 numeric_name[2] = ( network_entry->mcc & 0xf) + '0'; | |
583 numeric_name[3] = ((network_entry->mnc >> 8) & 0xf) + '0'; | |
584 numeric_name[4] = ((network_entry->mnc >> 4) & 0xf) + '0'; | |
585 if ((network_entry->mnc & 0xf) EQ 0xf) | |
586 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
587 else | |
588 numeric_name[5] = ( network_entry->mnc & 0xf) + '0'; | |
589 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
590 | |
591 if (network_entry->shrtName) | |
592 { | |
593 strncpy ((char *)short_name, (char *)network_entry->shrtName, SHORT_NAME-1); | |
594 short_name[SHORT_NAME-1] = '\0'; | |
595 } | |
596 } | |
597 #endif | |
598 break; | |
599 | |
600 case COPS_FRMT_Short: | |
601 if (oper) | |
602 { | |
603 strncpy ((char *)short_name, (char *)oper, SHORT_NAME-1); | |
604 short_name[SHORT_NAME-1] = '\0'; | |
605 } | |
606 #ifndef NEPTUNE_BOARD | |
607 found = cmhMM_FindName (&plmnDesc, (char *)oper, COPS_FRMT_Short); | |
608 if (found) | |
609 { | |
610 numeric_name[0] = ((plmnDesc.mcc >> 8) & 0xf) + '0'; | |
611 numeric_name[1] = ((plmnDesc.mcc >> 4) & 0xf) + '0'; | |
612 numeric_name[2] = ( plmnDesc.mcc & 0xf) + '0'; | |
613 numeric_name[3] = ((plmnDesc.mnc >> 8) & 0xf) + '0'; | |
614 numeric_name[4] = ((plmnDesc.mnc >> 4) & 0xf) + '0'; | |
615 if ((plmnDesc.mnc & 0xf) EQ 0xf) | |
616 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
617 else | |
618 numeric_name[5] = ( plmnDesc.mnc & 0xf) + '0'; | |
619 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
620 | |
621 strncpy ((char *)long_name, plmnDesc.longName, LONG_NAME-1); | |
622 long_name[LONG_NAME-1] = '\0'; | |
623 } | |
624 #else | |
625 network_entry = cmhMM_FindName ((char *)oper, COPS_FRMT_Short); | |
626 if (network_entry NEQ NULL) | |
627 { | |
628 numeric_name[0] = ((network_entry->mcc >> 8) & 0xf) + '0'; | |
629 numeric_name[1] = ((network_entry->mcc >> 4) & 0xf) + '0'; | |
630 numeric_name[2] = ( network_entry->mcc & 0xf) + '0'; | |
631 numeric_name[3] = ((network_entry->mnc >> 8) & 0xf) + '0'; | |
632 numeric_name[4] = ((network_entry->mnc >> 4) & 0xf) + '0'; | |
633 if ((network_entry->mnc & 0xf) EQ 0xf) | |
634 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
635 else | |
636 numeric_name[5] = ( network_entry->mnc & 0xf) + '0'; | |
637 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
638 | |
639 if (network_entry->longName) | |
640 { | |
641 strncpy ((char *)long_name, (char *)network_entry->longName, LONG_NAME-1); | |
642 long_name[LONG_NAME-1] = '\0'; | |
643 } | |
644 } | |
645 #endif | |
646 break; | |
647 } | |
648 } | |
649 #endif | |
650 | |
651 /* | |
652 +--------------------------------------------------------------------+ | |
653 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
654 | STATE : code ROUTINE: sAT_PlusCREGE | | |
655 +--------------------------------------------------------------------+ | |
656 | |
657 PURPOSE : Request NREG cause. | |
658 | |
659 */ | |
660 | |
661 #ifdef FF_2TO1_PS | |
662 GLOBAL T_CAUSE_ps_cause sAT_PlusCREGE (void) | |
663 { | |
664 TRACE_FUNCTION ("sAT_PlusCREGE()"); | |
665 | |
666 return nm_aci_data.nreg_cause; | |
667 } | |
668 #else | |
669 GLOBAL USHORT sAT_PlusCREGE (void) | |
670 { | |
671 TRACE_FUNCTION ("sAT_PlusCREGE()"); | |
672 | |
673 return nm_aci_data.nreg_cause; | |
674 } | |
675 #endif | |
676 | |
677 /* | |
678 +--------------------------------------------------------------------+ | |
679 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
680 | STATE : code ROUTINE: sAT_PlusCOPSF | | |
681 +--------------------------------------------------------------------+ | |
682 | |
683 PURPOSE : Request fieldstrength and forbidden indicator for | |
684 PLMN list. | |
685 | |
686 */ | |
687 | |
688 GLOBAL void sAT_PlusCOPSF(UBYTE ** forbidden_id, UBYTE ** fieldstrength) | |
689 { | |
690 TRACE_FUNCTION ("sAT_PlusCOPSF()"); | |
691 | |
692 *forbidden_id = nm_aci_data.forbidden_id; | |
693 *fieldstrength = nm_aci_data.fieldstrength; | |
694 } | |
695 |