FreeCalypso > hg > fc-magnetite
comparison src/ui3/mfw/mfw_nma.c @ 420:e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 21 Jan 2018 03:09:00 +0000 |
parents | |
children | 9b58d5a84a44 |
comparison
equal
deleted
inserted
replaced
419:59143cd42ec7 | 420:e8ddbb0837ed |
---|---|
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 T_GMMREG_INFO_IND *gmmreg_info_ind;//x0066814 (Geetha), OMAPS00098351 | |
248 | |
249 TRACE_FUNCTION ("nma_response_cb()"); | |
250 | |
251 switch (opc) | |
252 { | |
253 case MMR_PLMN_IND: | |
254 /* | |
255 * available PLMN list, store fieldstrength | |
256 * and forbidden indicator (not yet included) | |
257 */ | |
258 return FALSE; /* normal processing of ACI */ | |
259 | |
260 case MMR_NREG_IND: | |
261 /* | |
262 * store the nreg cause | |
263 */ | |
264 nreg_ind = (T_MMR_NREG_IND *)data; | |
265 nm_aci_data.nreg_cause = nreg_ind->cause; | |
266 return FALSE; /* normal processing of ACI */ | |
267 | |
268 case MMR_INFO_IND: | |
269 TRACE_FUNCTION(" case MMREG_INFO_IND: "); | |
270 /* | |
271 * send this NITZ information to MMI | |
272 */ | |
273 nm_nitz_info_ind((T_MMR_INFO_IND *)data); | |
274 return FALSE; /* normal processing of ACI */ | |
275 | |
276 // x0066814 (Geetha), OMAPS00098351 (NITZ), Timezone info handling | |
277 case GMMREG_INFO_IND: | |
278 TRACE_FUNCTION(" case GMMREG_INFO_IND: "); | |
279 | |
280 gmmreg_info_ind= (T_GMMREG_INFO_IND *)data; | |
281 memcpy (&(mmr_nitz_ind.plmn), &(gmmreg_info_ind->plmn), sizeof(T_plmn)); | |
282 | |
283 memcpy (&(mmr_nitz_ind.full_name),&(gmmreg_info_ind->full_net_name_gmm), sizeof (T_full_name)); | |
284 memcpy (&(mmr_nitz_ind.short_name),&(gmmreg_info_ind->short_net_name_gmm), sizeof (T_short_name)); | |
285 | |
286 memcpy (&(mmr_nitz_ind.ntz), &(gmmreg_info_ind->net_time_zone),sizeof (T_ntz)); | |
287 memcpy (&(mmr_nitz_ind.time), &(gmmreg_info_ind->net_time), sizeof(T_time)); | |
288 | |
289 | |
290 nm_nitz_info_ind(&mmr_nitz_ind); | |
291 return FALSE; /* normal processing of ACI */ | |
292 } | |
293 | |
294 return FALSE; /* not processed by extension */ | |
295 } | |
296 #endif | |
297 | |
298 /* | |
299 +--------------------------------------------------------------------+ | |
300 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
301 | STATE : code ROUTINE: nma_init | | |
302 +--------------------------------------------------------------------+ | |
303 | |
304 PURPOSE : Install AT-Command Extension. | |
305 | |
306 */ | |
307 | |
308 GLOBAL void nma_init () | |
309 { | |
310 TRACE_FUNCTION ("nma_init()"); | |
311 } | |
312 | |
313 | |
314 /* | |
315 +--------------------------------------------------------------------+ | |
316 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
317 | STATE : code ROUTINE: sAT_PlusCOPSE | | |
318 +--------------------------------------------------------------------+ | |
319 | |
320 PURPOSE : Converts a given PLMN indication into the two other formats. | |
321 | |
322 */ | |
323 #ifdef NO_ASCIIZ | |
324 GLOBAL void sAT_PlusCOPSE(UBYTE *oper, UBYTE format, | |
325 T_MFW_LNAME *long_name, | |
326 T_MFW_SNAME *short_name, | |
327 UBYTE *numeric_name) | |
328 { | |
329 #ifndef NEPTUNE_BOARD | |
330 T_OPER_ENTRY plmnDesc; | |
331 BOOL found; | |
332 #else | |
333 T_OPER_NTRY * network_entry; | |
334 #endif | |
335 | |
336 TRACE_FUNCTION ("sAT_PlusCOPSE()"); | |
337 | |
338 long_name->len = 0; | |
339 short_name->len = 0; | |
340 strcpy ((char *)numeric_name, ""); | |
341 | |
342 switch (format) | |
343 { | |
344 case COPS_FRMT_Numeric: | |
345 #ifndef NEPTUNE_BOARD | |
346 strcpy ((char *)numeric_name, (char *)oper); | |
347 found = cmhMM_FindNumeric (&plmnDesc, (char *)oper); | |
348 if (found) | |
349 { | |
350 UBYTE length=strlen((const char*)plmnDesc.longName); | |
351 long_name->len = MINIMUM(LONG_NAME-1, length); | |
352 memcpy (long_name->data, plmnDesc.longName, long_name->len); | |
353 long_name->data[long_name->len] = '\0'; | |
354 long_name->dcs = MFW_ASCII; | |
355 length=strlen((const char*)plmnDesc.shrtName); | |
356 short_name->len = MINIMUM(SHORT_NAME-1, length); | |
357 memcpy (short_name->data, plmnDesc.shrtName, short_name->len); | |
358 short_name->data[short_name->len] = '\0'; | |
359 short_name->dcs = MFW_ASCII; | |
360 } | |
361 #else | |
362 strcpy ((char *)numeric_name, (char *)oper); | |
363 network_entry = cmhMM_FindNumeric ((char *)oper); | |
364 if (network_entry NEQ NULL) | |
365 { | |
366 if (network_entry->longName) | |
367 { | |
368 long_name->len = MINIMUM(LONG_NAME-1, strlen((char *)network_entry->longName)); | |
369 memcpy (long_name->data, network_entry->longName, long_name->len); | |
370 long_name->data[long_name->len] = '\0'; | |
371 long_name->dcs = MFW_ASCII; | |
372 } | |
373 if (network_entry->shrtName) | |
374 { | |
375 short_name->len = MINIMUM(SHORT_NAME-1, strlen((char *)network_entry->shrtName)); | |
376 memcpy (short_name->data, network_entry->shrtName, short_name->len); | |
377 short_name->data[short_name->len] = '\0'; | |
378 short_name->dcs = MFW_ASCII; | |
379 } | |
380 } | |
381 #endif | |
382 break; | |
383 | |
384 case COPS_FRMT_Long: | |
385 if (oper) | |
386 { | |
387 UBYTE length=strlen((const char *)oper); | |
388 long_name->len = MINIMUM(LONG_NAME-1, length); | |
389 memcpy (long_name->data, oper, long_name->len); | |
390 long_name->data[long_name->len] = '\0'; | |
391 long_name->dcs = MFW_ASCII; | |
392 } | |
393 #ifndef NEPTUNE_BOARD | |
394 found = cmhMM_FindName (&plmnDesc, (char *)oper, CPOL_FRMT_Long); /*a0393213 compiler warning removal - COPS_FRMT_Long changed to CPOL_FRMT_Long*/ | |
395 if (found) | |
396 { | |
397 UBYTE length; | |
398 numeric_name[0] = ((plmnDesc.mcc >> 8) & 0xf) + '0'; | |
399 numeric_name[1] = ((plmnDesc.mcc >> 4) & 0xf) + '0'; | |
400 numeric_name[2] = ( plmnDesc.mcc & 0xf) + '0'; | |
401 numeric_name[3] = ((plmnDesc.mnc >> 8) & 0xf) + '0'; | |
402 numeric_name[4] = ((plmnDesc.mnc >> 4) & 0xf) + '0'; | |
403 if ((plmnDesc.mnc & 0xf) EQ 0xf) | |
404 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
405 else | |
406 numeric_name[5] = ( plmnDesc.mnc & 0xf) + '0'; | |
407 numeric_name[6] = '\0'; | |
408 length=strlen((const char*)plmnDesc.shrtName); | |
409 short_name->len = MINIMUM(SHORT_NAME-1, length); | |
410 memcpy (short_name->data, plmnDesc.shrtName, short_name->len); | |
411 short_name->data[short_name->len] = '\0'; | |
412 short_name->dcs = MFW_ASCII; | |
413 } | |
414 #else | |
415 | |
416 network_entry = cmhMM_FindName ((char *)oper, (T_ACI_CPOL_FRMT) COPS_FRMT_Long); | |
417 if (network_entry NEQ NULL) | |
418 { | |
419 numeric_name[0] = ((network_entry->mcc >> 8) & 0xf) + '0'; | |
420 numeric_name[1] = ((network_entry->mcc >> 4) & 0xf) + '0'; | |
421 numeric_name[2] = ( network_entry->mcc & 0xf) + '0'; | |
422 numeric_name[3] = ((network_entry->mnc >> 8) & 0xf) + '0'; | |
423 numeric_name[4] = ((network_entry->mnc >> 4) & 0xf) + '0'; | |
424 if ((network_entry->mnc & 0xf) EQ 0xf) | |
425 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
426 else | |
427 numeric_name[5] = ( network_entry->mnc & 0xf) + '0'; | |
428 numeric_name[6] = '\0'; | |
429 | |
430 if (network_entry->shrtName) | |
431 { | |
432 short_name->len = MINIMUM(SHORT_NAME-1, strlen((char *)network_entry->shrtName)); | |
433 memcpy (short_name->data, network_entry->shrtName, short_name->len); | |
434 short_name->data[short_name->len] = '\0'; | |
435 short_name->dcs = MFW_ASCII; | |
436 } | |
437 } | |
438 #endif | |
439 break; | |
440 | |
441 case COPS_FRMT_Short: | |
442 if (oper) | |
443 { | |
444 UBYTE length=strlen((const char *)oper); | |
445 short_name->len = MINIMUM(SHORT_NAME-1, length); | |
446 memcpy (short_name->data, oper, short_name->len); | |
447 short_name->data[short_name->len] = '\0'; | |
448 short_name->dcs = MFW_ASCII; | |
449 } | |
450 #ifndef NEPTUNE_BOARD | |
451 found = cmhMM_FindName (&plmnDesc, (char *)oper, CPOL_FRMT_Short); /*a0393213 compiler warnings removal - COPS_FRMT_Short changed to CPOL_FRMT_Short*/ | |
452 if (found) | |
453 { | |
454 UBYTE length; | |
455 numeric_name[0] = ((plmnDesc.mcc >> 8) & 0xf) + '0'; | |
456 numeric_name[1] = ((plmnDesc.mcc >> 4) & 0xf) + '0'; | |
457 numeric_name[2] = ( plmnDesc.mcc & 0xf) + '0'; | |
458 numeric_name[3] = ((plmnDesc.mnc >> 8) & 0xf) + '0'; | |
459 numeric_name[4] = ((plmnDesc.mnc >> 4) & 0xf) + '0'; | |
460 if ((plmnDesc.mnc & 0xf) EQ 0xf) | |
461 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
462 else | |
463 numeric_name[5] = ( plmnDesc.mnc & 0xf) + '0'; | |
464 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
465 length=strlen((const char*)plmnDesc.longName); | |
466 long_name->len = MINIMUM(LONG_NAME-1, length); | |
467 memcpy (long_name->data, plmnDesc.longName, long_name->len); | |
468 long_name->data[long_name->len] = '\0'; | |
469 long_name->dcs = MFW_ASCII; | |
470 } | |
471 #else | |
472 network_entry = cmhMM_FindName ((char *)oper, (T_ACI_CPOL_FRMT)COPS_FRMT_Short); | |
473 if (network_entry NEQ NULL) | |
474 { | |
475 numeric_name[0] = ((network_entry->mcc >> 8) & 0xf) + '0'; | |
476 numeric_name[1] = ((network_entry->mcc >> 4) & 0xf) + '0'; | |
477 numeric_name[2] = ( network_entry->mcc & 0xf) + '0'; | |
478 numeric_name[3] = ((network_entry->mnc >> 8) & 0xf) + '0'; | |
479 numeric_name[4] = ((network_entry->mnc >> 4) & 0xf) + '0'; | |
480 if ((network_entry->mnc & 0xf) EQ 0xf) | |
481 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
482 else | |
483 numeric_name[5] = ( network_entry->mnc & 0xf) + '0'; | |
484 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
485 | |
486 if (network_entry->longName) | |
487 { | |
488 long_name->len = MINIMUM(LONG_NAME-1, strlen((char *)network_entry->longName)); | |
489 memcpy (long_name->data, network_entry->longName, long_name->len); | |
490 long_name->data[long_name->len] = '\0'; | |
491 long_name->dcs = MFW_ASCII; | |
492 } | |
493 } | |
494 #endif | |
495 break; | |
496 } | |
497 } | |
498 #else | |
499 GLOBAL void sAT_PlusCOPSE(UBYTE *oper, UBYTE format, UBYTE *long_name, | |
500 UBYTE *short_name, UBYTE *numeric_name) | |
501 { | |
502 #ifndef NEPTUNE_BOARD | |
503 T_OPER_ENTRY plmnDesc; | |
504 BOOL found; | |
505 #else | |
506 T_OPER_NTRY * network_entry; | |
507 #endif | |
508 | |
509 TRACE_FUNCTION ("sAT_PlusCOPSE()"); | |
510 | |
511 strcpy ((char *)long_name, ""); | |
512 strcpy ((char *)short_name, ""); | |
513 strcpy ((char *)numeric_name, ""); | |
514 | |
515 switch (format) | |
516 { | |
517 case COPS_FRMT_Numeric: | |
518 #ifndef NEPTUNE_BOARD | |
519 strcpy ((char *)numeric_name, (char *)oper); | |
520 found = cmhMM_FindNumeric (&plmnDesc, (char *)oper); | |
521 if (found) | |
522 { | |
523 strncpy ((char *)long_name, plmnDesc.longName, LONG_NAME-1); | |
524 long_name[LONG_NAME-1] = '\0'; | |
525 | |
526 strncpy ((char *)short_name, plmnDesc.shrtName, SHORT_NAME-1); | |
527 short_name[SHORT_NAME-1] = '\0'; | |
528 } | |
529 #else | |
530 strcpy ((char *)numeric_name, (char *)oper); | |
531 network_entry = cmhMM_FindNumeric ((char *)oper); | |
532 if (network_entry NEQ NULL) | |
533 { | |
534 if (network_entry->longName) | |
535 { | |
536 strncpy ((char *)long_name, (char *)network_entry->longName, LONG_NAME-1); | |
537 long_name[LONG_NAME-1] = '\0'; | |
538 } | |
539 if (network_entry->shrtName) | |
540 { | |
541 strncpy ((char *)short_name, (char *)network_entry->shrtName, SHORT_NAME-1); | |
542 short_name[SHORT_NAME-1] = '\0'; | |
543 } | |
544 } | |
545 #endif | |
546 break; | |
547 | |
548 case COPS_FRMT_Long: | |
549 if (oper) | |
550 { | |
551 strncpy ((char *)long_name, (char *)oper, LONG_NAME-1); | |
552 long_name[LONG_NAME-1] = '\0'; | |
553 } | |
554 #ifndef NEPTUNE_BOARD | |
555 found = cmhMM_FindName (&plmnDesc, (char *)oper, COPS_FRMT_Long); | |
556 if (found) | |
557 { | |
558 numeric_name[0] = ((plmnDesc.mcc >> 8) & 0xf) + '0'; | |
559 numeric_name[1] = ((plmnDesc.mcc >> 4) & 0xf) + '0'; | |
560 numeric_name[2] = ( plmnDesc.mcc & 0xf) + '0'; | |
561 numeric_name[3] = ((plmnDesc.mnc >> 8) & 0xf) + '0'; | |
562 numeric_name[4] = ((plmnDesc.mnc >> 4) & 0xf) + '0'; | |
563 if ((plmnDesc.mnc & 0xf) EQ 0xf) | |
564 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
565 else | |
566 numeric_name[5] = ( plmnDesc.mnc & 0xf) + '0'; | |
567 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
568 | |
569 strncpy ((char *)short_name, plmnDesc.shrtName, SHORT_NAME-1); | |
570 short_name[SHORT_NAME-1] = '\0'; | |
571 } | |
572 #else | |
573 network_entry = cmhMM_FindName ((char *)oper, COPS_FRMT_Long); | |
574 if (network_entry NEQ NULL) | |
575 { | |
576 numeric_name[0] = ((network_entry->mcc >> 8) & 0xf) + '0'; | |
577 numeric_name[1] = ((network_entry->mcc >> 4) & 0xf) + '0'; | |
578 numeric_name[2] = ( network_entry->mcc & 0xf) + '0'; | |
579 numeric_name[3] = ((network_entry->mnc >> 8) & 0xf) + '0'; | |
580 numeric_name[4] = ((network_entry->mnc >> 4) & 0xf) + '0'; | |
581 if ((network_entry->mnc & 0xf) EQ 0xf) | |
582 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
583 else | |
584 numeric_name[5] = ( network_entry->mnc & 0xf) + '0'; | |
585 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
586 | |
587 if (network_entry->shrtName) | |
588 { | |
589 strncpy ((char *)short_name, (char *)network_entry->shrtName, SHORT_NAME-1); | |
590 short_name[SHORT_NAME-1] = '\0'; | |
591 } | |
592 } | |
593 #endif | |
594 break; | |
595 | |
596 case COPS_FRMT_Short: | |
597 if (oper) | |
598 { | |
599 strncpy ((char *)short_name, (char *)oper, SHORT_NAME-1); | |
600 short_name[SHORT_NAME-1] = '\0'; | |
601 } | |
602 #ifndef NEPTUNE_BOARD | |
603 found = cmhMM_FindName (&plmnDesc, (char *)oper, COPS_FRMT_Short); | |
604 if (found) | |
605 { | |
606 numeric_name[0] = ((plmnDesc.mcc >> 8) & 0xf) + '0'; | |
607 numeric_name[1] = ((plmnDesc.mcc >> 4) & 0xf) + '0'; | |
608 numeric_name[2] = ( plmnDesc.mcc & 0xf) + '0'; | |
609 numeric_name[3] = ((plmnDesc.mnc >> 8) & 0xf) + '0'; | |
610 numeric_name[4] = ((plmnDesc.mnc >> 4) & 0xf) + '0'; | |
611 if ((plmnDesc.mnc & 0xf) EQ 0xf) | |
612 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
613 else | |
614 numeric_name[5] = ( plmnDesc.mnc & 0xf) + '0'; | |
615 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
616 | |
617 strncpy ((char *)long_name, plmnDesc.longName, LONG_NAME-1); | |
618 long_name[LONG_NAME-1] = '\0'; | |
619 } | |
620 #else | |
621 network_entry = cmhMM_FindName ((char *)oper, COPS_FRMT_Short); | |
622 if (network_entry NEQ NULL) | |
623 { | |
624 numeric_name[0] = ((network_entry->mcc >> 8) & 0xf) + '0'; | |
625 numeric_name[1] = ((network_entry->mcc >> 4) & 0xf) + '0'; | |
626 numeric_name[2] = ( network_entry->mcc & 0xf) + '0'; | |
627 numeric_name[3] = ((network_entry->mnc >> 8) & 0xf) + '0'; | |
628 numeric_name[4] = ((network_entry->mnc >> 4) & 0xf) + '0'; | |
629 if ((network_entry->mnc & 0xf) EQ 0xf) | |
630 numeric_name[5] = '\0'; /* 2-digit-MNC */ | |
631 else | |
632 numeric_name[5] = ( network_entry->mnc & 0xf) + '0'; | |
633 numeric_name[6] = '\0'; /* 3-digit-MNC */ | |
634 | |
635 if (network_entry->longName) | |
636 { | |
637 strncpy ((char *)long_name, (char *)network_entry->longName, LONG_NAME-1); | |
638 long_name[LONG_NAME-1] = '\0'; | |
639 } | |
640 } | |
641 #endif | |
642 break; | |
643 } | |
644 } | |
645 #endif | |
646 | |
647 /* | |
648 +--------------------------------------------------------------------+ | |
649 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
650 | STATE : code ROUTINE: sAT_PlusCREGE | | |
651 +--------------------------------------------------------------------+ | |
652 | |
653 PURPOSE : Request NREG cause. | |
654 | |
655 */ | |
656 | |
657 #ifdef FF_2TO1_PS | |
658 GLOBAL T_CAUSE_ps_cause sAT_PlusCREGE (void) | |
659 { | |
660 TRACE_FUNCTION ("sAT_PlusCREGE()"); | |
661 | |
662 return nm_aci_data.nreg_cause; | |
663 } | |
664 #else | |
665 GLOBAL USHORT sAT_PlusCREGE (void) | |
666 { | |
667 TRACE_FUNCTION ("sAT_PlusCREGE()"); | |
668 | |
669 return nm_aci_data.nreg_cause; | |
670 } | |
671 #endif | |
672 | |
673 /* | |
674 +--------------------------------------------------------------------+ | |
675 | PROJECT: MMI-Framework (8417) MODULE: MFW_NMA | | |
676 | STATE : code ROUTINE: sAT_PlusCOPSF | | |
677 +--------------------------------------------------------------------+ | |
678 | |
679 PURPOSE : Request fieldstrength and forbidden indicator for | |
680 PLMN list. | |
681 | |
682 */ | |
683 | |
684 GLOBAL void sAT_PlusCOPSF(UBYTE ** forbidden_id, UBYTE ** fieldstrength) | |
685 { | |
686 TRACE_FUNCTION ("sAT_PlusCOPSF()"); | |
687 | |
688 *forbidden_id = nm_aci_data.forbidden_id; | |
689 *fieldstrength = nm_aci_data.fieldstrength; | |
690 } | |
691 |