FreeCalypso > hg > fc-magnetite
comparison src/ui3/mfw/Mfw_em.c @ 420:e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 21 Jan 2018 03:09:00 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
419:59143cd42ec7 | 420:e8ddbb0837ed |
---|---|
1 /* | |
2 +--------------------------------------------------------------------+ | |
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_em.c $| | |
4 | $Author:: MC $ CONDAT UK $Revision:: 1 $| | |
5 | CREATED: 23.09.02 $| | |
6 | STATE : code | | |
7 +--------------------------------------------------------------------+ | |
8 | |
9 MODULE : MFW_EM | |
10 | |
11 PURPOSE : Engineering Mode functions | |
12 | |
13 */ | |
14 | |
15 /* | |
16 ********************************Include Files********************************************** | |
17 **/ | |
18 | |
19 #define ENTITY_MFW | |
20 | |
21 | |
22 #include <string.h> | |
23 #include <stdio.h> | |
24 #include <stdlib.h> | |
25 | |
26 #include "typedefs.h" | |
27 #include "vsi.h" | |
28 #include "pei.h" | |
29 #include "custom.h" | |
30 #include "gsm.h" | |
31 | |
32 #ifndef PCM_2_FFS | |
33 #include "pcm.h" | |
34 #endif | |
35 | |
36 #ifndef NEPTUNE_BOARD | |
37 #include "ffs/ffs.h" | |
38 #else | |
39 #include "ffs.h" | |
40 #endif | |
41 | |
42 #include "message.h" | |
43 #include "prim.h" | |
44 #include "aci_cmh.h" | |
45 #if defined (FAX_AND_DATA) | |
46 #include "aci_fd.h" | |
47 #endif | |
48 | |
49 #ifdef GPRS | |
50 #include "gprs.h" | |
51 #endif | |
52 #include "dti_conn_mng.h" | |
53 #include "phb.h" | |
54 #include "psa.h" | |
55 #include "cmh.h" | |
56 #include "cmh_phb.h" | |
57 #include "psa.h" | |
58 #include "psa_sim.h" | |
59 #include "cus_aci.h" | |
60 #include "cmh_mm.h" | |
61 #include "cmh_sim.h" | |
62 #include "Mfw_em.h" | |
63 #include "aci_em.h" | |
64 #include "mfw_win.h" | |
65 | |
66 #ifdef NEPTUNE_BOARD /*EngMode */ | |
67 #include "Aci_cmh.h" | |
68 #endif | |
69 | |
70 #ifdef NEPTUNE_BOARD | |
71 T_ENG_INFO_REQ* Eng_Info_Req; /*EngMode */ | |
72 T_ENG_INFO_STATIC_REQ* Eng_Info_Static_Req; | |
73 | |
74 int EmType = NULL; | |
75 #endif | |
76 | |
77 #define ASCII_OFFSET 0x30 /*SPR 1554*/ | |
78 | |
79 /* | |
80 ********************************Internal data types********************************************** | |
81 **/ | |
82 | |
83 #ifndef NEPTUNE_BOARD | |
84 typedef union | |
85 { | |
86 MFW_EM_Mobile_Info MobileInfo; | |
87 MFW_EM_Serving_Cell_Parameters SCInfo; | |
88 MFW_EM_Neighbour_Cell_Parameters NCInfo; | |
89 MFW_EM_Location_Parameters LocInfo; | |
90 MFW_EM_Ciph_hop_DTX_Parameters CHDTXInfo; | |
91 MFW_EM_GPRS_Parameter GPRSInfo; | |
92 } | |
93 T_MFW_EM_PARA; | |
94 #endif | |
95 | |
96 typedef struct | |
97 { | |
98 T_MFW_EVENT emask; /* events of interest */ | |
99 T_MFW_EVENT event; /* current event */ | |
100 T_MFW_CB handler; | |
101 #ifndef NEPTUNE_BOARD | |
102 T_MFW_EM_PARA para; | |
103 #endif | |
104 | |
105 } T_MFW_EM; | |
106 /* | |
107 ********************************Global variables********************************************** | |
108 **/ | |
109 | |
110 #ifndef NEPTUNE_BOARD | |
111 MFW_EM_Data* MfwEmData= NULL; | |
112 #endif | |
113 | |
114 EXTERN MfwHdr *current_mfw_elem; | |
115 | |
116 /* | |
117 ********************************Prototypes********************************************** | |
118 **/ | |
119 | |
120 #ifndef NEPTUNE_BOARD | |
121 int Mfw_em_sign_exec(T_MFW_HDR * hdr, T_MFW_EVENT event,T_MFW_EM_PARA *para); | |
122 #else /*if NEPTUNE BOARD*/ | |
123 int Mfw_em_sign_exec(T_MFW_HDR * hdr, T_MFW_EVENT event,int* dummy); | |
124 #endif | |
125 void Mfw_em_signal(MfwEvt event, void *para); | |
126 | |
127 #ifndef NEPTUNE_BOARD /*EngMode */ | |
128 void Mfw_em_cb(T_DRV_SIGNAL_EM* signal); | |
129 #endif | |
130 static int emCommand (U32 cmd, void *h); | |
131 | |
132 /**************************************Public Functions*****************************************/ | |
133 | |
134 /* | |
135 +--------------------------------------------------------------------+ | |
136 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
137 | STATE : code ROUTINE : Mfw_em_init | | |
138 +--------------------------------------------------------------------+ | |
139 | |
140 PURPOSE : initialise module | |
141 | |
142 */ | |
143 int Mfw_em_init(void) | |
144 { TRACE_EVENT("Mfw_em_init()"); | |
145 #ifndef NEPTUNE_BOARD | |
146 em_Init(Mfw_em_cb, NULL); /*init EM driver*/ | |
147 #endif /* NEPTUNE_BOARD */ | |
148 mfwCommand[MfwTypEm] = (MfwCb) emCommand; | |
149 return TRUE; | |
150 } | |
151 | |
152 /* | |
153 +--------------------------------------------------------------------+ | |
154 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
155 | STATE : code ROUTINE : Mfw_em_create | | |
156 +--------------------------------------------------------------------+ | |
157 | |
158 PURPOSE : binds passed callback function to event mask | |
159 | |
160 */ | |
161 MfwHnd Mfw_em_create(MfwHnd hWin, MfwEvt event, MfwCb cb_func) | |
162 { | |
163 MfwHdr *hdr; | |
164 T_MFW_EM *em_para; | |
165 | |
166 TRACE_EVENT("em_create()"); | |
167 | |
168 hdr = (MfwHdr *) mfwAlloc(sizeof(MfwHdr)); | |
169 em_para = (T_MFW_EM *) mfwAlloc(sizeof(T_MFW_EM)); | |
170 | |
171 if (!hdr || !em_para) | |
172 return 0; | |
173 | |
174 em_para->emask = event; | |
175 em_para->handler = cb_func; | |
176 | |
177 hdr->data = em_para; | |
178 hdr->type = MfwTypEm; | |
179 | |
180 return mfwInsert((MfwHdr *) hWin,hdr); | |
181 } | |
182 | |
183 /* | |
184 +--------------------------------------------------------------------+ | |
185 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
186 | STATE : code ROUTINE : Mfw_em_exit | | |
187 +--------------------------------------------------------------------+ | |
188 | |
189 PURPOSE : exit module | |
190 | |
191 */ | |
192 void Mfw_em_exit(void) | |
193 { TRACE_EVENT("Mfw_em_exit()"); | |
194 #ifndef NEPTUNE_BOARD | |
195 if (MfwEmData != NULL) | |
196 mfwFree((void*)MfwEmData, sizeof(MFW_EM_Data)); | |
197 | |
198 em_Exit(); | |
199 #endif | |
200 } | |
201 /* | |
202 +--------------------------------------------------------------------+ | |
203 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
204 | STATE : code ROUTINE : Mfw_em_get_data | | |
205 +--------------------------------------------------------------------+ | |
206 | |
207 PURPOSE : requests data from ACI EM driver | |
208 | |
209 */ | |
210 int Mfw_em_get_data(MfwEmDataType type) | |
211 { | |
212 TRACE_EVENT("Mfw_em_get_data()"); | |
213 | |
214 #ifdef NEPTUNE_BOARD | |
215 EmType = type; | |
216 #endif | |
217 | |
218 #ifndef NEPTUNE_BOARD /* EngMode */ | |
219 | |
220 #ifndef _EM_MMI_MFW_TEST | |
221 /*If not already allocated, Allocate memory to store data in*/ | |
222 if (MfwEmData == NULL) | |
223 if ((MfwEmData = (MFW_EM_Data*)mfwAlloc(sizeof(MFW_EM_Data))) == NULL) | |
224 return FALSE; | |
225 /*Request appropriate data from Em driver*/ | |
226 switch(type) | |
227 { | |
228 case EM_MOBILE_INFO: | |
229 /*MC SPR 1554, added call to request software version and identity param*/ | |
230 em_Read_Data_Parameter(EM_CLASS_MOBILE_DATA, EM_SUBCLASS_SW_VERSION, 1,Mfw_em_cb); | |
231 em_Read_Data_Parameter(EM_CLASS_MOBILE_DATA,EM_SUBCLASS_ID, 1, Mfw_em_cb); | |
232 break; | |
233 case EM_SERVING_CELL_PARAMS: | |
234 em_Read_Data_Parameter(EM_CLASS_INFRA_DATA, EM_SUBCLASS_SC, 1, Mfw_em_cb); | |
235 break; | |
236 case EM_NEIGHBOURING_CELL_PARAMS: | |
237 em_Read_Data_Parameter(EM_CLASS_INFRA_DATA, EM_SUBCLASS_SC, 1, Mfw_em_cb); | |
238 em_Read_Data_Parameter(EM_CLASS_INFRA_DATA, EM_SUBCLASS_NC, 1, Mfw_em_cb); | |
239 break; | |
240 case EM_LOCATION_PARAMS: | |
241 em_Read_Data_Parameter(EM_CLASS_INFRA_DATA, EM_SUBCLASS_LOC_PAG, 1, Mfw_em_cb); | |
242 em_Read_Data_Parameter(EM_CLASS_INFRA_DATA, EM_SUBCLASS_SC, 1, Mfw_em_cb); | |
243 break; | |
244 case EM_CIPH_HOP_DTX_PARAMS: | |
245 em_Read_Data_Parameter(EM_CLASS_INFRA_DATA, EM_SUBCLASS_CIPH_HOP_DTX, 1, Mfw_em_cb); | |
246 break; | |
247 case EM_GPRS_PARAMS: | |
248 em_Read_Data_Parameter(EM_CLASS_INFRA_DATA, EM_SUBCLASS_SC_GPRS, 1, Mfw_em_cb); | |
249 break; | |
250 } | |
251 return TRUE; | |
252 #endif | |
253 | |
254 | |
255 | |
256 #ifdef _EM_MMI_MFW_TEST | |
257 /*Test harness, just returns made-up data to MMI*/ | |
258 if (MfwEmData == NULL) | |
259 if ((MfwEmData = (MFW_EM_Data*)mfwAlloc(sizeof(MFW_EM_Data))) == NULL) | |
260 return FALSE; | |
261 switch(type) | |
262 { | |
263 case EM_MOBILE_INFO: | |
264 { //MfwEmData->MobileInfo.software_version = 0x44; | |
265 strcpy(MfwEmData->MobileInfo.IMEI, "123456789ABC"); | |
266 strcpy(MfwEmData->MobileInfo.IMSI, "123456789ABC"); | |
267 MfwEmData->MobileInfo.TMSI = 76; | |
268 Mfw_em_signal(EM_MOBILE_INFO, (void*)&MfwEmData->MobileInfo); | |
269 } | |
270 break; | |
271 case EM_SERVING_CELL_PARAMS: | |
272 { | |
273 MfwEmData->SCInfo.arfcn= 0x44; | |
274 MfwEmData->SCInfo.RSSI= 86; | |
275 MfwEmData->SCInfo.RXQ = 67; | |
276 MfwEmData->SCInfo.RLT = 67; | |
277 Mfw_em_signal(EM_SERVING_CELL_PARAMS, (void*)&MfwEmData->SCInfo); | |
278 } | |
279 break; | |
280 case EM_NEIGHBOURING_CELL_PARAMS: | |
281 { MfwEmData->NCInfo.NUM= 0x05; | |
282 strcpy((char*)MfwEmData->NCInfo.arfcn, "WERTYUIOPAS"); | |
283 strcpy((char*)MfwEmData->NCInfo.RSSI, "12345"); | |
284 | |
285 Mfw_em_signal(EM_NEIGHBOURING_CELL_PARAMS, (void*)&MfwEmData->NCInfo); | |
286 | |
287 } | |
288 break; | |
289 case EM_LOCATION_PARAMS: | |
290 { strcpy((char*)MfwEmData->LocInfo.MCC, "123"); | |
291 strcpy((char*)MfwEmData->LocInfo.MNC, "456"); | |
292 MfwEmData->LocInfo.LAC = 12345; | |
293 MfwEmData->LocInfo.CI = 12045; | |
294 | |
295 Mfw_em_signal(EM_LOCATION_PARAMS, (void*)&MfwEmData->LocInfo); | |
296 | |
297 } | |
298 break; | |
299 case EM_GPRS_PARAMS: | |
300 { MfwEmData->GPRSInfo.ULS= 0; | |
301 MfwEmData->GPRSInfo.DLS= 0; | |
302 MfwEmData->GPRSInfo.coding_scheme = 0; | |
303 Mfw_em_signal(EM_GPRS_PARAMS, (void*)&MfwEmData->GPRSInfo); | |
304 | |
305 } | |
306 break; | |
307 case EM_CIPH_HOP_DTX_PARAMS: | |
308 { MfwEmData->CHDTXInfo.ciph_status= 0; | |
309 MfwEmData->CHDTXInfo.hopping_channels= 0; | |
310 MfwEmData->CHDTXInfo.DTX_status = 1; | |
311 Mfw_em_signal(EM_CIPH_HOP_DTX_PARAMS, (void*)&MfwEmData->CHDTXInfo); | |
312 | |
313 } | |
314 break; | |
315 } | |
316 return TRUE; | |
317 #endif | |
318 | |
319 #endif | |
320 } | |
321 | |
322 /***********************************************Private functions:********************************/ | |
323 /* | |
324 +--------------------------------------------------------------------+ | |
325 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
326 | STATE : code ROUTINE : emCommand | | |
327 +--------------------------------------------------------------------+ | |
328 | |
329 PURPOSE : handle mfw windows command | |
330 | |
331 */ | |
332 | |
333 static int emCommand (U32 cmd, void *h) | |
334 {TRACE_EVENT("emCommand()"); | |
335 switch (cmd) | |
336 { | |
337 case MfwCmdDelete: /* delete me */ | |
338 if (!h) | |
339 return 0; | |
340 em_delete(h); | |
341 return 1; | |
342 default: | |
343 break; | |
344 } | |
345 | |
346 return 0; | |
347 } | |
348 | |
349 /* | |
350 +--------------------------------------------------------------------+ | |
351 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
352 | STATE : code ROUTINE : em_delete | | |
353 +--------------------------------------------------------------------+ | |
354 | |
355 PURPOSE : delete EM event handler | |
356 | |
357 */ | |
358 | |
359 MfwRes em_delete (MfwHnd h) | |
360 { | |
361 TRACE_EVENT("em_delete()"); | |
362 | |
363 if (!h || !((MfwHdr *) h)->data) | |
364 return MfwResIllHnd; | |
365 | |
366 if (!mfwRemove((MfwHdr *) h)) | |
367 return MfwResIllHnd; | |
368 | |
369 mfwFree((U8 *) ((MfwHdr *) h)->data,sizeof(T_MFW_EM)); | |
370 mfwFree((U8 *) h,sizeof(MfwHdr)); | |
371 | |
372 return MfwResOk; | |
373 } | |
374 /* | |
375 +--------------------------------------------------------------------+ | |
376 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
377 | STATE : code ROUTINE : Mfw_em_sign_exec | | |
378 +--------------------------------------------------------------------+ | |
379 | |
380 PURPOSE : send event to MMI | |
381 | |
382 */ | |
383 #ifndef NEPTUNE_BOARD | |
384 int Mfw_em_sign_exec(T_MFW_HDR * cur_elem, T_MFW_EVENT event,T_MFW_EM_PARA *para) | |
385 { | |
386 TRACE_EVENT("Mfw_em_sign_exec()"); | |
387 | |
388 while (cur_elem) | |
389 { | |
390 if (cur_elem->type == MfwTypEm) | |
391 { | |
392 T_MFW_EM *em_data; | |
393 em_data = (T_MFW_EM *) cur_elem->data; | |
394 if (em_data->emask & event) | |
395 { | |
396 em_data->event = event; | |
397 switch (event) | |
398 { | |
399 case EM_MOBILE_INFO: | |
400 memcpy(&em_data->para.MobileInfo, | |
401 para,sizeof(MFW_EM_Mobile_Info)); | |
402 break; | |
403 | |
404 case EM_SERVING_CELL_PARAMS: | |
405 memcpy(&em_data->para.SCInfo, | |
406 para,sizeof(MFW_EM_Serving_Cell_Parameters)); | |
407 break; | |
408 case EM_NEIGHBOURING_CELL_PARAMS: | |
409 memcpy(&em_data->para.NCInfo, | |
410 para,sizeof(MFW_EM_Neighbour_Cell_Parameters)); | |
411 break; | |
412 | |
413 case EM_LOCATION_PARAMS: | |
414 memcpy(&em_data->para.LocInfo, | |
415 para,sizeof(MFW_EM_Location_Parameters)); | |
416 break; | |
417 case EM_CIPH_HOP_DTX_PARAMS: | |
418 memcpy(&em_data->para.CHDTXInfo, | |
419 para,sizeof(MFW_EM_Ciph_hop_DTX_Parameters)); | |
420 break; | |
421 | |
422 case EM_GPRS_PARAMS: | |
423 memcpy(&em_data->para.GPRSInfo, | |
424 para,sizeof(MFW_EM_GPRS_Parameter)); | |
425 break; | |
426 } | |
427 if (em_data->handler) | |
428 { | |
429 | |
430 // store current mfw elem | |
431 current_mfw_elem = cur_elem; | |
432 | |
433 if ((*(em_data->handler))(em_data->event, | |
434 (void *) &em_data->para)) | |
435 return TRUE; | |
436 } | |
437 } | |
438 } | |
439 cur_elem = cur_elem->next; | |
440 } | |
441 | |
442 return FALSE; | |
443 | |
444 | |
445 } | |
446 | |
447 #else /* if NEPTUNE BOARD*/ | |
448 int Mfw_em_sign_exec(T_MFW_HDR * cur_elem, T_MFW_EVENT event, int* dummy) | |
449 { | |
450 TRACE_EVENT("Mfw_em_sign_exec()"); | |
451 | |
452 while (cur_elem) | |
453 { | |
454 if (cur_elem->type == MfwTypEm) | |
455 { | |
456 T_MFW_EM *em_data; | |
457 em_data = (T_MFW_EM *) cur_elem->data; | |
458 em_data->event = event; | |
459 if (em_data->handler) | |
460 { | |
461 // store current mfw elem | |
462 current_mfw_elem = cur_elem; | |
463 | |
464 if ((*(em_data->handler))(em_data->event, | |
465 (void *) &dummy)) | |
466 return TRUE; | |
467 } | |
468 } | |
469 cur_elem = cur_elem->next; | |
470 } | |
471 | |
472 return FALSE; | |
473 | |
474 | |
475 } | |
476 | |
477 #endif | |
478 /* | |
479 +--------------------------------------------------------------------+ | |
480 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
481 | STATE : code ROUTINE : Mfw_em_signal | | |
482 +--------------------------------------------------------------------+ | |
483 | |
484 PURPOSE : sends event to MMi via Mfw_em_sign_exec() | |
485 | |
486 */ | |
487 void Mfw_em_signal(MfwEvt event, void *para) | |
488 { | |
489 UBYTE temp = dspl_Enable(0); | |
490 TRACE_EVENT ("em_signal()"); | |
491 | |
492 if (mfwSignallingMethod EQ 0) | |
493 { | |
494 if (mfwFocus) | |
495 if (Mfw_em_sign_exec(mfwFocus,event,para)) | |
496 { | |
497 dspl_Enable(temp); | |
498 return; | |
499 } | |
500 if (mfwRoot) | |
501 Mfw_em_sign_exec(mfwRoot,event,para); | |
502 } | |
503 else | |
504 { | |
505 MfwHdr * h = 0; | |
506 | |
507 /* | |
508 * Focus set, then start here | |
509 */ | |
510 if (mfwFocus) | |
511 h = mfwFocus; | |
512 /* | |
513 * Focus not set, then start root | |
514 */ | |
515 if (!h) | |
516 h = mfwRoot; | |
517 | |
518 /* | |
519 * No elements available, return | |
520 */ | |
521 | |
522 while (h) | |
523 | |
524 | |
525 { | |
526 /* | |
527 * Signal consumed, then return | |
528 */ | |
529 if (Mfw_em_sign_exec (h, event, para)) | |
530 { | |
531 dspl_Enable(temp); | |
532 return; | |
533 } | |
534 | |
535 /* | |
536 * All windows tried inclusive root | |
537 */ | |
538 if (h == mfwRoot) | |
539 { | |
540 dspl_Enable(temp); | |
541 return; | |
542 } | |
543 | |
544 /* | |
545 * get parent window | |
546 */ | |
547 h = mfwParent(mfwParent(h)); | |
548 if(h) | |
549 h = ((MfwWin * )(h->data))->elems; | |
550 } | |
551 Mfw_em_sign_exec (mfwRoot, event, para); | |
552 } | |
553 dspl_Enable(temp); | |
554 return; | |
555 | |
556 | |
557 } | |
558 | |
559 #ifndef NEPTUNE_BOARD /*EngMode */ | |
560 /* | |
561 +--------------------------------------------------------------------+ | |
562 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
563 | STATE : code ROUTINE : Mfw_em_cb | | |
564 +--------------------------------------------------------------------+ | |
565 | |
566 PURPOSE : Handles events from the ACI EM driver | |
567 | |
568 */ | |
569 void Mfw_em_cb(T_DRV_SIGNAL_EM* signal) | |
570 { | |
571 TRACE_EVENT_P1("Mfw_em_cb, signalType: %d", signal->SignalType); | |
572 | |
573 switch(signal->SignalType) | |
574 { | |
575 case EM_SUBCLASS_SC: | |
576 { /*copy Serving Cell Information to appropriate data structure*/ | |
577 | |
578 T_EM_SC_INFO_CNF *serv_cell = (T_EM_SC_INFO_CNF*)&signal->UserData.sc; | |
579 | |
580 MfwEmData->SCInfo.arfcn = serv_cell->arfcn; | |
581 MfwEmData->SCInfo.RSSI = serv_cell->rxlev; | |
582 MfwEmData->SCInfo.RXQ = serv_cell->rxqual_f; | |
583 MfwEmData->SCInfo.RLT = serv_cell->rlt; | |
584 MfwEmData->SCInfo.C1 = serv_cell->c1; | |
585 MfwEmData->SCInfo.C2 = serv_cell->c2; | |
586 MfwEmData->SCInfo.BSIC = serv_cell->bsic; | |
587 MfwEmData->SCInfo.TAV = serv_cell->tav; | |
588 MfwEmData->SCInfo.LAC = serv_cell->lac; | |
589 | |
590 MfwEmData->NCInfo.arfcn[6] = MfwEmData->SCInfo.arfcn; | |
591 MfwEmData->NCInfo.RSSI[6] = MfwEmData->SCInfo.RSSI; | |
592 MfwEmData->NCInfo.C2[6] = MfwEmData->SCInfo.C2; | |
593 MfwEmData->NCInfo.LAC_NC[6] = MfwEmData->SCInfo.LAC; | |
594 MfwEmData->NCInfo.BSIC_NC[6] = MfwEmData->SCInfo.BSIC; | |
595 | |
596 /* copy Location Info*/ | |
597 MfwEmData->LocInfo.LAC = serv_cell->lac; | |
598 | |
599 /*send event to MMI*/ | |
600 Mfw_em_signal(EM_SERVING_CELL_PARAMS, (void*)&MfwEmData->SCInfo); | |
601 } | |
602 break; | |
603 case EM_SUBCLASS_SC_GPRS: | |
604 { /*MC, SPR 1554 added code to copy NMOinto GPRS data structure*/ | |
605 | |
606 T_EM_SC_GPRS_INFO_CNF *gprs_info = (T_EM_SC_GPRS_INFO_CNF*)&signal->UserData.sc_gprs; | |
607 | |
608 MfwEmData->GPRSInfo.NMO = gprs_info->nmo; | |
609 MfwEmData->GPRSInfo.NDTS = gprs_info->tn; | |
610 MfwEmData->GPRSInfo.RAC = gprs_info->rac; | |
611 MfwEmData->GPRSInfo.C31 = gprs_info->c31; | |
612 MfwEmData->GPRSInfo.C32 = gprs_info->c32; | |
613 | |
614 Mfw_em_signal(EM_GPRS_PARAMS, (void*)&MfwEmData->GPRSInfo); | |
615 } | |
616 break; | |
617 case EM_SUBCLASS_NC: | |
618 { T_EM_NC_INFO_CNF *neighbour_cell = (T_EM_NC_INFO_CNF*)&signal->UserData.nc; | |
619 MfwEmData->NCInfo.NUM = neighbour_cell->no_ncells; | |
620 memcpy(MfwEmData->NCInfo.arfcn, neighbour_cell->arfcn_nc, 6*sizeof(USHORT)); | |
621 memcpy(MfwEmData->NCInfo.RSSI, neighbour_cell->rxlev_nc, 6*sizeof(UBYTE)); | |
622 memcpy(MfwEmData->NCInfo.C2, neighbour_cell->c2_nc, 6*sizeof(SHORT)); | |
623 memcpy(MfwEmData->NCInfo.LAC_NC, neighbour_cell->lac_nc, 6*sizeof(USHORT)); | |
624 memcpy(MfwEmData->NCInfo.BSIC_NC, neighbour_cell->bsic_nc, 6*sizeof(UBYTE)); | |
625 Mfw_em_signal(EM_NEIGHBOURING_CELL_PARAMS, (void*)&MfwEmData->NCInfo); | |
626 } | |
627 case EM_SUBCLASS_LOC_PAG: | |
628 { MfwEmData->LocInfo.LUP = signal->UserData.log_pag.t3212; | |
629 /*Convert MCC & MNC to ASCII strings from BCD*/ | |
630 utl_BCD2DialStr (signal->UserData.log_pag.mcc, MfwEmData->LocInfo.MCC, 3); | |
631 utl_BCD2DialStr (signal->UserData.log_pag.mnc, MfwEmData->LocInfo.MNC, 3); | |
632 Mfw_em_signal(EM_LOCATION_PARAMS, (void*)&MfwEmData->LocInfo); | |
633 } | |
634 case EM_SUBCLASS_CIPH_HOP_DTX: | |
635 { MfwEmData->CHDTXInfo.ciph_status = signal->UserData.cip.ciph_stat; | |
636 MfwEmData->CHDTXInfo.HSN = signal->UserData.cip.hsn; | |
637 //!!!!!HOPPING CHANNELS!!!!!!!!!!!!!! | |
638 /* memcpy(MfwEmData->CHDTXInfo.ma, signal->UserData.cip.hop_chn.ma, 65); | |
639 if (signal->UserData.cip.hop_chn.v_start) | |
640 { | |
641 memcpy(MfwEmData->CHDTXInfo.ma2, signal->UserData.cip.hop_chn.ma2, 65); | |
642 }*/ | |
643 MfwEmData->CHDTXInfo.DTX_status = signal->UserData.cip.dtx_stat; | |
644 Mfw_em_signal(EM_CIPH_HOP_DTX_PARAMS, (void*)&MfwEmData->CHDTXInfo); | |
645 } | |
646 case EM_SUBCLASS_ID: | |
647 { /*MC, SPR 1554 added conversion of IMEI and IMSI from numbers to ASCII*/ | |
648 | |
649 int i; | |
650 /*convert to ASCII digits*/ | |
651 for (i=0; i < 15; i++) | |
652 { | |
653 MfwEmData->MobileInfo.IMEI[i]= signal->UserData.id.em_imeisv.ident_dig[i] + ASCII_OFFSET; | |
654 MfwEmData->MobileInfo.IMSI[i]=signal->UserData.id.em_imsi.ident_dig[i] +ASCII_OFFSET; | |
655 } | |
656 MfwEmData->MobileInfo.IMEI[15] = NULL; | |
657 MfwEmData->MobileInfo.IMSI[15] = NULL; | |
658 | |
659 MfwEmData->MobileInfo.TMSI = signal->UserData.id.tmsi; | |
660 | |
661 Mfw_em_signal(EM_MOBILE_INFO, (void*)&MfwEmData->MobileInfo); | |
662 } | |
663 case EM_SUBCLASS_SW_VERSION: | |
664 { | |
665 T_EM_SW_VER* sw_ver = &signal->UserData.version; | |
666 memcpy(MfwEmData->MobileInfo.SIM_version, sw_ver->sim, MAX_VER*sizeof(char)); | |
667 memcpy(MfwEmData->MobileInfo.CC_version , sw_ver->cc, MAX_VER*sizeof(char)); | |
668 memcpy(MfwEmData->MobileInfo.SS_version , sw_ver->ss, MAX_VER*sizeof(char)); | |
669 memcpy(MfwEmData->MobileInfo.SMS_version , sw_ver->sms, MAX_VER*sizeof(char)); | |
670 memcpy(MfwEmData->MobileInfo.MM_version, sw_ver->mm, MAX_VER*sizeof(char)); | |
671 memcpy(MfwEmData->MobileInfo.RR_version , sw_ver->rr, MAX_VER*sizeof(char)); | |
672 memcpy(MfwEmData->MobileInfo.DL_version , sw_ver->dl, MAX_VER*sizeof(char)); | |
673 memcpy(MfwEmData->MobileInfo.ALR_version , sw_ver->alr, MAX_VER*sizeof(char)); | |
674 } | |
675 default: | |
676 TRACE_EVENT("Unknown EM data type"); | |
677 | |
678 } | |
679 | |
680 } | |
681 | |
682 #endif | |
683 | |
684 #ifdef NEPTUNE_BOARD | |
685 /* | |
686 +--------------------------------------------------------------------+ | |
687 | PROJECT : MMI-Framework (8417) MODULE : MFW_EM | | |
688 | STATE : code ROUTINE : Mfw_em_response | | |
689 +--------------------------------------------------------------------+ | |
690 | |
691 PURPOSE : sends event to MMi via Mfw_em_sign_exec() | |
692 | |
693 */ | |
694 void Mfw_em_response_EINFO(T_ENG_INFO_REQ *emode_data, | |
695 T_ENG_INFO_STATIC_REQ *emode_static_data) | |
696 { | |
697 int* dummy; | |
698 TRACE_FUNCTION("Mfw_em_response_EINFO()"); | |
699 Eng_Info_Req = emode_data; | |
700 Mfw_em_signal(EmType, (void*)&dummy); | |
701 | |
702 } | |
703 | |
704 void Mfw_em_response_ESINFO(T_ENG_INFO_STATIC_REQ *emode_static_data) | |
705 { | |
706 TRACE_FUNCTION("Mfw_em_response_ESINFO()"); | |
707 Eng_Info_Static_Req = emode_static_data; | |
708 } | |
709 | |
710 | |
711 #endif |