comparison g23m/condat/ms/src/bmi/MmiStart.c @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
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: Start
15 $File: MmiStart.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 25/10/00
20
21 ********************************************************************************
22
23 Description:
24
25 This provides the start code for the MMI
26
27 ********************************************************************************
28 $History: MmiStart.c
29
30 Oct 11, 2005 REF: LOCOSTO-SPR-34629 - xpradipg
31 Description: Temporary removal of animation logo and replacing with
32 static image
33 Solution: The Animation at bootup is removed and replaced with a static
34 image also the display of logo is done before initiating the
35 AT_CMD_CFUN full functionality
36
37 Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
38 Solution: The CF state is maintained in flash. During bootup the CF icon in the idle screen
39 is displayed depending upon its state in the ffs
40
41 25/10/00 Original Condat(UK) BMI version.
42
43 Dec 23, 2005 REF: SR13873 - x0020906
44 Description : Store the FFS value into current sound structure
45 Fix : Call setDefaultSound () to assign FFS value into current sound structure.
46
47 $End
48
49 *******************************************************************************/
50
51
52
53
54 /*******************************************************************************
55
56 Include files
57
58 *******************************************************************************/
59 #define ENTITY_MFW
60
61 //#define CO_UDP_IP temp till xml file ready
62
63 /* includes */
64 #include <string.h>
65 #include <stdio.h>
66 #include <stdlib.h>
67
68 #if defined (NEW_FRAME)
69 #include "typedefs.h"
70 #include "vsi.h"
71 #include "pei.h"
72 #include "custom.h"
73 #include "gsm.h"
74 #else
75
76 #include "STDDEFS.H"
77 #include "custom.h"
78 #include "gsm.h"
79 #include "vsi.h"
80
81 #endif
82 #include "mfw_sys.h"
83 #include "prim.h"
84
85
86 #include "mfw_mfw.h"
87 #include "mfw_win.h"
88 #include "mfw_kbd.h"
89 /* SPR#1428 - SH - New Editor changes */
90 #ifndef NEW_EDITOR
91 #include "mfw_edt.h"
92 #endif
93 #include "mfw_icn.h"
94 #include "mfw_mnu.h"
95
96 #include "mfw_lng.h"
97 #include "mfw_nm.h"
98 #include "mfw_icn.h"
99 #include "mfw_sim.h"
100 #include "mfw_sat.h"
101 #include "mfw_phb.h"
102 #include "ksd.h"
103 #include "psa.h"
104 #include "mfw_sms.h"
105 #include "mfw_tim.h"
106 #include "mfw_mme.h" // SH - so we can call mmeInit in show_welcome_cb
107
108 #include "MmiMmi.h"
109 #include "MmiDummy.h"
110 #include "MmiDialogs.h"
111 #include "MmiLists.h"
112
113 #include "MmiMain.h"
114 #include "mmiCall.h"
115 #include "MmiStart.h"
116 #include "MmiPins.h"
117 #include "MmiIdle.h"
118 #include "Mmiicons.h"
119 #include "MmiSettings.h"
120 #include "MmiMenu.h"
121 #include "MmiNetwork.h"
122 #include "MmiServices.h"
123 #include "MmiBookController.h"
124 #include "MmiBookServices.h"
125 #include "MmiNetwork.h"
126 #include "MmiSimToolkit.h"
127 #include "MmiVoiceMemo.h"
128 #include "MmiCPHS.h"
129 #include "mmiSmsIdle.h"
130 #include "mmiSmsMenu.h"
131
132 /* Set Default FFS value to sound structure - RAVI - 23-12-2005 */
133 #ifdef NEPTUNE_BOARD
134 #include "MmiSounds.h"
135 #endif
136 /* END RAVI */
137
138 #ifdef BTE_MOBILE
139 #include "mmiBluetooth.h"
140 #endif
141
142 #ifdef MMI_GPRS_ENABLED
143 #include "MmiGprs.h"
144 #endif /* GPRS */
145
146 /* SPR759 - SH*/
147 #ifdef MMI_HOMEZONE_ENABLED
148 #include "MmiHomezone.h"
149 #endif
150
151 /* SPR1983 - SH */
152 #ifdef FF_WAP
153 #include "MmiWapFfs.h"
154
155 /* SPR2086 - SH */
156 #include "AUIWapext.h"
157 #endif
158
159 #ifdef FF_EM_MODE
160 #include "MmiEm.h"
161 #endif
162
163 #include "cus_aci.h"
164
165 #include "prim.h"
166 #ifndef PCM_2_FFS
167 #include "pcm.h"
168 #endif
169
170
171 #include "mmiColours.h"
172
173 #ifndef MFW_EVENT_PASSED
174 #define MFW_EVENT_PASSED 0
175 #endif
176
177 // Jun 23 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
178 #include "mfw_ffs.h"
179
180
181 extern void sms_cb_init (void);
182
183 /*******************************************************************************
184
185 Static data
186
187 *******************************************************************************/
188
189 static MfwHnd win;
190 static MfwHnd kbd;
191
192 /* The following information controls the welcome animation
193 */
194 #define WELCOME 1
195 #define NO_WELCOME 0
196
197 static MfwHnd win_animation;
198 static USHORT animation_index;
199 static U8 welcome_status;
200 /* SPR877 - SH - set to TRUE if welcome animation has finished */
201 UBYTE animation_complete = FALSE;
202
203 /*******************************************************************************
204
205 Local prototypes
206
207 *******************************************************************************/
208
209 static int winEvent( MfwEvt e, MfwWin *w );
210 static int keyEvent( MfwEvt e, MfwKbd *k );
211
212 static void (*show)( void );
213 static void showDefault( void );
214
215 /* SH - moved showwelcome primitive to header file */
216 static int show_welcome_cb(T_MFW_HND win, USHORT identifier, UBYTE reason);
217 // Oct 11, 2005 REF: LOCOSTO-SPR-34629 - xpradipg
218 #ifdef TI_PS_UICC_CHIPSET_15
219 extern unsigned char TIlogColour[];
220 #endif
221 /*******************************************************************************
222
223 Private methods
224
225 *******************************************************************************/
226
227 /*******************************************************************************
228
229 $Function: winEvent
230
231 $Description: Window event handler, handles window visible events and
232 ignores all others
233
234 $Returns: MFW_EVENT_CONSUMED or MFW_EVENT_PASSED
235
236 $Arguments: e, event to be handles, w, window handle
237
238 *******************************************************************************/
239
240 static int winEvent( MfwEvt e, MfwWin *w )
241 {
242 TRACE_FUNCTION("WinEvent(Start)");
243 switch( e )
244 {
245 case MfwWinVisible:
246 {
247 if (w->flags & MfwWinVisible)
248 show();
249 }
250 break;
251
252 default:
253 {
254 return MFW_EVENT_PASSED;
255 }
256 }
257
258 return MFW_EVENT_CONSUMED;
259 }
260
261
262 /*******************************************************************************
263
264 $Function: winanimEvent
265
266 $Description: Handle events during the window animation
267
268 $Returns: None.
269
270 $Arguments: None.
271
272 *******************************************************************************/
273
274 static int winanimEvent( MfwEvt e, MfwWin *w )
275 {
276
277 TRACE_FUNCTION("winanimEvent");
278
279 switch( e )
280 {
281 case MfwWinVisible:
282 dspl_ClearAll();
283
284 break;
285 default:
286 {
287 return MFW_EVENT_PASSED;
288 }
289 }
290
291 return MFW_EVENT_CONSUMED;
292 }
293
294
295
296 /*******************************************************************************
297
298 $Function: startregis
299
300 $Description: All we need to do here is start the SIM
301
302 $Returns: None.
303
304 $Arguments: None.
305
306 *******************************************************************************/
307
308 static void startregis( void )
309 {
310 TRACE_FUNCTION("start registration");
311 // Oct 11, 2005 REF: LOCOSTO-SPR-34629 - xpradipg
312 // the static image is displayed just before intiating the full functionality
313 #ifdef TI_PS_UICC_CHIPSET_15
314 dspl_BitBlt2(WELCOME_ANI_POS_X, WELCOME_ANI_POS_Y,176,60,(char *)&TIlogColour[0],0,ICON_TYPE_256_COL);
315 #endif
316 sim_activate();
317
318
319
320 }
321
322 /*******************************************************************************
323
324 Public methods
325
326 *******************************************************************************/
327
328 /*******************************************************************************
329
330 $Function: startInit
331
332 $Description: Initialises the MMI startup functions
333
334 $Returns: None.
335
336 $Arguments: None.
337
338 *******************************************************************************/
339
340 void startInit( void )
341 {
342
343 #ifdef FF_MMI_MMS
344 /* TISHMMS Project */
345 extern void mms_wap_data_init(void);
346 extern void mms_mms_data_init(void);
347 #endif
348
349 // T_MFW_HND hnd; // RAVI
350
351 /* Assume the welcome status is welcome
352 */
353 welcome_status = WELCOME;
354
355 animation_complete = FALSE;
356
357 /* unset the flag for ready state at the beginning*/
358 smsidle_unset_ready_state();
359
360 /* setup signalling and AUTOFOCUS
361 */
362 mfwSetSignallingMethod( 1 );
363 winAutoFocus( TRUE );
364
365 /* API/GW - Set Colour of displays */
366 colour_initial_colours();
367
368 /* GW-SPR#1035-Added SAT changes by Nebi (changed initialisation order). */
369 /* initialise network services */
370 simToolkitInit( 0 );
371 bookInitialise( 0 );
372 callInit( 0 );
373 iconsInit();
374
375 #ifdef BTE_MOBILE
376 mmi_bt_init();
377 #endif
378
379 /* Handlers created on windows */
380 pin_init( 0 );
381 networkInit( 0 );
382 smsidle_start(0, NULL);
383 servicesInit( 0 );
384
385 idleInit( 0 );
386 voice_memo_init ();
387 voice_mail_init ();
388 sms_cb_init ();
389
390 mmi_cphs_init();
391
392 /* SPR#2346 - SH - GPRS */
393 #ifdef MMI_GPRS_ENABLED
394 GPRS_Init();
395 #endif /* GPRS */
396
397 #ifndef NEPTUNE_BOARD
398 #ifdef FF_EM_MODE
399 mmi_em_init();/*MC SPR1209 engineering mode*/
400 #endif
401
402 /* SPR#2086 - SH - Startup WAP */
403 #if defined (FF_WAP) && defined (FF_GPF_TCPIP)
404 AUI_wap_init();
405 #endif
406
407 #ifdef FF_MMI_MMS
408 /* TISHMMS Project */
409 /*init mms wap profile*/
410 mms_wap_data_init();
411 mms_mms_data_init();
412 #endif
413 #else /* NEPTUNE_BOARD */
414 /* NEPTUNE: Sumit*/
415 #if 0
416 /* SPR#2346 - SH - GPRS */
417 #ifdef MMI_GPRS_ENABLED
418 GPRS_Init();
419 #endif /* GPRS */
420
421 #ifdef FF_EM_MODE
422 mmi_em_init();/*MC SPR1209 engineering mode*/
423 #endif
424
425 /* SPR#2086 - SH - Startup WAP */
426 #if defined (FF_WAP) && defined (FF_GPF_TCPIP)
427 AUI_wap_init();
428 #endif
429
430 #ifdef FF_MMI_MMS
431 /* TISHMMS Project */
432 /*init mms wap profile*/
433 mms_wap_data_init();
434 mms_mms_data_init();
435 #endif
436 #endif /* if 0 */
437 #endif /* NEPTUNE_BOARD */
438
439 /* Set FFS value into sound structure - RAVI - 21-12-2005 */
440 #ifdef NEPTUNE_BOARD
441 setDefaultSound();
442 #endif
443 /* END RAVI - 21-12-2005 */
444
445 /* Retrive the configurable ring tone stored */
446 #ifdef NEPTUNE_BOARD
447
448 #ifdef FF_MMI_MULTIMEDIA
449 setDefaultMSLTone ();
450 #endif
451 #endif
452 /* End */
453
454 /* SH - PIN screen now comes before welcome screen */
455 startregis();
456 }
457
458 /*******************************************************************************
459
460 $Function: startExit
461
462 $Description: Stops the MMI start windows, basically reverses the effect
463 of the startInit above
464
465 $Returns: None.
466
467 $Arguments: None.
468
469 *******************************************************************************/
470
471 void startExit( void )
472 {
473 /* remove keyboard handlers
474 */
475 kbdDelete(kbd);
476 kbd = 0;
477
478 /* SPR#2346 - SH - GPRS */
479 #ifdef MMI_GPRS_ENABLED
480 GPRS_Exit();
481 #endif /* GPRS */
482
483
484 /* shut down the sim toolkit
485 */
486 simToolkitExit();
487
488 /* close the phonebook, calls, idle, services, icons, sounds
489 and network handlers
490 */
491 bookExit();
492
493 #ifdef BTE_MOBILE
494 mmi_bt_exit();
495 #endif
496
497 callExit();
498 idleExit();
499 smsidle_destroy ();
500 iconsExit();
501 cphs_exit(); //MC
502 #ifdef FF_EM_MODE
503 mmi_em_exit();/*MC, SPR1209 engineering mode */
504 #endif
505 }
506
507 /*******************************************************************************
508
509 $Function: startExec
510
511 $Description: start window execute method
512
513 $Returns: None.
514
515 $Arguments: reason, for invoking the execute method,
516 next, not used passed for compatibility
517
518 *******************************************************************************/
519
520 void startExec( int reason, MmiState next )
521 {
522 switch (reason)
523 {
524 case PhoneInit:
525 {
526 /* initialising, run the animation
527 */
528 sim_init(); /* init SIM handler */
529 nm_init(); /* init REG handler */
530 startInit(); /* init startup module */
531
532 }
533 break;
534
535 case FirstTimeNMFound:
536 {
537 /* first time through setup window and idle handlers
538 */
539 TRACE_EVENT("NM Found");
540
541 winFocus( win );
542 winShow( win );
543 idleExec( IdleNormal, 0 );
544
545 }
546 break;
547
548 case NmSearching:
549 {
550 /* just trace on the search event for now
551 */
552 TRACE_EVENT("Search");
553
554 }
555 break;
556
557 default:
558 {
559 /* no default handling
560 */
561 break;
562 }
563 }
564 }
565
566 /*******************************************************************************
567
568 $Function: startWhoIsFocused
569
570 $Description: provides handle of currently focussed window
571
572 $Returns: mfwFocus
573
574 $Arguments: None.
575
576 *******************************************************************************/
577
578 MfwHnd startWhoIsFocused( void )
579 {
580 return( mfwFocus );
581 }
582
583 /*******************************************************************************
584
585 $Function: showwelcome
586
587 $Description: shows a welcome Message when swiching on the mobile
588
589 $Returns: none
590
591 $Arguments:
592
593 *******************************************************************************/
594
595 void showwelcome (T_MFW_HND win) /* SH - not static, as now externally called */
596 {
597 T_DISPLAY_DATA display_info;
598 TRACE_FUNCTION("showwelcome ()");
599
600
601 idle_set_starting_up(FALSE); /*SPR#1662-NH Starting is finished for Idle */
602 // Oct 11, 2005 REF: LOCOSTO-SPR-34629 - xpradipg
603 // Since the static image is displayed at bootup and it is preponed, this
604 // function will be called after the sim insert indication is recieved hence
605 // we go ahead with the display of the Idle screen by calling show_welcome_cb
606 #ifdef TI_PS_UICC_CHIPSET_15
607 show_welcome_cb(win,0,0);
608 #else
609 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtNull, TxtNull , COLOUR_STATUS_WELCOME);
610 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)show_welcome_cb, FOUR_SECS, 0 );
611
612 /*
613 * Call Icon
614 */
615 mmi_dialogs_insert_animation (info_dialog (win, &display_info), 400 ,(MfwIcnAttr*)&welcome_Attr,animwelcome);
616 #endif
617 }
618
619 /*******************************************************************************
620
621 $Function: show_welcome_cb
622
623 $Description: shows a welcome Message when swiching on the mobile
624
625 $Returns: none
626
627 $Arguments:
628
629 *******************************************************************************/
630
631 static int show_welcome_cb(T_MFW_HND win, USHORT identifier, UBYTE reason)
632 {
633 TRACE_FUNCTION("show_welcome_cb");
634
635 /* SH - removed call to startregis, now in startInit */
636
637 mmeInit(); //fieldstrength driver
638
639 /* SPR759 - SH. Initialise homezone */
640 #ifdef MMI_HOMEZONE_ENABLED
641 homezoneInit();
642 #endif /* HOMEZONE */
643
644 /* SPR#1983 - SH - Initialise flash files for WAP */
645
646 #if defined (FF_WAP) && defined (CO_UDP_IP)
647 flash_wap_init();
648 #endif /* WAP */
649
650 /* SPR#1112 - SH - Check which phonebook is active. If FFS is formatted and
651 * FFS phonebook is selected, initialise it. */
652 #ifndef NEPTUNE_BOARD
653 #ifdef INT_PHONEBOOK
654 bookInitInternal();
655 #endif
656 #else
657 #ifdef INT_PHONEBOOK
658 // bookInitInternal(); //SUMIT: Neptune: removed call to bookInitInternal for FFS
659 #endif
660 #endif
661
662 /* SPR#1352 - SH - Initialise TTY */
663 #ifdef MMI_TTY_ENABLED
664 call_tty_init();
665 #endif
666 /* end SH */
667
668 animation_complete = TRUE;
669
670 /* SPR#1929 - DS - Check if there is voicemail waiting. Port of 1960 */
671 GetCphsVoicemailStatus(0);
672 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
673 // Setting the CF icon state depending on the value in flash.
674 if(FFS_flashData.CFState==TRUE)
675 {
676 iconsSetState(iconIdCallFor);
677 }
678 else
679 {
680 iconsDeleteState(iconIdCallFor);
681 }
682
683 idleEvent(IdleUpdate);
684
685 return 1; // RAVI - Changed Return to Return 1
686 }
687
688 /* GW return when animation is complete (and the idle screen can be displayed*/
689 int mmiStart_animationComplete( void )
690 {
691 return (animation_complete);
692 }
693
694
695 #ifdef NEW_KEY_INPUT
696 #include "kpd_cfg.h"
697 #include "mfw_kbd.h"
698 #define MAX_KEY 255
699 U32 mfw_kbd_map [MAX_KEY] =
700 {
701 KEY_0,
702 KEY_1,
703 KEY_2,
704 KEY_3,
705 KEY_4,
706 KEY_5,
707 KEY_6,
708 KEY_7,
709 KEY_8,
710 KEY_9,
711 KEY_STAR,
712
713 };
714
715 void mfw_keyMap(int mfw_key, int hw_key)
716 {
717 if ((hw_key >0) && (hw_key<MAX_KEY))
718 mfw_kbd_map[hw_key] = mfw_key;
719 }
720
721 void start_setKeys( void )
722 {
723 mfw_keyMap(KEY_0, KPD_KEY_0);
724 mfw_keyMap(KEY_1, KPD_KEY_1);
725 mfw_keyMap(KEY_2, KPD_KEY_2);
726 mfw_keyMap(KEY_3, KPD_KEY_3);
727 mfw_keyMap(KEY_4, KPD_KEY_4);
728 mfw_keyMap(KEY_5, KPD_KEY_5);
729 mfw_keyMap(KEY_6, KPD_KEY_6);
730 mfw_keyMap(KEY_7, KPD_KEY_7);
731 mfw_keyMap(KEY_8, KPD_KEY_8);
732 mfw_keyMap(KEY_9, KPD_KEY_9);
733 mfw_keyMap(KEY_STAR, KPD_KEY_STAR);
734 mfw_keyMap(KEY_HASH, KPD_KEY_DIESE);
735 mfw_keyMap(KEY_LEFT, KPD_KEY_SOFT_LEFT);
736 mfw_keyMap(KEY_RIGHT, KPD_KEY_SOFT_RIGHT);
737 mfw_keyMap(KEY_CALL, KPD_KEY_CONNECT);
738 mfw_keyMap(KEY_HUP, KPD_KEY_DISCONNECT);
739 mfw_keyMap(KEY_POWER, KPD_PWR);
740
741 mfw_keyMap(KEY_VOLUP, KPD_KEY_VOL_UP);
742 mfw_keyMap(KEY_VOLDOWN, KPD_KEY_VOL_DOWN);
743
744 mfw_keyMap(KEY_MNUUP, KPD_KEY_UP);
745 mfw_keyMap(KEY_MNUDOWN, KPD_KEY_DOWN);
746 mfw_keyMap(KEY_MNULEFT, KPD_KEY_LEFT);
747 mfw_keyMap(KEY_MNURIGHT, KPD_KEY_RIGHT);
748
749
750 }
751
752 #endif
753
754 /*******************************************************************************
755
756 End of File
757
758 *******************************************************************************/