📄 mmiservices.c
字号:
/*******************************************************************************
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: Supplementary services
$File: MmiServices.c
$Revision: 1.0
$Author: Condat(UK)
$Date: 25/10/00
********************************************************************************
Description
This module provides the supplementary services functionality
********************************************************************************
$History: MmiServices.c
25/10/00 Original Condat(UK) BMI version.
28/08/02 wufei modified
$End
*******************************************************************************/
/******************************************************************************
Include Files
*******************************************************************************/
#define BUGS 0
#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 "p_sim.h"
#include "mfw_sys.h"
#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_edt.h"
#include "mfw_lng.h"
#include "mfw_icn.h"
#include "mfw_tim.h"
#include "mfw_mnu.h"
#include "mfw_phb.h"
#include "mfw_sat.h"
#include "mfw_ffs.h" //WUFEI APPEND
#include "ksd.h"
#include "psa.h"
#include "mfw_sms.h"
#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_cm.h"
#include "mfw_ss.h"
#include "dspl.h"
#include "MmiMmi.h"
#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiLists.h"
#include "MmiMain.h"
#include "MmiStart.h"
#include "MmiPins.h"
#include "MmiIdle.h"
#include "MmiMenu.h"
#include "MmiSoftKeys.h"
#include "MmiIcons.h"
#include "MmiCall.h"
#include "MmiServices.h"
#include "MmiEditor.h"
#include "MmiCPHS.h"
#include "Mmiblklangdb.h" //WUFEI APPEND
#include "Mmibooksearchwindow.h"//WUFEI APPEND
#include "mmismsmenu.h"
#include "mmismssend.h"
#include "mmibookmenuwindow.h"
#include "MmiBookUtils.h"
#include "MmiBookShared.h " // MZ 26/02/01
#include "cus_aci.h"
#include "p_sim.h"
#include "pcm.h"
#include "mmiusersymbolinput.h"
#include "mmiutilapi.h"
#include "mmiiconresource.h"/* 2004/06 sunsj modify for icon manage */
extern char DCTbVar[10][40];//WUFEI APPEND
extern T_idle idle_data; // hu binhao 2002-11-29
extern const unsigned char IconBookGrouping15[]; // hu binhao 2002-12-4
uint8 recentcallbook;
static uint8 CallsDeleteAllFlag=0; //hu binhao 2003-1-7
uint8 CallListFlag=0; //hu binhao 2003-1-21 mark it has been have a call,and mark in recent calls menu list
uint8 MCallHintDleteFlag=0; //hu binhao 2003-1-29 the flag will set 1 when browse recent call neme and a missed call happened.
uint8 iniNoRecord=0; //hu binhao 2003-3-18 when falg is 0 ,means after "delete all";when flag is 1, means just after inter memu
extern void bookMenuDestroy( MfwHnd window ); //hu binhao 2003 1-14
extern void msgsGetVoiceAddress(CHAR *Buffer);
#define MAX_USSD_LEN 161
//define masks for call forwarding types hubinhao 2003-2-10 begin
#define GetFourbits 0xf /* 00001111 &*/
#define SetCFNRc 0x8 /* 00001000 |*/ //Call Forwarding on Mobile Subscriber Not Reachable
#define ReSetCFNRc 0xf7 /* 11110111 & */
#define SetCFB 0x4 /* 00000100 | */ //Call Forwarding on Mobile Subscriber Busy
#define ReSetCFB 0xfb /* 11111011 & */
#define SetCFNRy 0x2 /* 00000010 |*/ //Call Forwarding on No Reply
#define ReSetCFNRy 0xfd /* 11111101 & */
#define SetCFU 0x1 /* 00000001 |*/ //Call Forwarding Unconditional
#define ReSetCFU 0xfe /* 11111110 & */
//hubinhao 2003-2-10 begin
//when we look showdetail from rencent missed call menu,It have a new missed call.
//then,go into the deeper nemu to save number ,made a call ,or delet then item ,but,the infor does not correspond to showdetail,becuase the new missed call have change the array.
static char NameShowDetail[24]; //hu binhao 2003-4-29
static uint8 NumShowDetail[24]; //hu binhao 2003-4-29
static UBYTE GetPosition(char Rcalltype,const uint8 * Mnum); //hu binhao 2003-4-29
static void (*show) (void);
static void showWait (T_MFW_HND win);
static void showOk (T_MFW_HND win);
static void showFailed (T_MFW_HND win);
static void showError (T_MFW_HND win, T_MFW_SS_ERROR ss_error);
static void showCLIStatus (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf );
static void showSSNotify (T_MFW_HND win, T_MFW_SS_NOTIFY * ss_notify);
static void showIMEI2 (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf);
static void showUSSDREQ (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf);
static void showUSSDCNF (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf);
static void showUSSDEnter (void);
static void showUSSDFull (T_MFW_HND win);
static void sendUSSD (T_MFW_SS_PARA *ussd_senddata);
static int servicesSendCallDivert(char * divert_number);
int servicesUSSDEdit(struct MfwMnuTag* m, struct MfwMnuItemTag* i);
int servicesUSSDDelete(struct MfwMnuTag* m, struct MfwMnuItemTag* i);
int NoRplyTime(struct MfwMnuTag* m, struct MfwMnuItemTag* i);
static void servicesShowUSSDMenu(void);
static void servicesStoreUSSD(void);
static void ServicesGetOtherNumber(T_MFW_HND win);
static void servicesStoreVoiceMailNumber( void );
static void services_get_voice_number_cb(T_MFW_HND win, USHORT reason);
static void ServicesGetUsedNumber(void); //WUFEI APPEND
static void UsedNumberList_cb(T_MFW_HND * Parent, ListMenuData * ListData); //WUFEI APPEND
static T_MFW_HND buildUsedNumberMenu( MfwHnd parent_window);//WUFEI APPEND
void numbers_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);//WUFEI APPEND
static void usednumber_destroy(MfwHnd own_window);//WUFEI APPEND
static int usednumber_win_cb (MfwEvt e, MfwWin *w);//WUFEI APPEND
static int usednumber_menu_cb (MfwEvt e, MfwMnu *m);//WUFEI APPEND
int usednumber_GetListCount(res_ResourceID_type res);//WUFEI APPEND
static void CUG_Add_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);//WUFEI APPEND
void AddCUGIndex(uint8* index);//WUFEI APPEND
static void ServicesCUGMenu(void); //WUFEI APPEND
void services_info_screen (T_MFW_HND win, USHORT MessageId );//WUFEI APPEND
static T_MFW_HND buildCUGMenu( MfwHnd parent_window);//WUFEI APPEND
void cug_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);//WUFEI APPEND
static void CUGList_cb(T_MFW_HND * Parent, ListMenuData * ListData);//WUFEI APPEND
static void cugWin_destroy(MfwHnd own_window);//WUFEI APPEND
static int cug_win_cb (MfwEvt e, MfwWin *w); //WUFEI APPEND
int cugNameSubMnu(void);//WUFEI APPEND
static void CUGSubList_cb(T_MFW_HND * Parent, ListMenuData * ListData);//WUFEI APPEND
void AddCUGName(uint8* name); //WUFEI APPEND
void PreDefinedCUG(void);//WUFEI APPEND
void ChangeToUcs2(char* srcStr, char * Ucs2Str);//WUFEI APPEND
static void CFNRy_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);//WUFEI APPEND
static void showCFanimation (T_MFW_HND win);//WUFEI APPEND
//---------------hu binhao append 2002-12-2------------------
static T_MFW_HND Rnum_create(MfwHnd parent_window);
void Rnum_destroy(MfwHnd own_window);
static int Rnum_reset_OK_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason);
void Reset_all_calls();
void display_reset_calls(T_MFW_HND parent);
static int Rnum_NoCalls_OK_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason);
//---------------hu binhao append 2002-12-2 end ---------------
//static char recentname[10][21]; //hu binhao append 2002-11-19
void servicesDivertVoice(void); //hu binhao 2003-2-11
static void showDetail (T_MFW_HND win);
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND parent_win;
T_MFW_HND info_win;
T_MFW_HND info_tim;
T_MFW_HND info_kbd;
T_MFW_HND info_kbd_long;
USHORT LeftSoftKey; /* used for Ok */
USHORT RightSoftKey; /* Used for Back */
ULONG Time;
T_MFW_EVENT KeyEvents;
USHORT TextId1; /* Line 1 */
USHORT TextId2; /* Line 2 */
char * TextString4;
USHORT Identifier;
T_VOID_FUNC Callback;
} T_dialog_ext_info;
T_MFW_HND dialog_ext_info_dialog (T_MFW_HND parent_win,
T_dialog_ext_info * display_info);
static MfwHnd lastFocus; /* store old focus */
static MfwHnd win; /* our window */
static MfwHnd kbd; /* our keyboard handler */
static MfwHnd tim; /* exit timer */
static MfwHnd times; /* timeout */
static MmiState nextState; /* next state when finished */
static int servicesState; /* current state of module */
static T_MFW_SS_PARA *ss_cnf; /* union container for all SS confirmations */
/* decode service type - tele/bearer */
static unsigned int serviceGetServiceType( UBYTE ss_telecom_type, UBYTE ss_telecom_service);
static unsigned int serviceGetCategory( T_MFW_SS_CATEGORY cat );
static unsigned int serviceGetType( T_MFW_SS_CODES type );
static unsigned int ServiceGetStatus( UBYTE pStatus);
static unsigned int serviceGetError( T_MFW_SS_ERROR ss_error);
unsigned int mCurrentServiceNum; /* current CF or CB service number */
unsigned int mFeatureCount; /* current CF or CB or CW number of list elements */
#define CB_PSW_LEN 4
typedef enum
{
CFBusy = 0,
CFNoReach,
CFNoReply,
CFAllConditional,
CFUnconditional,
CFAllCalls
} SERVICE_CF_TYPE;
typedef enum
{
CBAllOutgoing = 0,
CBInternational,
CBInternationalHome,
CBAllIncoming,
CBIncomingRoaming
} SERVICE_CB_TYPE;
typedef enum
{
CFVoice = 0,
CFAuxVoice, /*MC, ALS line 2*/
CFFax,
CFData,
CFAll
} SERVICE_CF_SERVICE;
typedef enum
{
CFActivate = 0,
CFDeactivate,
CFCheck
} SERVICE_CF_ACTION;
typedef enum
{
CBActivate = 0,
CBDeactivate,
CBCheck,
CBCheckPassword,
CBNewPassword,
CBConfirmNewPassword
} SERVICE_CB_ACTION;
typedef enum
{
CUGActivate = 0,
CUGDeactive,
CUGCheck,
CUGName,
CUGIndex,
CUGNameMod,
CUGIndexMod
} SERVICE_CUG_ACTION; //WUFEI APPEND
UBYTE cugListPosition=100; //WUFEI APPEND for test
MfwHnd cugwindows; //wufei add 0827
//MfwHnd Listwindows; //wufei add 0827
UBYTE listlen;//wufei add 0905
UBYTE cwflag;//wufei 0930
UBYTE hideflag;//hubinhao 2002-11-28
/* NOTE that these are needed in new architecture */
static SERVICE_CF_TYPE CFType; /* Type of Call Forwarding */
static SERVICE_CF_SERVICE CFService; /* basic service for Call Forwarding */
static SERVICE_CF_ACTION CFAction; /* action for Call Forwarding */
static SERVICE_CB_TYPE CBType; /* Type of Call Barring */
static SERVICE_CB_ACTION CBAction; /* action for Call Barring */
static char CFNumber[MAX_LEN]; /* number to forward calls to */
static MfwMnuItem menuServicesUSSDOptionsItems[] =
{
{0,0,0,(char *)TxtChange,0,(MenuFunc)servicesUSSDEdit,0},
{0,0,0,(char *)TxtDelete,0,(MenuFunc)servicesUSSDDelete,0}
};
static MfwMnuAttr menuServicesUSSDOptions =
{
0,
&menuArea,
MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */
-1, /* use default font */
menuServicesUSSDOptionsItems, /* with these items */
sizeof(menuServicesUSSDOptionsItems)/sizeof(MfwMnuItem) /* number of items */
};
#define MAX_STORED_USSD_LEN 10 /* max len. of stored USSD */
#define MAX_USSD_NAME_LEN 12 /* max len of stored USSD name */
static char mCurrentUSSDNumber[MAX_USSD_LEN]; /* memory for USSD number editing */
static char mCurrentUSSDName[MAX_USSD_NAME_LEN+1]; /* memory for USSD name editing */
static unsigned int mCurrentUSSD; /* number of currently selected USSD in list */
static MfwHnd ussdMenu; /* ussd menu */
static MfwHnd ussdedt; /* ussd editor */
static char USSDedtBuf[MAX_USSD_LEN]; /* ussd edit buffer */
static MfwEdtAttr USSDedtAttr = /* ussd edit attributes: */
{
{6,30,84,20}, /* edit area */
0,0,edtCurNone, /* fg color, font, mode = read only */
0, /* control key array */
USSDedtBuf,MAX_USSD_LEN /* edit buffer, size */
};
/* end of bits for USSD */
#define CF_ACTIVE_STATUS 1
#define CF_INACTIVE_STATUS 2
#define CF_UNKNOWN_STATUS 3
typedef struct
{
USHORT service;
USHORT status;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -