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

📄 mmistart.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 2 页
字号:
				#ifdef _M188_
                    pwr_start_fast_charge();    ///zym revised 08/14
                #endif
                ChargeWin();
                //2003/12/23,talcon add for outerIdle charge
                //setChargeState(OUTERIDLECHARGE_OFF,0);//2004-03-21 Sunny remove
            }
            else
            {//power off
                //2003/12/23,talcon add for outerIdle charge
                //setChargeState(OUTERIDLECHARGE_NONE,0);//2004-03-21 Sunny remove
                SwitchOffMobile();
            }

        }
        else
        {
            //	if(pwr_Status.remain_capacity>=10)
            AniandSerachon();
            //2004.4.4 WYJ modify
            StartPlayByReason(POWERONPLAY, 0);
            //else//power off
            //	SwitchOffMobile();
            //LowVol_Warning();
        }
    }
    /*
        if(pwr_Status.charger_plugged){//charger is still in
                if(pwr_Status.remain_capacity<=5)
                    pwr_start_fast_charge();    ///zym revised 08/14
                ChargeWin();
            
        }else{
    //  		if(pwr_Status.remain_capacity>=10)
                AniandSerachon();
        }*/
    //end of hxl add 0905--------------------------------------------------------

}

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

 $Function:    	startExit

 $Description:	Stops the MMI start windows, basically reverses the effect
                of the startInit above

 $Returns:		None.

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

void startExit( void )
{
    /* remove keyboard handlers
    */
    kbdDelete(kbd);
    kbd = 0;

    /* SH - GPRS */
    /*	#ifdef MMI_GPRS_ENABLED  //hxl moved it to basewinexit 20020905----------
        mmiGprsExit( 0 );
        #endif*//* GPRS */

    //	voice_memo_exit ();

    /* shut down the sim toolkit
    */
    simToolkitExit();

    /* close the phonebook, calls, idle, services, icons, sounds
       and network handlers
    */
    bookExit();
    callExit();
    idleExit();
    //2003/12/23,talcon add
    outerIdleExit();
    smsidle_destroy ();
    //JVJE	soundExit();
    //	servicesExit();  //fails	
    iconsExit();
    //    networkExit();	//fails!
    //   cphs_exit(); //MC  //hxl moved it to basewineixt() 20020905
}

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

 $Function:    	startExec

 $Description:	start window execute method

 $Returns:		None.

 $Arguments:	reason, for invoking the execute method,
                next, not used passed for compatibility
 
*******************************************************************************/

void startExec( int reason, MmiState next )
{
    switch( reason )
    {
    case PhoneInit:
        {
            /* initialising, run the animation
            */
            sim_init();                     /* init SIM handler         */
            nm_init();                      /* init REG handler         */
            startInit();                        /* init startup module      */

            //JVJE			welcomeAnimation();
        }
        break;

    case FirstTimeNMFound:
        {
            /* first time through setup window and idle handlers
            */
            TRACE_EVENT("NM Found");

            //gb			show = showWelcomeFound;
            winFocus( win );
            winShow( win );
            idleExec( IdleNormal, 0 );

        }
        break;

    case NmSearching:
        {
            /* just trace on the search event for now
            */
            TRACE_EVENT("Search");

        }
        break;

    default:
        {
            /* no default handling
            */
            break;
        }
    }
}

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

 $Function:    	startWhoIsFocused

 $Description:	provides handle of currently focussed window

 $Returns:		mfwFocus

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

MfwHnd startWhoIsFocused( void )
{
    return( mfwFocus );
}

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

 $Function:    	showwelcome

 $Description:	 shows a welcome Message when swiching on the mobile
 
 $Returns:		none

 $Arguments:	
                
*******************************************************************************/

