comparison src/ui/bmi/mmiEm.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 c0052fe355d3
comparison
equal deleted inserted replaced
2:3a14ee9a9843 3:67bfe9f274f6
1 /*******************************************************************************
2
3 CONDAT (UK)
4
5 ********************************************************************************
6
7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner.
9
10 ********************************************************************************
11
12 $Project name: Basic MMI
13 $Project code: BMI (6349)
14 $Module: MMI
15 $File: MmiEm.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 23/09/02
20
21 ********************************************************************************
22
23 Description:
24
25 MMI engineering mode handling
26
27 ********************************************************************************
28 $History: MmiEm.c
29
30 Apr 24, 2006 ERT: OMAPS00067603 x0043642
31 Description: Engineering mode
32 Solution: Added new engineering mode functionalities to satisfy Neptune engineering mode
33 requirements.
34
35
36 23/09/02 Original Condat(UK) BMI version.
37
38 $End
39
40
41
42
43 *******************************************************************************
44
45 Include Files
46
47 *******************************************************************************/
48 #define ENTITY_MFW
49
50 /* includes */
51 #include <string.h>
52 #include <stdio.h>
53 #include <stdlib.h>
54
55 #if defined (NEW_FRAME)
56
57 #include "typedefs.h"
58 #include "vsi.h"
59 #include "pei.h"
60 #include "custom.h"
61 #include "gsm.h"
62
63 #else
64
65 #include "STDDEFS.H"
66 #include "custom.h"
67 #include "gsm.h"
68 #include "vsi.h"
69
70 #endif
71 #include "mfw_sys.h"
72
73 #include "prim.h"
74 #include "cus_aci.h"
75
76 #include "mfw_mfw.h"
77 #include "mfw_win.h"
78 #include "mfw_kbd.h"
79 /* SPR#1428 - SH - New Editor changes */
80 #ifndef NEW_EDITOR
81 #include "mfw_edt.h"
82 #endif
83 #include "mfw_lng.h"
84 #include "mfw_tim.h"
85 #include "mfw_icn.h"
86 #include "mfw_mnu.h"
87 #include "mfw_phb.h"
88 #include "mfw_cm.h"
89 #include "mfw_sim.h"
90 #include "mfw_nm.h"
91 #include "mfw_sat.h"
92 #include "mfw_ss.h" /*for convert*/
93 #include "mfw_phb.h"
94 #include "ksd.h"
95 #include "psa.h"
96 #include "mfw_sms.h"
97 #include "mfw_cphs.h"
98 #include "mfw_sat.h"
99 #include "Mfw_band.h"
100 #include "mfw_ffs.h"
101
102 #include "dspl.h"
103
104 #include "MmiMmi.h"
105 #include "MmiDialogs.h"
106 #include "MmiLists.h"
107 #include "MmiBand.h"
108 #include "MmiCPHS.h"
109 /* SPR#1428 - SH - New Editor changes */
110 #ifdef NEW_EDITOR
111 #include "ATBCommon.h"
112 #include "ATBDisplay.h"
113 #include "ATBEditor.h"
114 #include "AUIEditor.h"
115 #else
116 #include "MmiEditor.h"
117 #endif
118 #include"MmiBookShared.h"
119
120
121 #include "Mfw_em.h"
122 #include "MmiEm.h"
123
124 #include "mmiColours.h"
125
126 #ifdef NEPTUNE_BOARD
127 #include "ffs.h"
128 #endif
129
130 #define EM_UPDATE_RATE 1000
131
132 #ifdef NEPTUNE_BOARD
133 #define EM_EDITOR_SIZE 500 /*SPR 1757, increased size of editor buffer*/
134 #else
135 #define EM_EDITOR_SIZE 300 /*SPR 1757, increased size of editor buffer*/
136 #endif
137
138
139 #ifdef NEPTUNE_BOARD /*EngMode */
140 #define SAT_REQUEST_SENT 1
141 #define TIMER_ONE_SEC 1
142 #define TIMER_STOP 0
143
144 EXTERN T_ENG_INFO_REQ* Eng_Info_Req;
145 EXTERN T_ENG_INFO_STATIC_REQ* Eng_Info_Static_Req;
146
147 EXTERN unsigned long *picture_col;
148 EXTERN UBYTE RssiVal;
149
150 int EmRequest = NULL;
151 #endif
152
153 /*
154 **************************************Datatypes****************************************
155 */
156 typedef struct _tEmData_
157 {
158 /* administrative data */
159
160 T_MMI_CONTROL mmi_control;
161 T_MFW_HND win;
162 T_MFW_HND parent_win;
163
164 /* associated handlers */
165
166 T_MFW_HND kbd; /*keyboard handler*/
167 T_MFW_HND tim; /*timer handler*/
168
169 /* SPR#1428 - SH - New Editor changes */
170 #ifdef NEW_EDITOR
171 T_ED_DATA * editor;
172 T_ED_ATTR editor_attr;
173 #else /* NEW_EDITOR */
174 T_MFW_HND edt; /*mfw editor handler*/
175 MfwEdtAttr editor_data; /*editor config data*/
176 #endif /* NEW_EDITOR */
177
178 /* internal data */
179 char edtBuffer[EM_EDITOR_SIZE*2];/*SPR 1757*//*editor contentbuffer*/
180 MfwEmDataType CurrentWindow; /*type of data being displayed*/
181
182 } tEmData;
183
184
185 /*
186 **************************************Prototypes****************************************
187 */
188 int Mmi_em_event_cb(T_MFW_EVENT event, T_MFW_HND para); //Handles events from the MFW
189 T_MFW_HND Mmi_em_create(T_MFW_HND parent_window, MfwEmDataType data_type); //Create a window to display the information, specifying the keyboard, display and timer handlers.
190 void Mmi_em_destroy(T_MFW_HND own_window); //Deallocate window data and delete window.
191 int Mmi_em_kbd_cb(T_MFW_EVENT event,T_MFW_KBD * kc ); //Handles key presses in the display window
192 int Mmi_em_win_cb(T_MFW_EVENT event,T_MFW_WIN * win );// Handles the information display.
193 void Mmi_em_tim_cb(T_MFW_EVENT event,T_MFW_TIM * t); //Handles the timer events.
194
195
196
197
198 /*
199 **************************************Public functions****************************************
200 */
201
202
203 /*******************************************************************************
204
205 $Function: mmi_em_init()
206
207 $Description: initialise Engineering Mode module
208
209 $Returns: None
210
211 $Arguments: None
212
213 *******************************************************************************/
214 void mmi_em_init(void)
215 {
216 Mfw_em_init();
217
218 }
219
220 /*******************************************************************************
221
222 $Function: mmi_em_enit()
223
224 $Description: exit Engineering Mode module
225
226 $Returns: None
227
228 $Arguments: None
229
230 *******************************************************************************/
231 void mmi_em_exit(void)
232 {
233 Mfw_em_exit();
234 }
235
236 //#ifdef TI_PS_FF_EM
237 #if defined (TI_PS_FF_EM) || defined (MMI_EM_ENABLED)
238 /*******************************************************************************
239
240 $Function: mmi_em_start_eng_mode_menus()
241
242 $Description: starts the emergency mode menu
243
244 $Returns: None
245
246 $Arguments: parent window
247
248 *******************************************************************************/
249 void mmi_em_start_eng_mode_menus(T_MFW_HND parent)
250 {
251 TRACE_EVENT("mmi_em_start_eng_mode_menus");
252 bookMenuStart(parent, EngModeAttributes(), NULL);
253
254 }
255 #endif
256
257 #ifndef NEPTUNE_BOARD
258
259 /*******************************************************************************
260
261 $Function: Mmi_em_display_mobile_info_data()
262
263 $Description: Called from menu; begins process to display Mobile Information
264
265 $Returns: status integer
266
267 $Arguments: menu and item (not used)
268
269 *******************************************************************************/
270
271
272 int Mmi_em_display_mobile_info_data(MfwMnu* m, MfwMnuItem* i)
273 { T_MFW_HND parent = mfwParent( mfw_header());
274 TRACE_EVENT_P1("Mmi_em_display_mobile_info(), parent win %d", parent);
275 TRACE_EVENT_P1("Memory left:%d", mfwCheckMemoryLeft());
276 Mmi_em_create(parent, EM_MOBILE_INFO);
277
278 return MFW_EVENT_CONSUMED;
279 }
280 /*******************************************************************************
281
282 $Function: Mmi_em_display_serving_cell_params()
283
284 $Description: Called from menu; begins process to display Serving Cell parameters
285
286 $Returns: status integer
287
288 $Arguments: menu and item (not used)
289
290 *******************************************************************************/
291
292 int Mmi_em_display_serving_cell_params(MfwMnu* m, MfwMnuItem* i)
293 { T_MFW_HND parent = mfwParent( mfw_header());
294 TRACE_EVENT_P1("MMiEm, Memory left:%d", mfwCheckMemoryLeft());
295 Mmi_em_create(parent, EM_SERVING_CELL_PARAMS);
296
297 return MFW_EVENT_CONSUMED;
298 }
299 /*******************************************************************************
300
301 $Function: Mmi_em_display_neighbour_cell_params()
302
303 $Description: Called from menu; begins process to display Neighbouring Cell parameters
304
305 $Returns: status integer
306
307 $Arguments: menu and item (not used)
308
309 *******************************************************************************/
310 int Mmi_em_display_neighbour_cell_params(MfwMnu* m, MfwMnuItem* i)
311 { T_MFW_HND parent = mfwParent( mfw_header());
312 TRACE_EVENT_P1("MMiEm, Memory left:%d", mfwCheckMemoryLeft());
313 Mmi_em_create(parent, EM_NEIGHBOURING_CELL_PARAMS);
314
315 return MFW_EVENT_CONSUMED;
316 }
317
318 /*******************************************************************************
319
320 $Function: Mmi_em_display_location_params()
321
322 $Description: Called from menu; begins process to display Locationparameters
323
324 $Returns: status integer
325
326 $Arguments: menu and item (not used)
327
328 *******************************************************************************/
329 int Mmi_em_display_location_params(MfwMnu* m, MfwMnuItem*i )
330 { T_MFW_HND parent = mfwParent( mfw_header());
331
332 Mmi_em_create(parent, EM_LOCATION_PARAMS);
333
334 return MFW_EVENT_CONSUMED;
335 }
336
337 /*******************************************************************************
338
339 $Function: Mmi_em_display_ciph_hop_DTX_params()
340
341 $Description: Called from menu; begins process to display Ciphering, hopping and
342 discontinuous transmission parameters
343
344 $Returns: status integer
345
346 $Arguments: menu and item (not used)
347
348 *******************************************************************************/
349 int Mmi_em_display_ciph_hop_DTX_params(MfwMnu* m, MfwMnuItem* i)
350 { T_MFW_HND parent = mfwParent( mfw_header());
351 TRACE_EVENT_P1("MMiEm, Memory left:%d", mfwCheckMemoryLeft());
352 Mmi_em_create(parent, EM_CIPH_HOP_DTX_PARAMS);
353
354 return MFW_EVENT_CONSUMED;
355 }
356
357 /*******************************************************************************
358
359 $Function: Mmi_em_display_GPRS_params()
360
361 $Description: Called from menu; begins process to display GPRS specific parameters
362
363 $Returns: status integer
364
365 $Arguments: menu and item (not used)
366
367 *******************************************************************************/
368
369 int Mmi_em_display_GPRS_params(MfwMnu* m, MfwMnuItem* i)
370 { T_MFW_HND parent = mfwParent( mfw_header());
371 TRACE_EVENT_P1("MMiEm, Memory left:%d", mfwCheckMemoryLeft());
372 Mmi_em_create(parent, EM_GPRS_PARAMS);
373
374 return MFW_EVENT_CONSUMED;
375 }
376
377 #else /* if NEPTUNE_BOARD */
378
379 int Mmi_em_start(MfwMnu* m, MfwMnuItem* i)
380 {
381 T_MFW_HND parent = mfwParent( mfw_header());
382 TRACE_EVENT_P1("Mmi_em_display_mobile_info(), parent win %d", parent);
383 TRACE_EVENT_P1("Memory left:%d", mfwCheckMemoryLeft());
384
385 TRACE_EVENT_P1("Selected item: %d", m->lCursor[m->level]);
386
387 Mmi_em_create(parent, m->lCursor[m->level]);
388
389 if(!EmRequest)
390 {
391 sAT_PercentESINFO(CMD_SRC_LCL,TIMER_ONE_SEC);
392 sAT_PercentEINFO(CMD_SRC_LCL,TIMER_ONE_SEC);
393 }
394 EmRequest = SAT_REQUEST_SENT;
395
396 return MFW_EVENT_CONSUMED;
397 }
398
399
400 #endif /* ifndef NEPTUNE_BOARD */
401 /*
402 ************************************Internal Functions**************************************
403 */
404
405 /*******************************************************************************
406
407 $Function: Mmi_em_create()
408
409 $Description: Creates emergency mode display window
410
411 $Returns: window handle
412
413 $Arguments: parent window, kind of data to be displayed
414
415 *******************************************************************************/
416
417 T_MFW_HND Mmi_em_create(T_MFW_HND parent_window, MfwEmDataType data_type)
418 {
419 tEmData * data = (tEmData *)ALLOC_MEMORY (sizeof (tEmData ));
420 T_MFW_WIN * win;
421
422 if (data EQ NULL)
423 {
424 return NULL;
425 }
426
427 // Create window handler
428 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (MfwCb)Mmi_em_win_cb);
429 if (data->win EQ NULL)
430 {
431 return NULL;
432 }
433 TRACE_EVENT_P1("Mmi_em_create(), data->win %d", data->win);
434 //no window event handler needed
435 data->mmi_control.dialog = (T_DIALOG_FUNC)NULL;
436 data->mmi_control.data = data;
437
438 data->kbd = kbd_create (data->win, KEY_ALL, (T_MFW_CB)Mmi_em_kbd_cb);
439
440 #ifndef NEPTUNE_BOARD
441 /*Mobile Info is the only data screen which doesn't need to be updated every second*/
442 if (data_type != EM_MOBILE_INFO)
443 {
444 data->tim = tim_create(data->win, EM_UPDATE_RATE, (T_MFW_CB)Mmi_em_tim_cb);
445 timStart(data->tim);//start timer
446 }
447 #endif
448
449 /*populate the user data*/
450 win = ((T_MFW_HDR *)data->win)->data;
451 win->user = (void *)data;
452 data->parent_win = parent_window;
453
454 /* SPR#1428 - SH - New Editor changes */
455 #ifdef NEW_EDITOR
456 /*SPR 1757, removed code for Chinese special case*/
457 AUI_edit_SetAttr(&data->editor_attr, EM_CREATE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT, ED_MODE_READONLY, ED_CURSOR_NONE, ATB_DCS_ASCII, (UBYTE *)data->edtBuffer,EM_EDITOR_SIZE);
458 data->editor = ATB_edit_Create(&data->editor_attr,0);
459 /*Clear editor buffer*/
460 memset(data->edtBuffer, 0, sizeof(EM_EDITOR_SIZE*2));
461 ATB_edit_Init(data->editor);
462 #else /* NEW_EDITOR */
463 /*SPR 1757, removed code for Chinese special case*/
464 bookSetEditAttributes(EM_CREATE_EDITOR,COLOUR_EDITOR_XX,0,edtCurNone,0,data->edtBuffer,EM_EDITOR_SIZE*2,&data->editor_data);
465 data->edt = edtCreate(data->win, &data->editor_data, NULL, NULL);
466 edtUnhide( data->edt );
467 /*Clear editor buffer*/
468 memset(data->edtBuffer, 0, sizeof(EM_EDITOR_SIZE*2));
469 #endif /* NEW_EDITOR */
470
471 /*Make sure we store the kind of window we want to show*/
472 data->CurrentWindow = data_type;
473
474 /*bind the MFW event handler to any events from the MFW Eng Mode module*/
475 Mfw_em_create(data->win, 0xFF, (MfwCb)Mmi_em_event_cb);
476 Mfw_em_get_data(data_type);/*ask MFW for the required data*/
477 win_show(data->win);/*show the screen*/
478 return data->win;
479
480 }
481
482 /*******************************************************************************
483
484 $Function: Mmi_em_event_cb()
485
486 $Description: Handles events coming from the MFW
487
488 $Returns: status integer
489
490 $Arguments: event type, pointer to data
491
492 *******************************************************************************/
493 int Mmi_em_event_cb(T_MFW_EVENT event,void* para)
494 {
495 T_MFW_HND win = mfw_parent (mfw_header());
496 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
497 tEmData * data = (tEmData *)win_data->user;
498
499 #ifndef NEPTUNE_BOARD
500 MFW_EM_Mobile_Info* mob_info;
501 MFW_EM_Serving_Cell_Parameters* sc_info;
502 MFW_EM_Neighbour_Cell_Parameters* nc_info;
503 MFW_EM_Location_Parameters* loc_info;
504 MFW_EM_Ciph_hop_DTX_Parameters* ciph_hop_dtx_info;
505 MFW_EM_GPRS_Parameter* gprs_info;
506 char * DTX_Status;
507 #else
508 fd_t fd;
509 char file[10];
510 char timeAndDate[25];
511 #endif
512
513 char *temp_buffer=NULL;
514
515 #ifdef NEW_EDITOR
516 T_ATB_TEXT temp_text;/*SPR 1757*/
517 #endif
518 TRACE_EVENT_P1("Mmi_em_event_cb(), event:%d", event);
519 temp_buffer=(char*)malloc(EM_EDITOR_SIZE*2*sizeof(char)); /*a0393213 lint warnings removal - dynamically allocated*/
520 if(temp_buffer==NULL)
521 {
522 TRACE_ERROR("Mmi_em_event_cb():No memory");
523 return MFW_EVENT_CONSUMED;
524 }
525
526 memset(temp_buffer, 0, EM_EDITOR_SIZE*2);
527
528 #ifdef NEPTUNE_BOARD
529 strcpy(file, "/NOR/Em.txt");
530 fd = ffs_open(file, FFS_O_CREATE|FFS_O_WRONLY|FFS_O_APPEND);
531 if(fd < 0 )
532 {
533 TRACE_EVENT("Error in Openning File");
534 free(temp_buffer);
535 return FALSE;
536 }
537
538 sprintf(timeAndDate, "%s %s\n", mfw_td_get_clock_str(), mfw_td_get_date_str());
539 ffs_write(fd, timeAndDate, strlen(timeAndDate));
540
541 #endif
542
543
544 /*if event matches current window type*/
545 if (event == data->CurrentWindow)
546 {
547 switch (event)
548 {
549 #ifndef NEPTUNE_BOARD /*EngMode */
550
551 case EM_MOBILE_INFO:
552 {
553 mob_info = (MFW_EM_Mobile_Info*)para;/*cast parameter to appropriate type*/
554 /*copy data to editor buffer*/
555 /*MC, SPR 1554 Added all SW versions to editor string*/
556 sprintf(temp_buffer, "SIM_VERSION:%s CC_VERSION:%s SS_VERSION:%s SMS_VERSION:%s MM_VERSION:%s RR_VERSION:%s DL_VERSION:%s ALR_VERSION:%s IMEI:%s IMSI:%s TMSI:%u",
557 mob_info->SIM_version, mob_info->CC_version, mob_info->SS_version,
558 mob_info->SMS_version, mob_info->MM_version, mob_info->RR_version,
559 mob_info->DL_version, mob_info->ALR_version,mob_info->IMEI, mob_info->IMSI,
560 mob_info->TMSI);
561 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
562 #ifdef NEW_EDITOR
563 /*SPR 1757 Insert temp buffer into editor*/
564 temp_text.data = (UBYTE*)temp_buffer;
565 temp_text.dcs = ATB_DCS_ASCII;
566 ATB_string_Length(&temp_text);
567 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
568 ATB_edit_ClearAll(data->editor);
569 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
570 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
571 ATB_edit_Refresh(data->editor);
572 #else /* !NEW_EDITOR */
573 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
574 #endif
575 win_show(data->win);/*show data*/
576 }
577 break;
578 #endif
579
580 case EM_SERVING_CELL_PARAMS:
581 {
582 #ifndef NEPTUNE_BOARD
583 sc_info = (MFW_EM_Serving_Cell_Parameters*)para;/*cast parameter to appropriate type*/
584 sprintf(temp_buffer, "ARFCN:%d RSSI:%d RXQ:%d RLT:%d C1:%d C2:%d LAC:%d BSIC:%d TAV:%d",\
585 sc_info->arfcn, sc_info->RSSI, sc_info->RXQ, sc_info->RLT, sc_info->C1, sc_info->C2,\
586 sc_info->LAC, sc_info->BSIC, sc_info->TAV);
587 #else
588 sprintf (temp_buffer, "AFRCN = %u Cell ID = %u \nMCC<>: = %u %u %u\nMNC<>: %u %u %u\nLAC<> = %u %u\nRAC = %u\nMultiframe period = %u \nTMSI<> = %u %u %u %u \nMax retransmission = %u \nCall re establishment status flag = %u \nMax o/p pw on common control channel = %u \nMinimum signal level for access = %u",
589 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_static.arfcn,
590 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.gsm_cell_id,
591 Eng_Info_Static_Req->info_mm.mm_cmd_info.user_selected_plmn.mcc[0],
592 Eng_Info_Static_Req->info_mm.mm_cmd_info.user_selected_plmn.mcc[1],
593 Eng_Info_Static_Req->info_mm.mm_cmd_info.user_selected_plmn.mcc[2],
594 Eng_Info_Static_Req->info_mm.mm_cmd_info.user_selected_plmn.mnc[0],
595 Eng_Info_Static_Req->info_mm.mm_cmd_info.user_selected_plmn.mnc[1],
596 Eng_Info_Static_Req->info_mm.mm_cmd_info.user_selected_plmn.mnc[2],
597 Eng_Info_Static_Req->info_mm.mm_sim_info.last_registered_cs_lac.lac_element[0],
598 Eng_Info_Static_Req->info_mm.mm_sim_info.last_registered_cs_lac.lac_element[1],
599 Eng_Info_Req->info_mm.mm_reg_ps_info.registered_rac,
600 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.ccch_info.bs_pa_mfrms,
601 Eng_Info_Req->info_mm.mm_reg_cs_info.tmsi[0],
602 Eng_Info_Req->info_mm.mm_reg_cs_info.tmsi[1],
603 Eng_Info_Req->info_mm.mm_reg_cs_info.tmsi[2],
604 Eng_Info_Req->info_mm.mm_reg_cs_info.tmsi[3],
605 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.ccch_info.max_retrans,
606 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.call_reestablishment_allowed,
607 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_bcch.ms_txpwr_max_cch,
608 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_bcch.rxlev_access_min
609 );
610
611 ffs_write(fd, "Serving cell info\n",20 );
612 ffs_write(fd, temp_buffer, strlen(temp_buffer));
613
614 #endif
615
616 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
617 #ifdef NEW_EDITOR
618 /*SPR 1757 Insert temp buffer into editor*/
619 temp_text.data = (UBYTE*)temp_buffer;
620 temp_text.dcs = ATB_DCS_ASCII;
621 ATB_string_Length(&temp_text);
622 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
623 ATB_edit_ClearAll(data->editor);
624 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
625 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
626 ATB_edit_Refresh(data->editor);
627 #else /* !NEW_EDITOR */
628 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
629 #endif
630 win_show(data->win);
631 }
632 break;
633
634 case EM_NEIGHBOURING_CELL_PARAMS:
635 {
636 #ifndef NEPTUNE_BOARD
637 nc_info = (MFW_EM_Neighbour_Cell_Parameters*)para;/*cast parameter to appropriate type*/
638 /*copy data to editor buffer*/
639 sprintf(temp_buffer, "NUM:%d\nARFCN:RSSI:C2:LAC:BSIC\n %5d%5d%5d%6d%5d\n %5d%5d%5d%6d%5d\n %5d%5d%5d%6d%5d\n %5d%5d%5d%6d%5d\n %5d%5d%5d%6d%5d\n %5d%5d%5d%6d%5d\n SC%4d%5d%5d%6d%5d",\
640 nc_info->NUM,\
641 nc_info->arfcn[0], nc_info->RSSI[0], nc_info->C2[0], nc_info->LAC_NC[0], nc_info->BSIC_NC[0],\
642 nc_info->arfcn[1], nc_info->RSSI[1], nc_info->C2[1], nc_info->LAC_NC[1], nc_info->BSIC_NC[1],\
643 nc_info->arfcn[2], nc_info->RSSI[2], nc_info->C2[2], nc_info->LAC_NC[2], nc_info->BSIC_NC[2],\
644 nc_info->arfcn[3], nc_info->RSSI[3], nc_info->C2[3], nc_info->LAC_NC[3], nc_info->BSIC_NC[3],\
645 nc_info->arfcn[4], nc_info->RSSI[4], nc_info->C2[4], nc_info->LAC_NC[4], nc_info->BSIC_NC[4],\
646 nc_info->arfcn[5], nc_info->RSSI[5], nc_info->C2[5], nc_info->LAC_NC[5], nc_info->BSIC_NC[5],\
647 nc_info->arfcn[6], nc_info->RSSI[6], nc_info->C2[6], nc_info->LAC_NC[6], nc_info->BSIC_NC[6]);
648 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
649 /*show the window*/
650 win_show(data->win);
651
652 #else /* NEPTUNE_BOARD*/
653 sprintf (temp_buffer, "NEIGHBOURING CELL\nNUM : %d\nBCCH <> %d \nBSIC <> %d %d %d %d %d %d \nRXLEV <> %d %d %d %d %d %d\nC1 <> %d %d %d %d %d %d\nC2 <> %d %d %d %d %d %d\nC31 <> %d %d %d %d %d %d\nC32 <> %d %d %d %d %d %d\nARFCN <> %d %d %d %d %d %d\nFRAME OFFSET <> %d %d %d %d %d %d\nTIME ALIGN <> %d %d %d %d %d %d",
654 Eng_Info_Req->info_rr.c_gsm_bba_cell,
655 Eng_Info_Req->info_rr.gsm_info.gsm_info_active.gsm_info_dedicated.bcch_channel,
656
657
658 Eng_Info_Req->info_rr.gsm_bba_cell[1].gsm_cell_info.gsm_cell_info_pbcch.bsic_match,
659 Eng_Info_Req->info_rr.gsm_bba_cell[2].gsm_cell_info.gsm_cell_info_pbcch.bsic_match,
660 Eng_Info_Req->info_rr.gsm_bba_cell[3].gsm_cell_info.gsm_cell_info_pbcch.bsic_match,
661 Eng_Info_Req->info_rr.gsm_bba_cell[4].gsm_cell_info.gsm_cell_info_pbcch.bsic_match,
662 Eng_Info_Req->info_rr.gsm_bba_cell[5].gsm_cell_info.gsm_cell_info_pbcch.bsic_match,
663 Eng_Info_Req->info_rr.gsm_bba_cell[6].gsm_cell_info.gsm_cell_info_pbcch.bsic_match,
664 Eng_Info_Req->info_rr.gsm_bba_cell[1].rxlev,
665 Eng_Info_Req->info_rr.gsm_bba_cell[2].rxlev,
666 Eng_Info_Req->info_rr.gsm_bba_cell[3].rxlev,
667 Eng_Info_Req->info_rr.gsm_bba_cell[4].rxlev,
668 Eng_Info_Req->info_rr.gsm_bba_cell[5].rxlev,
669 Eng_Info_Req->info_rr.gsm_bba_cell[6].rxlev,
670 Eng_Info_Req->info_rr.gsm_bba_cell[1].gsm_cell_info.gsm_cell_info_bcch.c1,
671 Eng_Info_Req->info_rr.gsm_bba_cell[2].gsm_cell_info.gsm_cell_info_bcch.c1,
672 Eng_Info_Req->info_rr.gsm_bba_cell[3].gsm_cell_info.gsm_cell_info_bcch.c1,
673 Eng_Info_Req->info_rr.gsm_bba_cell[4].gsm_cell_info.gsm_cell_info_bcch.c1,
674 Eng_Info_Req->info_rr.gsm_bba_cell[5].gsm_cell_info.gsm_cell_info_bcch.c1,
675 Eng_Info_Req->info_rr.gsm_bba_cell[6].gsm_cell_info.gsm_cell_info_bcch.c1,
676 Eng_Info_Req->info_rr.gsm_bba_cell[1].gsm_cell_info.gsm_cell_info_bcch.c2,
677 Eng_Info_Req->info_rr.gsm_bba_cell[2].gsm_cell_info.gsm_cell_info_bcch.c2,
678 Eng_Info_Req->info_rr.gsm_bba_cell[3].gsm_cell_info.gsm_cell_info_bcch.c2,
679 Eng_Info_Req->info_rr.gsm_bba_cell[4].gsm_cell_info.gsm_cell_info_bcch.c2,
680 Eng_Info_Req->info_rr.gsm_bba_cell[5].gsm_cell_info.gsm_cell_info_bcch.c2,
681 Eng_Info_Req->info_rr.gsm_bba_cell[6].gsm_cell_info.gsm_cell_info_bcch.c2,
682 Eng_Info_Req->info_rr.gsm_bba_cell[1].gsm_cell_info.gsm_cell_info_pbcch.c31,
683 Eng_Info_Req->info_rr.gsm_bba_cell[2].gsm_cell_info.gsm_cell_info_pbcch.c31,
684 Eng_Info_Req->info_rr.gsm_bba_cell[3].gsm_cell_info.gsm_cell_info_pbcch.c31,
685 Eng_Info_Req->info_rr.gsm_bba_cell[4].gsm_cell_info.gsm_cell_info_pbcch.c31,
686 Eng_Info_Req->info_rr.gsm_bba_cell[5].gsm_cell_info.gsm_cell_info_pbcch.c31,
687 Eng_Info_Req->info_rr.gsm_bba_cell[6].gsm_cell_info.gsm_cell_info_pbcch.c31,
688 Eng_Info_Req->info_rr.gsm_bba_cell[1].gsm_cell_info.gsm_cell_info_pbcch.c32,
689 Eng_Info_Req->info_rr.gsm_bba_cell[2].gsm_cell_info.gsm_cell_info_pbcch.c32,
690 Eng_Info_Req->info_rr.gsm_bba_cell[3].gsm_cell_info.gsm_cell_info_pbcch.c32,
691 Eng_Info_Req->info_rr.gsm_bba_cell[4].gsm_cell_info.gsm_cell_info_pbcch.c32,
692 Eng_Info_Req->info_rr.gsm_bba_cell[5].gsm_cell_info.gsm_cell_info_pbcch.c32,
693 Eng_Info_Req->info_rr.gsm_bba_cell[6].gsm_cell_info.gsm_cell_info_pbcch.c32,
694 Eng_Info_Req->info_rr.gsm_bba_cell[1].arfcn,
695 Eng_Info_Req->info_rr.gsm_bba_cell[2].arfcn,
696 Eng_Info_Req->info_rr.gsm_bba_cell[3].arfcn,
697 Eng_Info_Req->info_rr.gsm_bba_cell[4].arfcn,
698 Eng_Info_Req->info_rr.gsm_bba_cell[5].arfcn,
699 Eng_Info_Req->info_rr.gsm_bba_cell[6].arfcn,
700 Eng_Info_Req->info_rr.gsm_bba_cell[1].gsm_sync_info.fn_offset,
701 Eng_Info_Req->info_rr.gsm_bba_cell[2].gsm_sync_info.fn_offset,
702 Eng_Info_Req->info_rr.gsm_bba_cell[3].gsm_sync_info.fn_offset,
703 Eng_Info_Req->info_rr.gsm_bba_cell[4].gsm_sync_info.fn_offset,
704 Eng_Info_Req->info_rr.gsm_bba_cell[5].gsm_sync_info.fn_offset,
705 Eng_Info_Req->info_rr.gsm_bba_cell[6].gsm_sync_info.fn_offset,
706 Eng_Info_Req->info_rr.gsm_bba_cell[1].gsm_sync_info.time_align,
707 Eng_Info_Req->info_rr.gsm_bba_cell[2].gsm_sync_info.time_align,
708 Eng_Info_Req->info_rr.gsm_bba_cell[3].gsm_sync_info.time_align,
709 Eng_Info_Req->info_rr.gsm_bba_cell[4].gsm_sync_info.time_align,
710 Eng_Info_Req->info_rr.gsm_bba_cell[5].gsm_sync_info.time_align,
711 Eng_Info_Req->info_rr.gsm_bba_cell[6].gsm_sync_info.time_align
712 );
713 ffs_write(fd, "Neighbouring cell info\n",25 );
714 ffs_write(fd, temp_buffer, strlen(temp_buffer));
715
716 #endif
717 #ifdef NEW_EDITOR
718 /*SPR 1757 Insert temp buffer into editor*/
719 temp_text.data = (UBYTE*)temp_buffer;
720 temp_text.dcs = ATB_DCS_ASCII;
721 ATB_string_Length(&temp_text);
722 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
723 ATB_edit_ClearAll(data->editor);
724 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
725 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
726 ATB_edit_Refresh(data->editor);
727 #else /* !NEW_EDITOR */
728 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
729 #endif
730 win_show(data->win);
731 }
732 break;
733
734 #ifndef NEPTUNE_BOARD
735 case EM_LOCATION_PARAMS:
736 {
737 loc_info = (MFW_EM_Location_Parameters*)para;/*cast parameter to appropriate type*/
738 /*copy data to editor buffer*/
739 /*MC, SPR 1554 Removed Cell id from editor string*/
740 sprintf(temp_buffer, "LUP:%d MCC:%s MNC:%s LAC:%d ", loc_info->LUP, loc_info->MCC, loc_info->MNC, loc_info->LAC);
741 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
742 #ifdef NEW_EDITOR
743 /*SPR 1757 Insert temp buffer into editor*/
744 temp_text.data = (UBYTE*)temp_buffer;
745 temp_text.dcs = ATB_DCS_ASCII;
746 ATB_string_Length(&temp_text);
747 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
748 ATB_edit_ClearAll(data->editor);
749 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
750 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
751 ATB_edit_Refresh(data->editor);
752 #else /* !NEW_EDITOR */
753 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
754 #endif
755 /*show the window*/
756 win_show(data->win);
757 }
758 break;
759 #endif
760
761 #ifndef NEPTUNE_BOARD
762 case EM_CIPH_HOP_DTX_PARAMS:
763 {
764 ciph_hop_dtx_info = (MFW_EM_Ciph_hop_DTX_Parameters*)para;/*cast parameter to appropriate type*/
765 /*convert DTX status to string*/
766 if (ciph_hop_dtx_info->DTX_status == FALSE)
767 DTX_Status = "Off";
768 else
769 DTX_Status = "On";
770 //copy data to editor
771 sprintf(temp_buffer, "STATUS:%d HSN:%d DTX:%s ", ciph_hop_dtx_info->ciph_status, ciph_hop_dtx_info->HSN, DTX_Status);
772 /*show the window*/
773 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
774 #ifdef NEW_EDITOR
775 /*SPR 1757 Insert temp buffer into editor*/
776 temp_text.data = (UBYTE*)temp_buffer;
777 temp_text.dcs = ATB_DCS_ASCII;
778 ATB_string_Length(&temp_text);
779 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
780 ATB_edit_ClearAll(data->editor);
781 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
782 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
783 ATB_edit_Refresh(data->editor);
784 #else /* !NEW_EDITOR */
785 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
786 #endif
787 win_show(data->win);
788 }
789 break;
790 #endif
791
792 #ifndef NEPTUNE_BOARD
793 case EM_GPRS_PARAMS:
794 {
795 gprs_info = (MFW_EM_GPRS_Parameter*)para;//cast parameter to appropriate type
796 /*MC, SPR 1554 Changed ediotr string to show Network Mode of Operation*/
797 sprintf(temp_buffer, "NMO:%d NDTS:%d RAC:%d C31:%d C32:%d",\
798 gprs_info->NMO, gprs_info->NDTS, gprs_info->RAC, gprs_info->C31, gprs_info->C32);
799 //show the window
800 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
801 #ifdef NEW_EDITOR
802 /*SPR 1757 Insert temp buffer into editor*/
803 temp_text.data = (UBYTE*)temp_buffer;
804 temp_text.dcs = ATB_DCS_ASCII;
805 ATB_string_Length(&temp_text);
806 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
807 ATB_edit_ClearAll(data->editor);
808 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
809 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
810 ATB_edit_Refresh(data->editor);
811 #else /* !NEW_EDITOR */
812 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
813 #endif
814 win_show(data->win);
815 }
816 break;
817 #endif
818
819
820 #ifdef NEPTUNE_BOARD
821 case EM_SERVING_CELL_RF_PARAMS:
822 sprintf (temp_buffer, "RSSI = %u\nDTX = %d \nC1 = %u \nC2 = %u \nCELL-RESELECT HYSTERESIS = %u \nC32 = %d\nRXLEV (FULL) = %u \nRXLEV(SUB) = %u \nRXQUAL(FULL) = %u \nRXQUAL(SUB) = %u \nTXPOWER Timing advance = %u\nSignal variance =%u",
823 RssiVal,
824 Eng_Info_Req->info_rr.gsm_info.gsm_info_active.gsm_info_dedicated.codec_info.dtx_used,
825 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_bcch.c1,
826 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_bcch.c2,
827 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_bcch.cell_reselect_hysteresis,
828 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_pbcch.c32,
829 Eng_Info_Req->info_rr.gsm_info.gsm_info_active.gsm_info_dedicated.rxlev_full,
830 Eng_Info_Req->info_rr.gsm_info.gsm_info_active.gsm_info_dedicated.rxlev_sub,
831 Eng_Info_Req->info_rr.gsm_info.gsm_info_active.gsm_info_dedicated.rxqual_full,
832 Eng_Info_Req->info_rr.gsm_info.gsm_info_active.gsm_info_dedicated.rxqual_sub,
833 Eng_Info_Req->info_grlc.channel_quality.timing_advance,
834 Eng_Info_Req->info_grlc.channel_quality.signal_variance
835 );
836
837 ffs_write(fd, "Serving cell RF info\n",25 );
838 ffs_write(fd, temp_buffer, strlen(temp_buffer));
839 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
840 #ifdef NEW_EDITOR
841 /*SPR 1757 Insert temp buffer into editor*/
842 temp_text.data = (UBYTE*)temp_buffer;
843 temp_text.dcs = ATB_DCS_ASCII;
844 ATB_string_Length(&temp_text);
845 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
846 ATB_edit_ClearAll(data->editor);
847 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
848 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
849 ATB_edit_Refresh(data->editor);
850 #else /* !NEW_EDITOR */
851 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
852 #endif
853 win_show(data->win);/*show data*/
854
855 break;
856
857 case EM_SERVING_CHANNEL_PARAMS:
858
859 sprintf (temp_buffer, "BCCH = %u \n HSN = %u \nBSIC = %u \n MAIO = %u \nARFCN = %u \nMobile allocation:\n MA index offset = %u\nMA number =%u",
860 Eng_Info_Req->info_rr.gsm_info.gsm_info_active.gsm_info_dedicated.bcch_channel,
861 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_hopping.hsn,
862 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_pbcch.bsic_match,
863 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_hopping.maio,
864 Eng_Info_Req->info_rr.gsm_bba_cell[0].arfcn,
865 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_hopping.maio,
866 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_hopping.ma_number
867 );
868
869 ffs_write(fd, "Serving Channel info\n",25 );
870 ffs_write(fd, temp_buffer, strlen(temp_buffer));
871 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
872 #ifdef NEW_EDITOR
873 /*SPR 1757 Insert temp buffer into editor*/
874 temp_text.data = (UBYTE*)temp_buffer;
875 temp_text.dcs = ATB_DCS_ASCII;
876 ATB_string_Length(&temp_text);
877 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
878 ATB_edit_ClearAll(data->editor);
879 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
880 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
881 ATB_edit_Refresh(data->editor);
882 #else /* !NEW_EDITOR */
883 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
884 #endif
885 win_show(data->win);/*show data*/
886
887 break;
888
889 case EM_AMR_PARAMS:
890
891 sprintf (temp_buffer, "Threshold = %u\nHysteresis = %u\n Link quality estimate:\nMean bit error probability = %u\nVariation coefficient of BEP =%u\n\nBEP period = %u\nLQM mode =%u",
892 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_pbcch.hcs_thr,
893 Eng_Info_Req->info_rr.gsm_bba_cell[0].gsm_cell_info.gsm_cell_info_bcch.cell_reselect_hysteresis,
894 Eng_Info_Req->info_grlc.channel_quality.bep_lqm.bep_lqm_gmsk.mean_bep,
895 Eng_Info_Req->info_grlc.channel_quality.bep_lqm.bep_lqm_gmsk.cv_bep,
896 Eng_Info_Req->info_grlc.channel_quality.bep_lqm.bep_period,
897 Eng_Info_Req->info_grlc.channel_quality.bep_lqm.lqm_mode
898 );
899
900 ffs_write(fd, "Serving AMR info\n",20 );
901 ffs_write(fd, temp_buffer, strlen(temp_buffer));
902
903 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
904 #ifdef NEW_EDITOR
905 /*SPR 1757 Insert temp buffer into editor*/
906 temp_text.data = (UBYTE*)temp_buffer;
907 temp_text.dcs = ATB_DCS_ASCII;
908 ATB_string_Length(&temp_text);
909 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
910 ATB_edit_ClearAll(data->editor);
911 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
912 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
913 ATB_edit_Refresh(data->editor);
914 #else /* !NEW_EDITOR */
915 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
916 #endif
917 win_show(data->win);/*show data*/
918
919 break;
920
921 case EM_SNDCP_PARAMS:
922
923 sprintf (temp_buffer, "Header compression status = %u %u %u %u\n Data compression status = %u %u %u %u",
924 Eng_Info_Req->info_sm.connection_info_sm[0].compression_header,
925 Eng_Info_Req->info_sm.connection_info_sm[1].compression_header,
926 Eng_Info_Req->info_sm.connection_info_sm[2].compression_header,
927 Eng_Info_Req->info_sm.connection_info_sm[3].compression_header,
928 Eng_Info_Req->info_sm.connection_info_sm[0].compression_data,
929 Eng_Info_Req->info_sm.connection_info_sm[1].compression_data,
930 Eng_Info_Req->info_sm.connection_info_sm[2].compression_data,
931 Eng_Info_Req->info_sm.connection_info_sm[3].compression_data
932 );
933
934 ffs_write(fd, "Serving SNDCP info\n",21 );
935 ffs_write(fd, temp_buffer, strlen(temp_buffer));
936
937 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
938 #ifdef NEW_EDITOR
939 /*SPR 1757 Insert temp buffer into editor*/
940 temp_text.data = (UBYTE*)temp_buffer;
941 temp_text.dcs = ATB_DCS_ASCII;
942 ATB_string_Length(&temp_text);
943 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
944 ATB_edit_ClearAll(data->editor);
945 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
946 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
947 ATB_edit_Refresh(data->editor);
948 #else /* !NEW_EDITOR */
949 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
950 #endif
951 win_show(data->win);/*show data*/
952 break;
953
954
955 case EM_USERLEVEL_PARAMS:
956
957 sprintf (temp_buffer, "Application Data throughput\n Data rate = %u %u\n data_rate_retx = %u %u",
958 Eng_Info_Req->info_grlc.rlc_mac_statistic[0].throughput.data_rate,
959 Eng_Info_Req->info_grlc.rlc_mac_statistic[1].throughput.data_rate,
960 Eng_Info_Req->info_grlc.rlc_mac_statistic[0].throughput.data_rate_retx,
961 Eng_Info_Req->info_grlc.rlc_mac_statistic[1].throughput.data_rate_retx
962 );
963 ffs_write(fd, "Serving user level info\n",26 );
964 ffs_write(fd, temp_buffer, strlen(temp_buffer));
965 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
966 #ifdef NEW_EDITOR
967 /*SPR 1757 Insert temp buffer into editor*/
968 temp_text.data = (UBYTE*)temp_buffer;
969 temp_text.dcs = ATB_DCS_ASCII;
970 ATB_string_Length(&temp_text);
971 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
972 ATB_edit_ClearAll(data->editor);
973 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
974 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
975 ATB_edit_Refresh(data->editor);
976 #else /* !NEW_EDITOR */
977 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
978 #endif
979 win_show(data->win);/*show data*/
980 break;
981
982
983 case EM_LLCTRACING_PARAMS:
984
985 sprintf (temp_buffer, "LLC Data throughput UL/DL\n throughput UL: \nData rate= %u\ndata_rate_retx=%u\nthroughput DL\nData rate = %u\nndata_rate_retx = %u",
986 Eng_Info_Req->info_llc.throughput_ul.data_rate,
987 Eng_Info_Req->info_llc.throughput_ul.data_rate_retx,
988 Eng_Info_Req->info_llc.throughput_dl.data_rate,
989 Eng_Info_Req->info_llc.throughput_dl.data_rate_retx
990 );
991 ffs_write(fd, "Serving LLC tracing info\n",26 );
992 ffs_write(fd, temp_buffer, strlen(temp_buffer));
993
994 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
995 #ifdef NEW_EDITOR
996 /*SPR 1757 Insert temp buffer into editor*/
997 temp_text.data = (UBYTE*)temp_buffer;
998 temp_text.dcs = ATB_DCS_ASCII;
999 ATB_string_Length(&temp_text);
1000 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
1001 ATB_edit_ClearAll(data->editor);
1002 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
1003 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
1004 ATB_edit_Refresh(data->editor);
1005 #else /* !NEW_EDITOR */
1006 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
1007 #endif
1008 win_show(data->win);/*show data*/
1009 break;
1010
1011 case EM_RLC_MAC_PARAMS:
1012
1013 sprintf (temp_buffer, "RLC/MAC Data throughput\n Data through-put value in bits/s = %u %u\nData through-put value of retransmitted bytes in bits/s = %u %u",
1014 Eng_Info_Req->info_grlc.rlc_mac_statistic[0].throughput.data_rate,
1015 Eng_Info_Req->info_grlc.rlc_mac_statistic[1].throughput.data_rate,
1016 Eng_Info_Req->info_grlc.rlc_mac_statistic[0].throughput.data_rate_retx,
1017 Eng_Info_Req->info_grlc.rlc_mac_statistic[1].throughput.data_rate_retx
1018 );
1019 ffs_write(fd, "Serving RLC/MAC info\n",23 );
1020 ffs_write(fd, temp_buffer, strlen(temp_buffer));
1021
1022 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
1023 #ifdef NEW_EDITOR
1024 /*SPR 1757 Insert temp buffer into editor*/
1025 temp_text.data = (UBYTE*)temp_buffer;
1026 temp_text.dcs = ATB_DCS_ASCII;
1027 ATB_string_Length(&temp_text);
1028 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
1029 ATB_edit_ClearAll(data->editor);
1030 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
1031 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
1032 ATB_edit_Refresh(data->editor);
1033 #else /* !NEW_EDITOR */
1034 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
1035 #endif
1036 win_show(data->win);/*show data*/
1037 break;
1038
1039 case EM_GMM_INFO_PARAMS:
1040
1041 sprintf (temp_buffer, "Attach state = %u \nSM information (per PDP context) \nNo of active primary PDP contexts= %u\nNo of active secondary PDP context= %u Radio priority =%u\n\nDelay class = %d\nReliability class =%d\nPeak throughput = %d\nPrecedence class = %d\nMean throughput =%d\n\nIPv4/v6 address\nipv4 = %d\nipv6 = %d",
1042 Eng_Info_Req->info_sm.attached,
1043 Eng_Info_Req->info_sm.pdp_context_count_primary,
1044 Eng_Info_Req->info_sm.pdp_context_count_secondary,
1045 Eng_Info_Req->info_sm.connection_info_sm[2].radio_prio,
1046 Eng_Info_Static_Req->info_sm.context_info[0].qos.qos_r97.delay,
1047 Eng_Info_Static_Req->info_sm.context_info[0].qos.qos_r97.relclass,
1048 Eng_Info_Static_Req->info_sm.context_info[0].qos.qos_r97.peak,
1049 Eng_Info_Static_Req->info_sm.context_info[0].qos.qos_r97.preced,
1050 Eng_Info_Static_Req->info_sm.context_info[0].qos.qos_r97.mean,
1051 Eng_Info_Static_Req->info_sm.context_info[0].ip_address.ipv4_addr.aelement[0],
1052 Eng_Info_Static_Req->info_sm.context_info[0].ip_address.ipv6_addr.aelement[0]
1053 );
1054 ffs_write(fd, "Serving GMM info\n",20 );
1055 ffs_write(fd, temp_buffer, strlen(temp_buffer));
1056 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
1057 #ifdef NEW_EDITOR
1058 /*SPR 1757 Insert temp buffer into editor*/
1059 temp_text.data = (UBYTE*)temp_buffer;
1060 temp_text.dcs = ATB_DCS_ASCII;
1061 ATB_string_Length(&temp_text);
1062 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
1063 ATB_edit_ClearAll(data->editor);
1064 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
1065 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
1066 ATB_edit_Refresh(data->editor);
1067 #else /* !NEW_EDITOR */
1068 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
1069 #endif
1070 win_show(data->win);/*show data*/
1071
1072 break;
1073
1074 case EM_CALL_STATUS_PARAMS:
1075
1076 sprintf (temp_buffer, "CALL STATUS\nTransaction id = %u\nDirection = %u \nStatecc = %u \nOn hold = %u",
1077 Eng_Info_Req->info_cc.connection_info_cc[0].transaction_id,
1078 Eng_Info_Req->info_cc.connection_info_cc[0].direction,
1079 Eng_Info_Req->info_cc.connection_info_cc[0].state_cc,
1080 Eng_Info_Req->info_cc.connection_info_cc[0].on_hold
1081 );
1082 ffs_write(fd, "Serving call status info\n",27 );
1083 ffs_write(fd, temp_buffer, strlen(temp_buffer));
1084 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
1085 #ifdef NEW_EDITOR
1086 /*SPR 1757 Insert temp buffer into editor*/
1087 temp_text.data = (UBYTE*)temp_buffer;
1088 temp_text.dcs = ATB_DCS_ASCII;
1089 ATB_string_Length(&temp_text);
1090 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
1091 ATB_edit_ClearAll(data->editor);
1092 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
1093 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
1094 ATB_edit_Refresh(data->editor);
1095 #else /* !NEW_EDITOR */
1096 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
1097 #endif
1098 win_show(data->win);/*show data*/
1099
1100 break;
1101
1102 case EM_LAYER_MESSAGE_PARAMS:
1103
1104 sprintf (temp_buffer, "LAYER MESSAGE\nLogical Channel: \narfcn=%d\n\nMobile allocation index offset=%d\nHopping sequence number =%d\nvalid-flag=%d\nMobile allocation number = %d",
1105 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_static.arfcn,
1106 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_hopping.maio,
1107 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_hopping.hsn,
1108 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_hopping.v_ma_number,
1109 Eng_Info_Req->info_rr.gsm_info.gsm_info_idle.pccch_info.pccch_channel.gsm_channel_hopping.ma_number
1110 );
1111 ffs_write(fd, "Serving Layer message\n",25 );
1112 ffs_write(fd, temp_buffer, strlen(temp_buffer));
1113 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
1114 #ifdef NEW_EDITOR
1115 /*SPR 1757 Insert temp buffer into editor*/
1116 temp_text.data = (UBYTE*)temp_buffer;
1117 temp_text.dcs = ATB_DCS_ASCII;
1118 ATB_string_Length(&temp_text);
1119 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
1120 ATB_edit_ClearAll(data->editor);
1121 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
1122 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
1123 ATB_edit_Refresh(data->editor);
1124 #else /* !NEW_EDITOR */
1125 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
1126 #endif
1127 win_show(data->win);/*show data*/
1128 break;
1129
1130 case EM_WCDMA_LAYER_MESSAGE_PARAMS:
1131
1132 sprintf (temp_buffer, "%s",
1133 "WCDMA LAYER MESSAGE"
1134 );
1135 ffs_write(fd, "Serving WCDMA Layer info\n",32 );
1136 ffs_write(fd, temp_buffer, strlen(temp_buffer));
1137 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
1138 #ifdef NEW_EDITOR
1139 /*SPR 1757 Insert temp buffer into editor*/
1140 temp_text.data = (UBYTE*)temp_buffer;
1141 temp_text.dcs = ATB_DCS_ASCII;
1142 ATB_string_Length(&temp_text);
1143 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
1144 ATB_edit_ClearAll(data->editor);
1145 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
1146 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
1147 ATB_edit_Refresh(data->editor);
1148 #else /* !NEW_EDITOR */
1149 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
1150 #endif
1151 win_show(data->win);/*show data*/
1152 break;
1153
1154 case EM_3G_INFO_PARAMS:
1155
1156 sprintf (temp_buffer, "%s",
1157 "3G INFO"
1158 );
1159 ffs_write(fd, temp_buffer, strlen(temp_buffer));
1160 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
1161 #ifdef NEW_EDITOR
1162 /*SPR 1757 Insert temp buffer into editor*/
1163 temp_text.data = (UBYTE*)temp_buffer;
1164 temp_text.dcs = ATB_DCS_ASCII;
1165 ATB_string_Length(&temp_text);
1166 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
1167 ATB_edit_ClearAll(data->editor);
1168 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
1169 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
1170 ATB_edit_Refresh(data->editor);
1171 #else /* !NEW_EDITOR */
1172 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
1173 #endif
1174 win_show(data->win);/*show data*/
1175 break;
1176
1177 case EM_PACKET_DATA_PARAMS:
1178
1179 sprintf (temp_buffer, "PACKET DATA\nGMM State = %d\n ",
1180 Eng_Info_Req->info_mm.mm_reg_ps_info.gmm_main_state
1181 );
1182 ffs_write(fd, "Serving packet data info\n",27 );
1183 ffs_write(fd, temp_buffer, strlen(temp_buffer));
1184 /* SPR#1428 - SH - New Editor - string has changed, update word wrap */
1185 #ifdef NEW_EDITOR
1186 /*SPR 1757 Insert temp buffer into editor*/
1187 temp_text.data = (UBYTE*)temp_buffer;
1188 temp_text.dcs = ATB_DCS_ASCII;
1189 ATB_string_Length(&temp_text);
1190 ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
1191 ATB_edit_ClearAll(data->editor);
1192 ATB_edit_InsertString(data->editor, &temp_text); /* Insert name string */
1193 ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
1194 ATB_edit_Refresh(data->editor);
1195 #else /* !NEW_EDITOR */
1196 strncpy(data->edtBuffer, temp_buffer, EM_EDITOR_SIZE);/*SPR 1757*/
1197 #endif
1198 win_show(data->win);/*show data*/
1199
1200 break;
1201
1202 #endif /*ifndef NEPTUNE BOARD */
1203 default:
1204 free(temp_buffer);
1205 return MFW_EVENT_REJECTED;
1206 }
1207 }
1208 else
1209 {
1210 free(temp_buffer);
1211 return MFW_EVENT_REJECTED;
1212 }
1213
1214 #ifdef NEPTUNE_BOARD
1215 ffs_write(fd, "\n****************\n\n",20 );
1216 ffs_close(fd);
1217 #endif
1218 free(temp_buffer);
1219 return MFW_EVENT_CONSUMED;
1220 }
1221
1222 /*******************************************************************************
1223 $Function: Mmi_em_destroy()
1224 $Description: Delete the window
1225 $Returns: none
1226 $Arguments: window handle
1227 *******************************************************************************/
1228 void Mmi_em_destroy(T_MFW_HND own_window)
1229 {
1230 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data;
1231 tEmData * data = (tEmData *)win->user;
1232
1233 TRACE_EVENT ("Mmi_em_destroy()");
1234
1235 if (own_window == NULL)
1236 {
1237 TRACE_EVENT ("Error :- Called with NULL Pointer");
1238 return;
1239 }
1240 if (data)
1241 {
1242 /*
1243 * Exit TIMER & KEYBOARD Handle
1244 */
1245 kbd_delete (data->kbd);
1246 tim_delete (data->tim);
1247 /* SPR#1428 - SH - New Editor changes */
1248 #ifdef NEW_EDITOR
1249 ATB_edit_Destroy(data->editor);
1250 #else
1251 edt_delete(data->edt);
1252 #endif
1253 /*
1254 * Delete WIN Handler
1255 */
1256 win_delete (data->win);
1257 /*
1258 * Free Memory
1259 */
1260 FREE_MEMORY ((void *)data, sizeof (tEmData));
1261 }
1262 TRACE_EVENT_P1("MMiEm END, Memory left:%d", mfwCheckMemoryLeft());
1263 }
1264
1265 /*******************************************************************************
1266
1267 $Function: Mmi_em_kbd_cb()
1268
1269 $Description: Keyboard handler
1270
1271 $Returns: status int
1272
1273 $Arguments: event, keyboard data
1274
1275 *******************************************************************************/
1276 int Mmi_em_kbd_cb(T_MFW_EVENT event,T_MFW_KBD * kc )
1277 {
1278 T_MFW_HND win = mfw_parent (mfw_header());
1279 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1280 tEmData * data = (tEmData *)win_data->user;
1281 #ifdef NEPTUNE_BOARD /*EngMode */
1282 char strTemp[4];
1283 int nCopy;
1284
1285 char pic[9];
1286 U16 *p;
1287 fd_t fd;
1288 char file[15];
1289
1290 static char command[10];
1291
1292 if(strlen(command) > 8)
1293 {
1294 memset(command, '\0', sizeof(command));
1295 }
1296 #endif
1297
1298 TRACE_EVENT_P2("Mmi_em_kbd_cb, key:%d, win;%d", kc->code, data->win);
1299
1300 switch(kc->code)
1301 {
1302
1303 case KCD_MNUUP:/*scroll up */
1304 /* SPR#1428 - SH - New Editor changes */
1305 #ifdef NEW_EDITOR
1306 ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE);
1307 #else /* NEW_EDITOR */
1308 edtChar(data->edt,ecUp);
1309 #endif /* NEW_EDITOR */
1310 break;
1311
1312 case KCD_MNUDOWN:/*scroll down*/
1313 /* SPR#1428 - SH - New Editor changes */
1314 #ifdef NEW_EDITOR
1315 ATB_edit_Char(data->editor,ctrlDown, TRUE);
1316 #else /* NEW_EDITOR */
1317 edtChar(data->edt,ecDown);
1318 #endif /* NEW_EDITOR */
1319
1320 break;
1321 #ifdef NEPTUNE_BOARD /*EngMode */
1322 case KCD_0:
1323 strcat(command, "0");
1324 break;
1325 case KCD_1:
1326 strcat(command, "1");
1327 break;
1328 case KCD_2:
1329 strcat(command, "2");
1330 break;
1331 case KCD_3:
1332 strcat(command, "3");
1333 break;
1334 case KCD_4:
1335 strcat(command, "4");
1336 break;
1337 case KCD_5:
1338 strcat(command, "5");
1339 break;
1340 case KCD_6:
1341 strcat(command, "6");
1342 break;
1343 case KCD_7:
1344 strcat(command, "7");
1345 break;
1346 case KCD_8:
1347 strcat(command, "8");
1348 break;
1349 case KCD_9:
1350 strcat(command, "9");
1351 break;
1352 case KCD_STAR:
1353 strcat(command, "*");
1354 break;
1355 case KCD_HASH:
1356 strcat(command, "#");
1357 if(!strcmp(command,"###1234#"))
1358 {
1359 TRACE_EVENT_P1("Handle capture, command :%s", command);
1360
1361 strcpy(file, "/NOR/pic");
1362 // strcpy(strTemp, "/NOR/pic");
1363 memset(strTemp, '\0', sizeof(strTemp));
1364 nCopy = 0;
1365 while ( (fd = (int) ffs_open( file, FFS_O_RDONLY )) > 0 )
1366 {
1367
1368 nCopy++;
1369 sprintf(strTemp, "%d", nCopy);
1370 strcat(file, strTemp);
1371 ffs_close((fd_t) fd);
1372 }
1373 TRACE_EVENT_P1("nCopy:%d", nCopy);
1374 sprintf( strTemp, "%d", nCopy);
1375 // strcat( file, strTemp );
1376 TRACE_EVENT_P1("file:%s", file);
1377 fd = ffs_open(file, FFS_O_CREATE|FFS_O_WRONLY|FFS_O_TRUNC);
1378 ffs_write(fd, picture_col, 320*240);
1379 ffs_close(fd);
1380
1381 memset(command, '\0', sizeof(command));
1382
1383 }
1384
1385 break;
1386 #endif
1387
1388 case KCD_HUP: /*destroy window*/
1389 case KCD_RIGHT:
1390 #ifdef NEPTUNE_BOARD
1391 EmRequest = NULL;
1392 sAT_PercentEINFO(CMD_SRC_LCL,TIMER_STOP);
1393 sAT_PercentESINFO(CMD_SRC_LCL,TIMER_STOP);
1394 Mmi_em_destroy(data->win);
1395 memset(command, '\0', sizeof(command));
1396 #else
1397 Mmi_em_destroy(data->win);
1398 #endif
1399 break;
1400 default:
1401 break;
1402 }
1403 return MFW_EVENT_CONSUMED;
1404 }
1405
1406 /*******************************************************************************
1407
1408 $Function: Mmi_em_win_cb()
1409
1410 $Description: Display handler
1411
1412 $Returns: status int
1413
1414 $Arguments: event, window handle
1415
1416 *******************************************************************************/
1417 int Mmi_em_win_cb(T_MFW_EVENT event,T_MFW_WIN * win )
1418 {
1419 tEmData* data = (tEmData *)win->user;
1420
1421 TRACE_EVENT_P1("EM window: %d", win);
1422 TRACE_EVENT_P1("Mmi_em_win_cb(), data->CurrentWindow %d", data->CurrentWindow);
1423
1424 switch( event )
1425 {
1426 case MfwWinVisible:
1427 /*clear screen*/
1428 dspl_ClearAll();
1429
1430 /*Show editor content*/
1431 /* SPR#1428 - SH - New Editor changes */
1432 #ifdef NEW_EDITOR
1433 ATB_edit_Show(data->editor);
1434 #else /* NEW_EDITOR */
1435 edtShow(data->edt);
1436 #endif /* NEW_EDITOR */
1437
1438 displaySoftKeys(TxtNull, TxtSoftBack); /*show the softkeys*/
1439 break;
1440 default:
1441 return MFW_EVENT_PASSED;
1442 /*break;*/
1443 }
1444
1445 return MFW_EVENT_CONSUMED;
1446
1447 }
1448
1449 /*******************************************************************************
1450
1451 $Function: Mmi_em_tim_cb()
1452
1453 $Description: Timer handler (every second)
1454
1455 $Returns: none
1456
1457 $Arguments: event, timer data
1458
1459 *******************************************************************************/
1460 void Mmi_em_tim_cb(T_MFW_EVENT event,T_MFW_TIM * t)
1461 {
1462 T_MFW_HND win = mfw_parent (mfw_header());
1463 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1464 tEmData * data = (tEmData *)win_data->user;
1465 TRACE_EVENT_P1("Mmi_em_tim_cb(), win:%d", data->win);
1466 /*Request the data from MFW again*/
1467 Mfw_em_get_data(data->CurrentWindow);
1468 /*restart timer*/
1469 timStart(data->tim);
1470 }