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

📄 mmiem.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:		MMI
 $File:		    MmiEm.c
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    23/09/02                                                      
                                                                               
********************************************************************************
                                                                              
 Description:

    MMI engineering mode handling
                        
********************************************************************************
 $History: MmiExtras.c

	23/09/02			Original Condat(UK) BMI version.	
	   
 $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 "cus_aci.h"

#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
/* SPR#1428 - SH - New Editor changes */
#ifndef NEW_EDITOR
#include "mfw_edt.h"
#endif
#include "mfw_lng.h"
#include "mfw_tim.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_phb.h"
#include "mfw_cm.h"
#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_sat.h"
#include "mfw_ss.h" /*for convert*/
#include "mfw_phb.h"
#include "ksd.h"
#include "psa.h"
#include "mfw_sms.h"
#include "mfw_cphs.h"
#include "mfw_sat.h"
#include "Mfw_band.h"
#include "Mfw_ffs.h"

#include "dspl.h"

#include "MmiMmi.h"
#include "MmiDialogs.h"
#include "MmiLists.h"
#include "MmiBand.h"
#include "MmiCPHS.h"
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
#include "ATBCommon.h"
#include "ATBDisplay.h"
#include "ATBEditor.h"
#include "AUIEditor.h"
#else
#include "MmiEditor.h"
#endif
#include"mmibookshared.h"


#include "Mfw_em.h"
#include "MmiEm.h"

#include "mmiColours.h"

#define EM_UPDATE_RATE 1000

#define EM_EDITOR_SIZE 300 /*SPR 1757, increased size of editor buffer*/
/*
**************************************Datatypes****************************************
*/
typedef struct _tEmData_
{
    /* administrative data */

    T_MMI_CONTROL     mmi_control;
    T_MFW_HND         win;
    T_MFW_HND         parent_win;

    /* associated handlers */

    T_MFW_HND         kbd; /*keyboard handler*/
    T_MFW_HND         tim;	/*timer handler*/

/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
	T_ED_DATA *			editor;
	T_ED_ATTR			editor_attr;
#else /* NEW_EDITOR */
    T_MFW_HND         edt; /*mfw editor handler*/
    MfwEdtAttr		editor_data;						/*editor config data*/
#endif /* NEW_EDITOR */

    /* internal data */
    char			edtBuffer[EM_EDITOR_SIZE*2];/*SPR 1757*//*editor contentbuffer*/
	MfwEmDataType CurrentWindow;						/*type of data being displayed*/

} tEmData;


/*
**************************************Prototypes****************************************
*/
int Mmi_em_event_cb(T_MFW_EVENT event, T_MFW_HND para); //Handles events from the MFW
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.
void Mmi_em_destroy(T_MFW_HND own_window); //Deallocate window data and delete window.
int Mmi_em_kbd_cb(T_MFW_EVENT event,T_MFW_KBD *  kc ); //Handles key presses in the display window
int Mmi_em_win_cb(T_MFW_EVENT event,T_MFW_WIN * win );// Handles the information display.
void Mmi_em_tim_cb(T_MFW_EVENT event,T_MFW_TIM * t); //Handles the timer events.  




/*
**************************************Public functions****************************************
*/


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

 $Function:    	mmi_em_init()

 $Description:	initialise Engineering Mode module
 
 $Returns:		None

 $Arguments:	None
 
*******************************************************************************/
void mmi_em_init()
{
	Mfw_em_init();

}

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

 $Function:    	mmi_em_enit()

 $Description:	exit Engineering Mode module
 
 $Returns:		None

 $Arguments:	None
 
*******************************************************************************/
void mmi_em_exit()
{
	Mfw_em_exit();
}

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

 $Function:    	mmi_em_start_eng_mode_menus()

 $Description:	starts the emergency mode menu
 
 $Returns:		None

 $Arguments:	parent window
 
*******************************************************************************/
void mmi_em_start_eng_mode_menus(T_MFW_HND parent)
{	
	TRACE_EVENT("mmi_em_start_eng_mode_menus");
	bookMenuStart(parent, (MfwMnuAttr*)EngModeAttributes(), PhbEmMode);
}

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

 $Function:    	Mmi_em_display_mobile_info_data()

 $Description:	Called from menu; begins process to display Mobile Information
 
 $Returns:		status integer

 $Arguments:	menu and item (not used)
 
*******************************************************************************/


int Mmi_em_display_mobile_info_data(MfwMnu* m, MfwMnuItem* i)
{	T_MFW_HND		parent	     = mfwParent( mfw_header());
	TRACE_EVENT_P1("Mmi_em_display_mobile_info(), parent win %d", parent);
	TRACE_EVENT_P1("Memory left:%d", mfwCheckMemoryLeft());
	Mmi_em_create(parent, EM_MOBILE_INFO);
	
	return MFW_EVENT_CONSUMED;
}
/*******************************************************************************

 $Function:    	Mmi_em_display_serving_cell_params()

 $Description:	Called from menu; begins process to display Serving Cell parameters
 
 $Returns:		status integer

 $Arguments:	menu and item (not used)
 
*******************************************************************************/

