⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmistart.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 2 页
字号:
/*******************************************************************************

                    CONDAT (UK)

********************************************************************************                                                                              

 This software product is the property of Condat (UK) Ltd and may not be
 disclosed to any third party without the express permission of the owner.                                 
                                                                              
********************************************************************************

 $Project name:	Basic MMI                                                      
 $Project code:	BMI (6349)                                                           
 $Module:		Start
 $File:		    MmiStart.c
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    25/10/00                                                      
                                                                               
********************************************************************************
                                                                              
 Description:

    This provides the start code for the MMI
                        
********************************************************************************
 $History: MmiStart.c

    25/10/00			Original Condat(UK) BMI version.	
        08/08            fzq modified
  26/08/02		hxl add for charger
    29/08/02		move the blinktimer from mmistart to this file, it is after welocome animation

 $End

*******************************************************************************/




/*******************************************************************************
                                                                              
                                Include files
                                                                              
*******************************************************************************/
#define ENTITY_MFW

/* includes */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#if defined (NEW_FRAME)

    #include "typedefs.h"
    #include "vsi.h"
    #include "pei.h"
    #include "custom.h"
    #include "gsm.h"

#else

    #include "stddefs.h"
    #include "custom.h"
    #include "gsm.h"
    #include "vsi.h"

#endif
#include "mfw_sys.h"

#include "p_sim.h"


#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_edt.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"

#include "mfw_lng.h"
#include "mfw_nm.h"
#include "mfw_icn.h"
#include "mfw_sim.h"
#include "mfw_sat.h"
#include "mfw_phb.h"
#include "ksd.h"
#include "psa.h"
#include "mfw_sms.h"
#include "mfw_tim.h"
#include "mfw_mme.h" 	// sbh - so we can call mmeInit in show_welcome_cb
#include "mfw_ffs.h"	//xzy add for wdt counter
#include "fieldtest.h"


#include "MmiMmi.h"
#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiLists.h"

//#include "MmiCall.h"
#include "MmiMain.h"
#include "MmiCall.h"
#include "MmiStart.h"
#include "MmiPins.h"
#include "MmiIdle.h"
#include "MmiIcons.h"
#include "MmiSettings.h"
#include "MmiMenu.h"
#include "MmiNetwork.h"
#include "MmiServices.h"
#include "MmiBookController.h"
#include "MmiNetwork.h"
#include "MmiSimToolkit.h"
#include "MmiVoiceMemo.h"
#include "MmiCPHS.h"

/* SPR759 - SH*/
#ifdef MMI_HOMEZONE_ENABLED
    #include "MmiHomezone.h"
#endif

#include "cus_aci.h"
#include "p_sim.h"
#include "pcm.h"
#include "mfw_ffs.h"
#include "pwr.h"//hxl add 20020909
#ifndef MFW_EVENT_PASSED
    #define MFW_EVENT_PASSED 0
#endif

#include "mmiouterIdle.h"
// 2004.4.9 wyj add 
#include "mmisounds_defs.h"
void StartPlayByReason(AUDIO_REASON reasonid, BOOLEANS index);

extern int LineControl;
extern int g_switchon;  ///zym added for industrialization 10/21
extern sms_cb_init ();
extern void TM_EnableWatchdog(void);
extern unsigned char IsReset();
/*******************************************************************************
                                                                              
                                Static data
                                                                              
*******************************************************************************/

static MfwHnd win;
static MfwHnd kbd;
extern int g_initfinishflag;
int contrast_intensity;

/* The following information controls the welcome animation
*/
#define WELCOME     1
#define NO_WELCOME  0

static MfwHnd win_animation;
static USHORT animation_index;
static U8 welcome_status;
UBYTE  IsShowGoodbye = FALSE;//2004-04-23 Sunny add
/* SPR877 - SH - set to TRUE if welcome animation has finished */
UBYTE animation_complete = FALSE;
UBYTE anim_real_complete = FALSE;    //xsf add 2002.11.26 for idle update when PIN or HOSTKEY is open
/* zhq, 2004/07/08, modified for we will use pin_outer_wait to init sub screen
and only refresh sub screen until main screen drawIdle. */
UBYTE main_sreen_init_complete = FALSE;
U8    LockBand=0; 

UBYTE   OverleapRegist=0;//hxl add ,when flash error ,we overleap the regist,20021029
int NotCharingMode = TRUE;	/* 2004/07/05 sunsj modify */
/*******************************************************************************
                                                                              
                                Local prototypes
                                                                              
*******************************************************************************/

static int winEvent( MfwEvt e, MfwWin *w );
static int keyEvent( MfwEvt e, MfwKbd *k );

static void (*show)( void );
static void showDefault( void );

/* SH - moved showwelcome primitive to header file */
static int show_welcome_cb(T_MFW_HND win, USHORT identifier, UBYTE reason);

//hxl add 20020905 for correct charger win entry -----------
void AniandSerachon(void);
void BaseWinExit(void);
void SwitchOffMobile(void);
extern int write_imei(U8 *imei);
BOOL IsNumeric(char *s);
extern void Set_ForResetIndication();

//end of hxl add 20020905----------------------------------

/*******************************************************************************
                                                                              
                                Private methods
                                                                              
*******************************************************************************/

