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

📄 fieldtest.c

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

                    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:		Idle
 $File:		    Fieldtest.c 
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    25/10/00                                                      
                                                                               
********************************************************************************
                                                                              
 Description:

   Handling for the idle screen
                        
********************************************************************************
 $History: Fieldtest.c

    25/10/00			Original Condat(UK) BMI version.	
       
 $End

*******************************************************************************/
/********************************************************************************
 $History: Fieldtest.c  ver2.69
    date         version     comment
    02/09/02     0.10       change the gblink timer to 3seconds, and do not set timer frequentyl ganchh

    21/06/02			zy for forbid update idlewin when the focused win is not focused
                        in idle
    04/08/02            zy change the idle display arrangement
                        and the softkey and relative fuction
    09/08         windy modified
    15/08/02        xsf modified for switch scene mode in idle window
  26/08/02		hxl add for charger
  29/08/02		hxl changed for charger
   18/09/02            xsf add codes for missedcallTone and unreadSMSTone timer 
 $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 <stdio.h>
//#include <string.h>

//#include "mfw_sys.h"

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


#include "p_sim.h"

#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_lng.h"
#include "mfw_edt.h"
#include "mfw_cm.h"
#include "mfw_phb.h"
#include "mfw_sms.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_tim.h"
#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_sat.h"

//#include "spi_drv.h"	//add for hardware status

#include "dspl.h"
#include "MmiMmi.h"

#include "ksd.h"
#include "psa.h"


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

#include "MmiMain.h"
#include "MmiStart.h"

#include "MmiMenu.h"

#include "MmiBookController.h"
#include "MmiBookUtils.h"

#include "MmiCall.h"
#include "MmiNetwork.h"
#include "MmiIcons.h"
#include "MmiEditor.h"


#include "MmiSounds.h"
#include "MmiUserData.h"
#include "MmiSoftKeys.h"
#include "MmiPins.h"

#include "MmiDialogs.h"
#include "MmiIdle.h"
#include "MmiNetwork.h"
#include "MmiSettings.h"
#include "MmiSmsIdle.h"
#include "mfw_ffs.h"
#include "MmiSmsBroadcast.h"
#include "MmiCPHS.h"
#ifdef MMI_HOMEZONE_ENABLED
    #include "MmiHomezone.h"	/* SPR759 - SH*/
#endif
#include "gdi.h"
#include "audio.h"
#include "GameDisplay.h"//zy add 09/18

#include "cus_aci.h"
#include "p_sim.h"
//GW-Remove? #include "pcm.h"
#include "pwr.h" //hxl add for charger
#include "mmicharging.h"
#include "mmiservices.h" //wufei add 
#include "fieldtest.h"
#include "mmibookshared.h"
//#include "bmieastapi.h"/*2003/12/16, wangyan delete*/
//#include "pwr_disch.h"
#include "mmiiconresource.h"    /* 2004/06 sunsj modify for icon manage */

#undef JVJ_USSD_TEST
/* Extern Function declare-----------------------*/
#define SiteOfCheckSumPin     10
extern MfwHnd call_get_window(void);
extern int idleIsFocussed(void);
extern USHORT GetIO12StatusforMode(void);

/* 2004/06 sunsj modify for icon manage */
//extern const unsigned char iconMainIdle12[];

#ifndef _INNOVATION_EMULATOR_
extern char *date;
#endif

typedef          long  WORD32;

ModeCheck_Parameter  ResetRelatedPara;
typedef struct
{
    /* administrative data */

    T_MMI_CONTROL     mmi_control;
    T_MFW_HND         win;
    T_MFW_HND         parent_win;
    T_EDITOR_DATA     editor_data;
    T_MFW_HND         kbd;
    T_MFW_HND         editor_handle;

    /* internal data */
    char        buffer[100];
    UBYTE       status;

    USHORT      position;
} tSpecialMode;

/* 2004/05/21 sunsj add */
typedef struct
{
	T_MMI_CONTROL   mmi_control;
    T_MFW_HND       parent_win;
    T_MFW_HND       factory_win;
    T_MFW_HND       factory_kbd;
	T_MFW_HND		factory_tim;
}FACTORY_TEST_DATA;

#define CIRCLE_FACTORY_TIMES	800
static circle_times = 0;

/*const char * date = "2003.05.16";
const char * ver  = "Ver2.69";
const char * label = "Coordinate_gdy_0516";
const char * purpose    = "Baseline 1.0 1336s108533p6tiberlin";*//*2003/12/1, wangyan modify*/

#ifdef _INNOVATION_EMULATOR_
char * date = "2004.04.21";
#endif