int Mmi_em_display_serving_cell_params(MfwMnu* m, MfwMnuItem* i)
{	T_MFW_HND		parent	     = mfwParent( mfw_header());
	TRACE_EVENT_P1("MMiEm, Memory left:%d", mfwCheckMemoryLeft());
	Mmi_em_create(parent, EM_SERVING_CELL_PARAMS);
	
	return MFW_EVENT_CONSUMED;
}
/*******************************************************************************

 $Function:    	Mmi_em_display_neighbour_cell_params()

 $Description:	Called from menu; begins process to display Neighbouring Cell parameters
 
 $Returns:		status integer

 $Arguments:	menu and item (not used)
 
*******************************************************************************/ 
int Mmi_em_display_neighbour_cell_params(MfwMnu* m, MfwMnuItem* i)
{	T_MFW_HND		parent	     = mfwParent( mfw_header());
	TRACE_EVENT_P1("MMiEm, Memory left:%d", mfwCheckMemoryLeft());
	Mmi_em_create(parent, EM_NEIGHBOURING_CELL_PARAMS);
	
	return MFW_EVENT_CONSUMED;
}

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

 $Function:    	Mmi_em_display_location_params()

 $Description:	Called from menu; begins process to display Locationparameters
 
 $Returns:		status integer

 $Arguments:	menu and item (not used)
 
*******************************************************************************/ 
int Mmi_em_display_location_params(MfwMnu* m, MfwMnuItem*i )
{	T_MFW_HND		parent	     = mfwParent( mfw_header());

	Mmi_em_create(parent, EM_LOCATION_PARAMS);
	
	return MFW_EVENT_CONSUMED;
}

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

 $Function:    	Mmi_em_display_ciph_hop_DTX_params()

 $Description:	Called from menu; begins process to display Ciphering, hopping and
 discontinuous transmission parameters
 
 $Returns:		status integer

 $Arguments:	menu and item (not used)
 
*******************************************************************************/
int Mmi_em_display_ciph_hop_DTX_params(MfwMnu* m, MfwMnuItem* i)
{	T_MFW_HND		parent	     = mfwParent( mfw_header());
	TRACE_EVENT_P1("MMiEm, Memory left:%d", mfwCheckMemoryLeft());
	Mmi_em_create(parent, EM_CIPH_HOP_DTX_PARAMS);
	
	return MFW_EVENT_CONSUMED;
}

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

 $Function:    	Mmi_em_display_GPRS_params()

 $Description:	Called from menu; begins process to display GPRS specific parameters
 
 $Returns:		status integer

 $Arguments:	menu and item (not used)
 
*******************************************************************************/

int Mmi_em_display_GPRS_params(MfwMnu* m, MfwMnuItem* i)
{	T_MFW_HND		parent	     = mfwParent( mfw_header());
	TRACE_EVENT_P1("MMiEm, Memory left:%d", mfwCheckMemoryLeft());
	Mmi_em_create(parent, EM_GPRS_PARAMS);
	
	return MFW_EVENT_CONSUMED;
}

/*
************************************Internal Functions**************************************
*/

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

 $Function:    	Mmi_em_create()

 $Description:	Creates emergency mode display window
 
 $Returns:		window handle

 $Arguments:	parent window, kind of data to be displayed
 
*******************************************************************************/

T_MFW_HND Mmi_em_create(T_MFW_HND parent_window, MfwEmDataType data_type)
{
	tEmData     * data = (tEmData *)ALLOC_MEMORY (sizeof (tEmData ));
	T_MFW_WIN  * win;

	if (data EQ NULL)
	{
		return NULL;
	}

	// Create window handler
	data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (MfwCb)Mmi_em_win_cb);
	if (data->win EQ NULL)
	{
		
		return NULL;
	}
	TRACE_EVENT_P1("Mmi_em_create(), data->win %d", data->win);
	//no window event handler needed
	data->mmi_control.dialog = (T_DIALOG_FUNC)NULL;
	data->mmi_control.data   = data;

	data->kbd      = kbd_create (data->win, KEY_ALL,         (T_MFW_CB)Mmi_em_kbd_cb);

	/*Mobile Info is the only data screen which doesn't need to be updated every second*/
	if (data_type != EM_MOBILE_INFO)
   	{	
   		data->tim		= tim_create(data->win, EM_UPDATE_RATE, (T_MFW_CB)Mmi_em_tim_cb);

⌨️ 快捷键说明

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