void showwelcome (T_MFW_HND win)            /* SH - not static, as now externally called */
{
    T_DISPLAY_DATA   display_info;
    T_MFW_HND   dialogwin;

    TRACE_FUNCTION("showwelcome ()");
    //if(FFS_flashData.PLMN_selection_mode == NM_AUTOMATIC)
    nm_registration (NM_AUTOMATIC,0, 0);
    //dspl_ClearAll();/*2003/12/16, wangyan modify*/
    dialog_info_init(&display_info);//gdy add
    idle_set_starting_up(FALSE); /*SPR#1083-JVJ Starting is finished for Idle */
    display_info.LeftSoftKey  = '\0';
    display_info.RightSoftKey = '\0';
    display_info.TextId       = '\0';
    display_info.TextId2      = '\0';
    display_info.TextString   = '\0';
    display_info.TextString2  = '\0';
	/* 2004/05/13 sunsj modify */
#if (MAIN_LCD_SIZE==3)
	display_info.Time         = 2100; 
#elif ( MAIN_LCD_SIZE==4 )
    display_info.Time         = 1750;

#elif ( MAIN_LCD_SIZE==2 )
    display_info.Time         = 2100; //Sunny modify. old:3000
#endif
    display_info.Callback     = (T_VOID_FUNC)show_welcome_cb;
    /*zy:2003-02-11 couldn't stop anim avoid have no time*/
    // display_info.KeyEvents    =  KEY_ALL^KEY_POWER;//zy 1016
    display_info.KeyEvents    = NULL;//zy 2003-02-11
    /*end of zy change 2003-02-11*/
    display_info.Identifier    =StartAnimDialog;
    /*
     * Call Icon
     */

    animation_complete = FALSE;    
    dialogwin=info_dialog (win, &display_info);
    /*2003/12/02,talcon add to fix bug no animation*/
    if( dialogwin == NULL )return;

    //2004-04-21 Sunny add 
    switch( FFS_flashData.onoffanimation )
    {
    case 0:
        mmi_dialogs_insert_fixmov_animation(dialogwin, 350 ,WELCOMEANIM);
        break;
    case 1://Mobileinnovation			
        break;
    case 2://flower
        mmi_dialogs_insert_fixmov_animation(dialogwin, 350 ,WELCOMEANIM);
        break;
    case 3://Skyrocket
        break;
    }
    //2004-04-21 Sunny add end

#if 0
    switch( FFS_flashData.onoffanimation )
    {
    /*case 0:  xsf remarked it 2003.01.14
     mmi_dialogs_insert_fixmov_animation(dialogwin, 400 ,WELCOMEANIM,10);
     break;
        */
    case 2:
        //            mmi_dialogs_insert_fixmov_animation(dialogwin, 400 ,ANIM3,7);
        //            mmi_dialogs_insert_fixmov_animation(dialogwin, 400 ,ANIM3);/*2003/12/13, wangyan modify*/
        break;
    case 1:
        //            mmi_dialogs_insert_fixmov_animation(dialogwin, 350 ,ANIM2,12);
        mmi_dialogs_insert_fixmov_animation(dialogwin, 350 ,WELCOMEANIM);/*2003/12/4, wangyan modify*/
        break;
    default:
        break;
    }
    /*2003/12/02,talcon add to fix bug no animation*/
#endif
    r2d_refresh();  
}

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

 $Function:    	show_welcome_cb

 $Description:	 shows a welcome Message when swiching on the mobile
 
 $Returns:		none

 $Arguments:	
                
*******************************************************************************/

