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

📄 mmisimtoolkit.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:   MMI
 $File:       MmiSimToolkit.c
 $Revision:   1.0

 $Author:   Condat(UK)
 $Date:       22/02/01

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

 Description:



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

 $History: MmiSimToolkit.c

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

 $End

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

#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 "pconst.cdg"
#include "mconst.cdg"
#include "message.h"
#include "ccdapi.h"
#include "prim.h"
#include "cus_aci.h"
#include "cnf_aci.h"
#include "mon_aci.h"

#include "tok.h"

#include "pcm.h"

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

#include "dspl.h"


#include "p_mmi.h"
#include "aci_cmh.h"
#include "mfw_mme.h"

#include "MmiMmi.h"

#include "MmiIcons.h"
#include "MmiPins.h"
#include "MmiMain.h"
#include "MmiDialogs.h"
#include "MmiIdle.h"
#include "MmiStart.h"
#include "MmiCall.h"
#include "MmiSimToolkit.h"
#include "gdi.h"
#include "Audio.h"
#include "MmiLists.h"
#include "MmiSounds.h"
#include "MmiResources.h"
#include "MmiTimeDate.h"
#include "mmiSat_i.h"
#include "MmiEditor.h"
#include "MmiMenu.h" // SH - 20/11/01 - included to provide symbol SimMenuFunc
#include "cus_aci.h"
#include "p_sim.h"
#include "pcm.h"
#include "mmiusersymbolinput.h"  //zhaowm 2003.1.3

#ifndef _M188_
#include "mmiSatclassE.h"
#endif


#ifdef MMI_HOMEZONE_ENABLED
#include "mmihomezone.h"
#endif

#ifdef MMI_WAP_ENABLED
#include "AuiWapExt.h"
#endif

#if defined(WAP)
#define MMI_TEST_SAT_LAUNCH_BROWSER
#endif

#ifdef MMI_TEST_SAT_LAUNCH_BROWSER
void mmiOpenDummyBrowser(T_MFW_HND win,char* information);
#define INFORMATION_SIZE 100
char information[INFORMATION_SIZE];
#endif
/*
 * Local definitions
 */
typedef struct
{
    T_MMI_CONTROL mmi_control;
    T_MFW_HND     win;
    T_MFW_HND     sat_handle;
    T_SAT_CMD   * sat_command; /* mfw storage of actual command */
    T_SAT_CMD   * sat_setup_menu_command; /* dynamic storage of setup menu */
    T_MFW_HND     sat_setup_menu_win; /* c030 rsa window associated with the setup menu command */
    T_MFW_HND     info_win;           /* window used for simple info screens */
    T_MFW_HND     sat_call_setup_win; /* window associated with the call setup command */
    T_SAT_call_setup_parameter * call_setup_parameter; /* parameter psace of call setup to be passed to call() */
    T_SAT_EVENTS  active_sat_session; /* event which caused the currently active session */
    T_EDITOR_DATA editor_data;
    UBYTE satCallWithRedial; /*zy 2003-04-16 checkin SPR#1779 - DS - Flag for SAT call 'with redial' */
    UBYTE     sat_available_on_SIM;
} T_sim_toolkit;

static T_sim_toolkit * g_sim_toolkit_data;

char *			sat_mainmenu_label;
//UBYTE 			header_len;    

/* Robert.Chen added, 2004-03-04, imported from TCS2112 */
BOOL sat_call_active = FALSE;   // Marcus: Issue 1812: 13/03/2003
/* add end */
/* PROTOTYPES */
static T_MFW_HND sim_toolkit_create     (T_MFW_HND parent_window);
static void      sim_toolkit_destroy    (T_MFW_HND own_window);
/* zy 2003-04-16 checkin 
 * Marcus: Issue 1057: 21/01/2003: Removed "static" from the following two
 * function prototypes for their use in MmiCall.c
 */
T_MFW_HND sat_get_setup_menu_win (void);
T_MFW_HND sat_get_call_setup_win (void);
/*end of zy 2003-04-16 checkin*/
static void      sat_setup_menu_proc    (T_SAT_CMD * sat_command);
static void      sat_info_cb            (T_MFW_HND win, UBYTE identifier, UBYTE reason);

static T_SAT_CMD *cmd1;  //zhaowm,2002.0620
extern UBYTE  call_SATCall; //zy 2003-04-16 check in Marcus: Issue 1057: 21/01/2003

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

 $Function:     sim_toolkit_check

 $Description:   If there is no support for SAT on SIM card
         the item SIM TOOLKIT will not appear in the menulist

 $Returns:

 $Arguments:

*******************************************************************************/
USHORT sim_toolkit_check (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi)
{

  T_sim_toolkit * data = g_sim_toolkit_data;

  TRACE_FUNCTION("sim_toolkit_check")

  if (data->sat_available_on_SIM EQ TRUE)
  {
    //show the SAT item in the menulist
    return 0;
  }
  else
  {
    return 1;
  }

}




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

 $Function:  simToolkitInit

 $Description:   This is the start-up time initialisation routine.
         For compatibility reasons the functions is still there.


 $Returns:    none.

 $Arguments:

*******************************************************************************/
void simToolkitInit (T_MFW_HND parent_window)
{
  TRACE_FUNCTION("simToolkitInit");

    g_sim_toolkit_data = (T_sim_toolkit *)ALLOC_MEMORY (sizeof (T_sim_toolkit));

    winAutoFocus (TRUE);
    sat_set_setup_menu_win(NULL);
    sat_set_call_setup_win(NULL);
    sim_toolkit_create (parent_window);
}
/*******************************************************************************

 $Function:  simToolkitExit

 $Description:  This is the shutdown time clean-up routine.

 $Returns:    none.

 $Arguments:

*******************************************************************************/
void simToolkitExit(void)
{
  TRACE_FUNCTION("simTookitExit");
    sim_toolkit_destroy (g_sim_toolkit_data->win);
    FREE_MEMORY ((U8 *)g_sim_toolkit_data, sizeof (T_sim_toolkit));
}