/* 2004/06/30 sunsj modify */
#ifdef _E501_
char * ver  = "E501 1.0.11";
#endif

#ifdef _E505111315_
char * ver  = "E505 1.0.8";
#endif

#ifdef _E50602_
char * ver  = "E506 1.0.8";
#endif

#if defined(_E508_) && defined(_ENCRYPT_)
char * ver  = "E508+ 1.0.8";
#elif defined(_E508_) 
char * ver  = "E508 1.0.8";
#endif

#if defined(_E510_) && defined(_ENCRYPT_) 
char * ver  = "E510+ 1.0.8";
#elif defined(_E510_)
char * ver  = "E510 1.0.8";
#endif

#if  defined(_E512_) && defined(_ENCRYPT_)
char * ver  = "E512+ 1.0.8";
#elif defined(_E512_)
char * ver  = "E512+ 1.0.8";
#endif

#if defined(_E330_)&& defined(_ENCRYPT_)
char * ver  = "E330+ 1.0.8";
#elif defined (_E330_)
char * ver  = "E330+ 1.0.8";
#endif


extern FieldTest    FFS_FieldTest;

//extern FlashData               FFS_flashData;
//extern TffsfileCmd			  ffsfileCmd;
USHORT *RAMValue;   //ram value;


static T_MFW_HND show_timer;         //the timer for show_rssi
static unsigned char refresh_flag;      //the flag for need refresh or not
unsigned char ucNumberOfAbnormal=0;  //ganchh 2003/3/21 for the number of total abnormal number
static unsigned char PhoneIsReseted=0;         //ganchh 2003/3/21 for the Flag of RESET

extern int ffs_status;      //Bob added 02/17	
extern UINT32  *OriginLCDData; //modified by ljq from 9760 to R2D_MWWIDTH*R2D_HEIGHT 2003/4/10

extern UBYTE globalSignalPicNumber;

UBYTE   currentsignalvalue,lastsignalvalue=0;       //xzy add for signal pic number update;

/* 2004/04/01 sunsj add for count key press number */
static int keyPressNumber = 0;

static T_MFW_HND ShowVersion_create(MfwHnd parent_window);
static void ShowVersion_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier, void *parameter);
void ShowVersionSetEditor(T_MFW_HND win);
static void ShowVerionCB (MfwEvt e, MfwKbd *k);
void showVersion_destroy(MfwHnd own_window);

//begin of xzy add for test special mode 2002/12/30
static T_MFW_HND LayeronePara_create(MfwHnd parent_window);
static void LayeronePara_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier,void *parameter);
//void LayeroneParaSetEditor(T_MFW_HND win);
//static void LayeroneParaCB( T_MFW_HND win, USHORT Identifier,UBYTE reason);
//static int  LayeronePara_winCB (T_MFW_EVENT event, T_MFW_WIN * win);
static int LayeronePara_kbd_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard);
static T_MFW_CB showRssi_timercb (T_MFW_EVENT event, T_MFW_TIM *tc);
void LayeronePara_destroy(MfwHnd own_window);
extern void layer1_em_get_rxlevqual(WORD32 *l1_rxlev_scell,WORD32 *l1_rxlev_dedic_sub,WORD32 *l1_rxqual_dedic,WORD32 *l1_rxqual_dedic_sub); //xzy add for test mode 2002/12/30
extern void layer1_em_get_mode(WORD32 *l1_mode);
static T_MFW_HND LayeroneParaTwo_create(MfwHnd parent_window);
static void LayeroneParaTwo_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier,void *parameter);
static void LayeroneParaTwoCB (MfwEvt e, MfwKbd *k);
void LayeroneParaTwo_destroy(MfwHnd own_window);
//end of xzy add for test special mode 2002/12/30

static T_MFW_HND LayeroneParaThree_create(MfwHnd parent_window);
static void LayeroneParaThree_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier,void *parameter);
static void LayeroneParaThreeCB (MfwEvt e, MfwKbd *k);
void LayeroneParaThree_destroy(MfwHnd own_window);



static T_MFW_HND TestCommand_create(MfwHnd parent_window);

static void TestCommand_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier,
                                 void *parameter);

void TestCommandSetEditor(T_MFW_HND win);
//static int TestCommand_kbd_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard);
static void TestCommandCB( T_MFW_HND win, USHORT Identifier,UBYTE reason);
void TestCommand_destroy(MfwHnd own_window);
static T_MFW_HND SpkMic_create(MfwHnd parent_window);
static void SpkMic_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier,void *parameter);
static void SpkMicCB (MfwEvt e, MfwKbd *k);
void SpkMic_destroy(MfwHnd own_window);