static int show_welcome_cb(T_MFW_HND win, USHORT identifier, UBYTE reason)
{
    char imei[16];//hxl add for check imei, 2002-11-26

    TRACE_FUNCTION("show_welcome_cb");

    //check imei,if it isn't corret, write the default imei, hxl add 2002-11-26
    memset(imei,0,16);
    get_imei(imei);

    if( IsNumeric(imei)==FALSE )
    {
        strcpy(imei,"446019197507590");
        write_imei((U8 *)imei);
    }
    ffsfile_init();//hxl moved to this 2002-11-25
    wapffsfile_init();//zhaowm 2002/12/26

    /* SH - removed call to startregis, now in startInit */

    mmeInit();  //fieldstrength driver

    /* SPR759 - SH. Initialise homezone */
#ifdef MMI_HOMEZONE_ENABLED
    homezoneInit();
#endif /* HOMEZONE */

    animation_complete = TRUE;
    anim_real_complete = TRUE;  //xsf add 2002.11.26 for idle update when PIN or HOSTKEY is open
    if( FFS_flashData.contrast_intensity<0||FFS_flashData.contrast_intensity>6 )
        FFS_flashData.contrast_intensity=3;
#if ((ModeType ==1) || (ModeType ==2) || (ModeType ==3))
    contrast_intensity=FFS_flashData.contrast_intensity*4+69;
#else
    contrast_intensity=FFS_flashData.contrast_intensity*4+0x14B;
#endif
    //	  ColorLCD_Init(0);
    ContrastAdjust(FFS_flashData.contrast_intensity);//zy avoid white screen
    timStart(gtVibator);
/* zhq, 2004/07/08, add for we use pin_outer_wait to init sub screen
and we do not refresh untile main screen drawIdle. */
    main_sreen_init_complete = TRUE;

    idleExec(IdleNormal, 0);//zy add 0926 for go to idle when animation_complete
    LineControl=1;
    // 2003/10/9, zhq, remove it for test.
    //   TM_EnableWatchdog();  //enable hardware watchdog 2003/4/7 ganchunhui
    Set_ForResetIndication(); //set the value for indication the reset
    //cphs_select_line(MFW_SERV_LINE2); 
}

//hxl add for chargerwin entry0905--------------------------------

void AniandSerachon(void)
{
    //pin_init( 0 );  //xsf removed startInit()
    mmi_cphs_init();
    // SH...17/01/02. 
#ifdef MMI_GPRS_ENABLED
    mmiGprsInit();
#endif // GPRS 

    pwr_Status.ChargingVirtualKeyFlag=1;
    // SH - PIN screen now comes before welcome screen 
    startregis();   
    if( FFS_flashData.Band_restriction!=0 )//If it is not the default setting for band_Locked
        LockBand=1;
    //  ColorLCD_Init(1); //zy move 12/29
    //   ContrastAdjust(3);//zy move 12/29
    if( als_status_checkicon()==1&&LineControl!=0 )
    {
        LineControl=sAT_PercentALS(CMD_SRC_LCL, ALS_MOD_SPEECH);
    }
    else if( als_status_checkicon()==2&&LineControl!=0 )
    {
        LineControl=sAT_PercentALS(CMD_SRC_LCL, ALS_MOD_AUX_SPEECH);

    }

}

void BaseWinExit(void)
{
    cphs_exit(); //MC

    /* SH - GPRS */
#ifdef MMI_GPRS_ENABLED
    mmiGprsExit( 0 );
#endif/* GPRS */

    SIM_PowerOff();

    //  	if(ChargerPlugIn())
    /*  	if(pwr_Status.charger_plugged){
            animation_complete=FALSE;
            ChargeWin();
        }else {*/
    SwitchOffMobile();

}

void SwitchOffMobile(void)
{
    //these are move from mainshutdown
    mmiExit();/* RM 20-07 */
    //   SIM_PowerOff();//hxl moved it to basewinexit() 20020906
#ifndef _SIMULATION_
    AI_Power(0);
#endif

}

//check if string is combined by number(0~9)
BOOL IsNumeric(char *s)
{
    while( *s != '\0' )
    {
        if( *s >'9' && *s <'0' )
            return FALSE;
        s++;
    }
    return TRUE;
    /*
        int len=0;
        int i=0;
        U8  *us=(U8 *)s;
    
        len=strlen(s);
        for(i=0;i<len;i++)
        {
            if((us[i]>0x39)||(us[i]<0x30))
                break;
        }
    
        if(i<len)
            return FALSE;
    
        return TRUE;
        */
}
//end of hxl add 0905------------------------------------

/*******************************************************************************
                                                                             
                                End of File
                                                                              
*******************************************************************************/

⌨️ 快捷键说明

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