/********************************************************************
 *
 * SIM Toolkit Dialog
 *
 * Window - Structure
 *
 * sim_toolkit   ---->   sat_play_tone
 *               ---->   sat_display_text
 *               ---->   sat_get_key
 *               ---->   sat_setup_call
 *               ---->   sat_get_string
 *               ---->   sat_setup_menu
 *               ---->   sat_select_item
 *               ---->   sat_send_sms
 *               ---->   sat_send_ss
 *
 ********************************************************************/
/* Robert.Chen changed, 2004-02-28, imported from TI RITA release TCS2112 */
#if 0
static const UBYTE sat_terminal_profile [9] =
{
#ifdef SAT_TP1_PRF_DNL
    (SAT_TP1_PRF_DNL | SAT_TP1_MENU_SEL),

    (SAT_TP2_CMD_RES|SAT_TP2_CC|SAT_TP2_ALPHA_ID|
     SAT_TP2_UCS2_ENTRY|SAT_TP2_UCS2_DSPL),

    (SAT_TP3_DSPL_TXT|SAT_TP3_GET_INKEY|SAT_TP3_GET_INPUT|
     SAT_TP3_PLAY_TONE),

    (SAT_TP4_SEL_ITEM|SAT_TP4_SEND_SMS|SAT_TP4_SEND_SS|
     SAT_TP4_SEND_USSD|SAT_TP4_SETUP_CALL|SAT_TP4_SETUP_MENU),

    (SAT_TP5_EVENT_LIST | SAT_TP5_USER_ACT | SAT_TP5_SCR_AVAIL),
    0x0, 0x0,
    SAT_TP8_BIN_GET_INKEY | SAT_TP8_IDLE_TXT | SAT_TP8_AI2_SETUP_CALL,
#if defined(WAP)
    SAT_TP9_SUST_DSPL_TXT|SAT_TP9_LAUNCH_BROWSER
#else
    SAT_TP9_SUST_DSPL_TXT
#endif 

#else
    0x09, 0x73, 0x17, 0x37,0x00 // c032 rsa
#endif
};
#endif

static const UBYTE sat_terminal_profile [13] =
{
#ifdef SAT_TP1_PRF_DNL
    (SAT_TP1_PRF_DNL | SAT_TP1_MENU_SEL),

    (SAT_TP2_CMD_RES|SAT_TP2_CC|SAT_TP2_ALPHA_ID|
     SAT_TP2_UCS2_ENTRY|SAT_TP2_UCS2_DSPL),

    (SAT_TP3_DSPL_TXT|SAT_TP3_GET_INKEY|SAT_TP3_GET_INPUT|
     SAT_TP3_PLAY_TONE),

    (SAT_TP4_SEL_ITEM|SAT_TP4_SEND_SMS|SAT_TP4_SEND_SS|
     SAT_TP4_SEND_USSD|SAT_TP4_SETUP_CALL|SAT_TP4_SETUP_MENU),

    (SAT_TP5_EVENT_LIST | SAT_TP5_USER_ACT | SAT_TP5_SCR_AVAIL),
    0x0, 0x0,
    (SAT_TP8_BIN_GET_INKEY | SAT_TP8_IDLE_TXT | SAT_TP8_AI2_SETUP_CALL),
    
#if defined(WAP)
    (SAT_TP9_SUST_DSPL_TXT|SAT_TP9_LAUNCH_BROWSER),
#else
    SAT_TP9_SUST_DSPL_TXT,
#endif
    0x0, 0x0,
    (SAT_TP12_OPEN_CHANNEL | SAT_TP12_CLOSE_CHANNEL | SAT_TP12_RECEIVE_DATA |
    SAT_TP12_SEND_DATA),
    
    (SAT_TP13_CSD_SUPP_BY_ME | SAT_TP13_GPRS_SUPP_BY_ME)
#else
    0x09, 0x73, 0x17, 0x37,0x00 // c032 rsa
#endif
};
/* change end */

static void sim_toolkit_destroy (T_MFW_HND own_window);
static void sim_toolkit_exec    (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command);
static int  sim_toolkit_sat_cb  (T_MFW_EVENT event, T_MFW_SAT * sat_bits);
/*******************************************************************************

 $Function:  sim_toolkit_create

 $Description:   Creation of an instance for the SIM Toolkit dialog.
             Type of dialog : SINGLE_STATIC
              Top Window must be available at any time, only one instance.


 $Returns:    none.

 $Arguments:

*******************************************************************************/
static T_MFW_HND sim_toolkit_create (T_MFW_HND parent_window)
{
    T_sim_toolkit * data = g_sim_toolkit_data;
    T_MFW_WIN     * win;

    TRACE_FUNCTION("sim_toolkit_create");

    data->win = win_create (parent_window, 0, 0, NULL); // c013 rsa

    if (data->win EQ NULL)
        return NULL;

    /*
     * Create window handler
     */
    data->mmi_control.dialog    = (T_DIALOG_FUNC)sim_toolkit_exec;
    data->mmi_control.data      = data;
    win                         = ((T_MFW_HDR *)data->win)->data;
    win->user                   = (MfwUserDataPtr)data;

    data->sat_command = (T_SAT_CMD *)ALLOC_MEMORY (sizeof (T_SAT_CMD)); // c022 rsa

    /*
     * Create any other handler
     */
    data->sat_handle = sat_create (
        data->win,                    // parent window
        /* possible SAT events */
        MfwSatSessionEnd |     /* end of session           */

⌨️ 快捷键说明

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