static T_MFW_HND MemFlashRtc_create(MfwHnd parent_window);
static void MemFlashRtc_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier,void *parameter);
static void MemFlashRtcCB (MfwEvt e, MfwKbd *k);
void MemFlashRtc_destroy(MfwHnd own_window);

static T_MFW_HND KeyPressTest_create(MfwHnd parent_window);
static int  KeyPressTest_WinCB (T_MFW_EVENT event, T_MFW_WIN * win);
static void KeyPressTest_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier,void *parameter);
static int KeyPressTest_kbd_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard);
void KeyPressTest_destroy(MfwHnd own_window);
void WriteLcdColor(unsigned short color);
void ShowVersiondialog(T_MFW_HND win);/*2004/05/10, wangyan add*/
//begin xzy add for special test mode 2002/12/30;

/* 2004/05/21 sunsj add */
static T_MFW_HND  circle_factoryTest_create        (T_MFW_HND  parent_win);
static void       circle_factoryTest_exec_cb       (T_MFW_HND  win, USHORT event, SHORT value, int parameter);
static int        circle_factoryTest_win_cb        (T_MFW_EVENT event, T_MFW_WIN * win);
static int        circle_factoryTest_kbd_cb        (T_MFW_EVENT event, T_MFW_KBD * keyboard);
static int        circle_factoryTest_tim_cb        (T_MFW_EVENT event, T_MFW_TIM *tc);

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

 $Function:    	showVersion

 $Description:	Displays the version of software and date
        
 $Returns:		

 $Arguments:	
                
*******************************************************************************/
int ShowVersion(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND     parent_window   = mfwParent( mfw_header() );
    T_MFW_HND           win           = ShowVersion_create(parent_window);
    TRACE_FUNCTION("ShowVerion()");
#ifdef _DAIENABLE_
    DAIsignalEnable();  //enable the DAI
#endif
    if( win NEQ NULL )
    {
        SEND_EVENT (win, SHOWVERSION_INIT, 0, 0);
    }

    return 0;
}

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

 $Function:    	ShowVersion_create

 $Description:	creates the window
        
 $Returns:		

 $Arguments:	
                
*******************************************************************************/
static T_MFW_HND ShowVersion_create(MfwHnd parent_window)
{
    tSpecialMode* data = (tSpecialMode*)ALLOC_MEMORY (sizeof (tSpecialMode));
    T_MFW_WIN  * win;

    if( data EQ NULL )
    {
        return NULL;
    }

    // Create window handler
    data->win = win_create (parent_window, 0, E_WIN_VISIBLE, NULL);
    if( data->win EQ NULL )
    {
        FREE_MEMORY( (void *) data, sizeof( tSpecialMode ) );
        return NULL;
    }
    // connect the dialog data to the MFW-window
    data->mmi_control.dialog = (T_DIALOG_FUNC)ShowVersion_DialogCB;
    data->mmi_control.data   = data;
    win                      = ((T_MFW_HDR *)data->win)->data;
    win->user                = (void *)data;
    data->parent_win         = parent_window;
    data->kbd=kbdCreate(data->win,KEY_ALL,(MfwCb)ShowVerionCB);
    return data->win;
}


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

 $Function:    	showVersion_DialogCB

 $Description:	CallBack Function
        
 $Returns:		

 $Arguments:	
                
*******************************************************************************/
static void ShowVersion_DialogCB(T_MFW_HND win, USHORT e,  SHORT identifier,
                                 void *parameter)
{   
    T_MFW_WIN           *win_data   = ( (T_MFW_HDR *) win )->data;
    tSpecialMode* data = (tSpecialMode*) win_data->user;
    T_DISPLAY_DATA display_info;

    char   ffsstatus[20]="";


    TRACE_FUNCTION("ShowVersion_DialogCB()");

    switch( e )
    {
    case SHOWVERSION_INIT:
        {   
            /*		dspl_ClearAll();
                    strcat(data->buffer, ver);
                    strcat(data->buffer,"\n");
                    strcat(data->buffer, label);
                    strcat(data->buffer,"\n");
                    strcat(data->buffer,date);
                    strcat(data->buffer,"\n");
                    strcat(data->buffer, purpose);
            
                    Sprintf(ffsstatus,"\nffs status: %d\n",ffs_status);	
                    strcat(data->buffer,ffsstatus);
                            dspl_TextOut(0,TOP_POSITION+26,DSPL_TXTATTR_TRANSPARENT,data->buffer);*/

⌨️ 快捷键说明

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