/*******************************************************************************

 $Function:    	winEvent

 $Description:	Window event handler, handles window visible events and
                ignores all others
 
 $Returns:		MFW_EVENT_CONSUMED or MFW_EVENT_PASSED

 $Arguments:	e, event to be handles, w, window handle
 
*******************************************************************************/

static int winEvent( MfwEvt e, MfwWin *w )
{
    TRACE_FUNCTION("WinEvent(Start)");
    switch( e )
    {
    case MfwWinVisible:
        {
            if( w->flags & MfwWinVisible )
                show();
        }
        break;

    default:
        {
            return MFW_EVENT_PASSED;
        }
    }

    return MFW_EVENT_CONSUMED;
}


/*******************************************************************************

 $Function:    	winanimEvent

 $Description:	Handle events during the window animation

 $Returns:		None.

 $Arguments:	None.
 
*******************************************************************************/
#if 0 /*2003/12/16, wangyan modify*/
static int winanimEvent( MfwEvt e, MfwWin *w )
{

    TRACE_FUNCTION("winanimEvent");

    switch( e )
    {
    case MfwWinVisible:
        dspl_ClearAll();
        /*dspl_TextOut(0,20,0,(char*)"CONDAT WELCOME"); (GB)*/

        break;
    default:
        {
            return MFW_EVENT_PASSED;
        }
    }

    return MFW_EVENT_CONSUMED;
}
#endif /*2003/12/16, wangyan modify*/


/*******************************************************************************

 $Function:    	startregis

 $Description:	All we need to do here is start the SIM

 $Returns:		None.

 $Arguments:	None.
 
*******************************************************************************/

static void startregis( void )
{
    TRACE_FUNCTION("start registration");
    sim_activate(); 



}

/*******************************************************************************
                                                                              
                                Public methods
                                                                              
*******************************************************************************/

/*******************************************************************************

 $Function:    	startInit

 $Description:	Initialises the MMI startup functions

 $Returns:		None.

 $Arguments:	None.
 
*******************************************************************************/

void startInit( void )
{
    T_MFW_HND hnd;
    //char temp[100];

    /* Assume the welcome status is welcome
    */
    welcome_status = WELCOME;

    /* setup signalling and AUTOFOCUS
    */
    mfwSetSignallingMethod( 1 );
    winAutoFocus( TRUE );
#if 0
    /* initialise network services
    */
    networkInit( 0 );
    iconsInit();
    smsidle_start(0, NULL); /* create a static SMS handling */
    servicesInit( 0 );

    voice_memo_init ();
    voice_mail_init ();
    sms_cb_init ();


    //JVJE    soundInit( 0 );
    callInit( 0 );
    bookInitialise( 0 );
    simToolkitInit( 0 );
    idleInit( 0 );   
#endif
    //GW-SPR#1035-Added SAT changes by Nebi (changed initialisation order).
    /* initialise network services */
    //JVJE	soundInit( 0 );
    simToolkitInit( 0 );
    bookInitialise( 0 );
    //    callInit( 0 );
    iconsInit();

    Forward_Ffsfile_init(); //hxl add for some needed data before show_welcome_cb,2002-11-26
    TRACE_EVENT("Forward_Ffsfile_init");
    callInit( 0 );/*2004/4/27, wangyan modify*/
    /* Handlers created on windows */
    pin_init( 0 );
    networkInit( 0 );   
    smsidle_start(0, NULL); 
    servicesInit( 0 );

	/* 2004/07/05 sunsj modify */
	if((!IsReset())&&(( pwr_Status.swichonstatus)||(g_switchon == 2)))
	{
		if(pwr_Status.charger_plugged)
		{
/* zhq, 2004/07/08, add for we use pin_outer_wait to init sub screen
and we do not refresh untile main screen drawIdle. */
			/* 2004/07/15 sunsj remove */
			//main_sreen_init_complete = TRUE;
			NotCharingMode = FALSE;
		}
	}
    outerIdleInit();
    idleInit( 0 );  

    voice_memo_init ();
    voice_mail_init ();
    sms_cb_init ();
    FieldTestInit();

    if( !FFS_flashData.language )
        MmiRsrcSetChinese();
    else
        MmiRsrcSetEnglish();

    dspl_SetTextMode();


    if( g_switchon == 1 )
    {
        AniandSerachon();
        //2004.4.4 WYJ modify
        StartPlayByReason(POWERONPLAY, 0);
    }
    else
    {
//glowing,2004-06-16,SendVirtualKeyToMMI use MMIStart_completed to check 
//if it can send the virtual key.
#ifdef _M188_    
        g_initfinishflag = 1;
#endif

        //hxl add for charger win entry 20020905------------------------------------
        if( (!IsReset())&&(( pwr_Status.swichonstatus)||(g_switchon == 2)) )
        {//is charger switch the phone?
            /// 		pwr_Status.charger_plugged=(UBYTE)ChargerPlugIn();
            if( pwr_Status.charger_plugged )
            {//charger is still in
				/* 2004/07/05 sunsj modify */
				NotCharingMode = FALSE;
/* zhq, 2004/07/08, add for we use pin_outer_wait to init sub screen
and we do not refresh untile main screen drawIdle. */
				/* 2004/07/15 sunsj remove */
				//main_sreen_init_complete = TRUE;
				  drawOuterIdle();
                if( pwr_Status.remain_capacity<=5 )
				//glowing,2005-05-25, add _M188_ for compatible with M288B( rita project)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -