📄 mmisatinfo.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
$Module: SMS
$File: mmiSatInfo.c
$Revision: 1.0
$Author: Condat(UK)
$Date: 25/10/00
********************************************************************************
Description:
Implementation of MMI SIM Application Toolkit (SAT)
********************************************************************************
$History: mmiSatInfo.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 "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_phb.h"
#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_sms.h"
#include "mfw_mnu.h"
#include "mfw_sat.h"
#include "mfw_tim.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 "MmiMenu.h"
#include "MmiSoftKeys.h"
#include "MmiSounds.h"
#include "MmiCall.h"
#include "gdi.h"
#include "audio.h"
#include "mmiSat_i.h"
#include "mmiEditor.h"
#include "cus_aci.h"
#include "p_sim.h"
#include "pcm.h"
static int sat_play_tone_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc);
static void sat_info_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
/*********************************************************************
*
* SUB WINDOW SAT_PLAY_TONE
*
*********************************************************************/
/*
* Tone Definitions
*/
#define SAT_TONE_DIAL 1
#define SAT_TONE_CALL_SUB_BUSY 2
#define SAT_TONE_CONGESTION 3
#define SAT_TONE_RADIO_PATH_ACK 4
#define SAT_TONE_RADIO_PATH_NOT 5
#define SAT_TONE_ERROR 6
#define SAT_TONE_CALL_WAITING 7
#define SAT_TONE_RINGING_TONE 8
#define SAT_TONE_GENERAL_BEEP 10
#define SAT_TONE_POSITIV_ACK 11
#define SAT_TONE_NEGATIV_ACK 12
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND parent_win;
T_MFW_HND win;
T_MFW_HND tim;
T_MFW_HND info;
T_SAT_CMD *sat_command; /* pointer to sat_command in parent */
T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */
//JVJE #define INTEGRATION_SEPT00
char *TextString;
UBYTE sound_id; /* sound to play */
UBYTE device_id; /* device to play sound on */
BYTE volume; /* volume to play */
} T_sat_play_tone;
typedef enum {
NOT_SUPPORTED,
SINGLE_TONE,
DURATION
} e_TONE_DURATION;
static e_TONE_DURATION sat_set_selected_sound (SatTone tone_tag, T_sat_play_tone * data);
static void sat_play_tone_destroy (T_MFW_HND own_window);
static void sat_play_tone_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command);
static ULONG sat_calculate_time (UBYTE unit, UBYTE value);
/*******************************************************************************
$Function: sat_play_tone_create
$Description: Creation of an instance for the SAT PLAY TONE dialog. Window must
be available after reception of SAT command, only one instance.
$Returns: window handle
$Arguments: own_window - window handler
*******************************************************************************/
T_MFW_HND sat_play_tone_create (T_MFW_HND parent_window)
{
T_sat_play_tone * data = (T_sat_play_tone *)ALLOC_MEMORY (sizeof (T_sat_play_tone));
T_MFW_WIN * win;
data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)sat_win_cb); // c030 rsa
if (data->win EQ NULL)
return NULL;
/*
* Create window handler
*/
data->mmi_control.dialog = (T_DIALOG_FUNC)sat_play_tone_exec;
data->mmi_control.data = data;
data->parent_win = parent_window;
win = ((T_MFW_HDR *)data->win)->data;
win->user = (MfwUserDataPtr)data;
data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */
/*
* return window handle
*/
win_show(data->win);
return data->win;
}
/*******************************************************************************
$Function: sat_play_tone_destroy
$Description: Destroy the sat play tone dialog.
$Returns: none
$Arguments: own_window - window handler
*******************************************************************************/
static void sat_play_tone_destroy (T_MFW_HND own_window)
{
T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data;
T_sat_play_tone * data = (T_sat_play_tone *)win_data->user;
if (data)
{
/*
* Delete WIN Handler
*/
win_delete (data->win);
/*
* Free Memory
*/
sat_destroy_TEXT_ASCIIZ (data->TextString);
FREE_MEMORY ((U8 *)data, sizeof (T_sat_play_tone));
}
}
/*******************************************************************************
$Function: sat_play_tone_exec
$Description: Dialog function for sat_play_tone_exec window.
$Returns: none
$Arguments: win - window handler
event -window event
value - unique id
sat_command - Sat Command.
*******************************************************************************/
static void sat_play_tone_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command)
{
T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
T_sat_play_tone * data = (T_sat_play_tone *)win_data->user;
T_SAT_TXT * txt;
ULONG time;
e_TONE_DURATION res;
T_SAT_RES sat_res;
T_DISPLAY_DATA display_info;
TRACE_FUNCTION ("sat_play_tone_exec()");
dialog_info_init(&display_info);//gdy add
switch (event)
{
case SAT_PLAY_TONE:
data->sat_command = sat_command; /* save a pointer to the parameter for later use in callbacks */
data->info = NULL; /* NULL means no info running */
data->tim = NULL; /* NULL means no timer running */
/*
* --> Select the right Sound ID, if not supported: return
*/
res = sat_set_selected_sound(sat_command->c.tone, data);
switch (res)
{
case NOT_SUPPORTED:
/* sound not supported */
TRACE_EVENT("SAT sound not supported");
sat_res[SAT_ERR_INDEX] = SAT_RES_IMPOSSIBLE;
sat_res[SAT_AI_INDEX] = SatResAiNoCause;
sat_done (sat_command, sat_res, sizeof(T_SAT_RES));
sat_play_tone_destroy (data->win);
return;
case SINGLE_TONE:
/* ignore duration for single tones */
audio_PlaySoundID(data->device_id, data->sound_id , data->volume, AUDIO_PLAY_ONCE);
break;
case DURATION:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -