mt2503 BT call 接通,发送DTMF***面显示
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
发送DTMF***面显示。
[SOLUTION]
BT Dialer v2.1及其以前版本,未添加此项功能。
可以参考下面的方法添加这部分功能:
(注:可以显示出输入数字,但不能发起第二个拨号)
(建议不要增加发起第二个拨号的响应,添加之后处理的case会变多,此部分没有进行过测试,会有风险)
1 .mcu\plutoMMI\MMI\BT_UCM\UcmBTRes\ucmbt.res文件中
1) 添加string id <STRING id="STR_ID_UCM_BT_DTMF"/>
2) 添加一个screen id <SCREEN id="SCR_ID_UCM_BT_DTMF_Editor"/>
3) 添加一个menu id
<MENU id="MENU_ID_UCM_BT_INCALL_OPTION" type="OPTION" str="STR_GLOBAL_OPTIONS">
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_HOLD</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_RETRIEVE</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_SWAP</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_DTMF</MENUITEM_ID> // 添加此行
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_MUTE</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_UNMUTE</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_END_SINGLE</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_END_ALL</MENUITEM_ID>
</MENU>
4) 添加menu对应字串
<MENUITEM id="MENU_ID_UCM_BT_INCALL_OPTION_SWAP" str="STR_ID_UCM_BT_SWAP"/>
<MENUITEM id="MENU_ID_UCM_BT_INCALL_OPTION_DTMF" str="STR_ID_UCM_BT_DTMF"/> // 添加此行
<MENUITEM id="MENU_ID_UCM_BT_INCALL_OPTION_MUTE" str="STR_GLOBAL_MUTE"/>
2. mcu\plutommi\MMI\BT_UCM\ref_list_ucmbt.txt 中添加STR_ID_UCM_BT_DTMF对应的内容
3. UcmUiBT.c文件
1) 将void mmi_ucm_send_dtmf_action_bt(void)函数及其实现替换为:
static void mmi_ucm_send_dtmf_action_bt(U16 keyCode)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 asc_digit;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
asc_digit = mmi_ucm_convert_dtmf_to_ascii_bt(&keyCode);
MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_MMI_UCM_BT_SEND_DTMF, asc_digit);
if((asc_digit == (U8)'*')
|| (asc_digit == (U8)'#')
|| ((asc_digit >= (U8)'0') && (asc_digit <= (U8)'9')))
{
srv_bt_dialer_send_generate_dtmf_tone_req(srv_hd,asc_digit);
}
}
2) 添加声明
static void mmi_ucm_enter_dtmf_editor_bt(void);
static void mmi_ucm_pre_entry_dtmf_editor_bt(void);
static void mmi_ucm_send_dtmf_by_key(void);
3) 添加下面函数
static void mmi_ucm_send_dtmf_by_key(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 keyCode = 0, keyType = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
GetkeyInfo(&keyCode, &keyType);
if (MMI_FALSE == wgui_inputs_dialer_is_dialer_keys(keyCode))
{
return;
}
/* For first spec digit keycode like '*' to disable highlight */
mmi_frm_send_incomplete_key_event_to_new_screen(MMI_TRUE);
mmi_ucm_send_dtmf_action_bt(keyCode);
mmi_ucm_pre_entry_dtmf_editor_bt();
wgui_inputs_dialer_display_char(keyCode);
}
static void mmi_ucm_delete_dtmf_editor_screen_bt(void)
{
mmi_frm_scrn_close(GRP_ID_UCM_BT_INCALL, SCR_ID_UCM_BT_DTMF_EDITOR);
}
mmi_ret mmi_ucm_dtmf_editor_key_proc_bt(mmi_event_struct *evt)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_frm_key_evt_struct *key_evt = (mmi_frm_key_evt_struct *)(evt);
U8 key_code = key_evt->key_code;
U8 key_type = key_evt->key_type;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (key_evt->evt_id)
{
case EVT_ID_PRE_KEY:
{
if (wgui_inputs_dialer_is_dialer_keys(key_code) == MMI_TRUE)
{
if (key_type == KEY_EVENT_DOWN)
{
mmi_ucm_send_dtmf_action_bt(key_code);
}
}
break;
}
}
return MMI_RET_OK;
}
static void mmi_ucm_entry_dtmf_editor_bt(mmi_scrn_essential_struct* scr_info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 *guiBuffer = NULL;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!mmi_frm_scrn_enter(
scr_info->group_id,
SCR_ID_UCM_BT_DTMF_EDITOR,
(FuncPtr)NULL,
(FuncPtr)mmi_ucm_entry_dtmf_editor_bt,
MMI_FRM_FULL_SCRN))
{
return;
}
mmi_frm_scrn_set_key_proc(GRP_ID_root, SCR_ID_UCM_BT_DTMF_EDITOR, mmi_ucm_dtmf_editor_key_proc_bt);
guiBuffer = mmi_frm_scrn_get_gui_buf(scr_info->group_id, SCR_ID_UCM_BT_DTMF_EDITOR);
#if defined(__MMI_touch_SCREEN__) && defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__)
SetDialingkeypadCallHandler(NULL);
SetDialingKeypadPhonebookHandler(NULL);
#endif /* __MMI_TOUCH_SCREEN__ */
ShowCategory16Screen(
0,
0,
STR_GLOBAL_BACK,
IMG_GLOBAL_BACK,
(U8*)g_ucm_p_bt->disp_dtmf,
(MMI_UCM_DTMF_LEN + 1),
guiBuffer);
SetCategory16RightSoftkeyFunction(mmi_frm_scrn_close_active_id, KEY_EVENT_UP);
mmi_frm_set_key_handler(mmi_ucm_in_call_endkey_bt, KEY_END, KEY_EVENT_DOWN);
}
static void mmi_ucm_enter_dtmf_editor_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_id dialer_parent_gid = mmi_frm_group_get_active_id();
dialer_parent_gid = mmi_frm_group_get_top_parent_group_id(dialer_parent_gid);
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (GRP_ID_UCM_BT_INCALL == dialer_parent_gid)
{
mmi_frm_scrn_first_enter(
dialer_parent_gid, SCR_ID_UCM_BT_DTMF_EDITOR,
(FuncPtr)mmi_ucm_entry_dtmf_editor_bt,
(void*)NULL);
}
else
{
/* because dtmf editor scrn is triggered by user touch key or select itEMS, curr_active group must call
scrn */
MMI_ASSERT(0);
}
}
static void mmi_ucm_pre_entry_dtmf_editor_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* Avoid re-entry of DTMF editor */
mmi_ucm_delete_dtmf_editor_screen_bt();
mmi_ucm_close_cui_bt(&g_ucm_p_bt->incall_opt_cui_id);
mmi_ucm_enter_dtmf_editor_bt();
}
4) 在mmi_ucm_handle_incall_option_bt中添加显示
void mmi_ucm_handle_incall_option_bt(mmi_id owner_gid)
{
//...
MMI_BOOL is_DTMF = MMI_FALSE; // 添加此变量
//...
if (hold_call_count == 0 && active_call_count > 0) // acitve call only
{
is_DTMF = MMI_TRUE; // 添加此行
//...
}
//...
if (hold_call_count > 0 && active_call_count > 0) // swap
{
is_DTMF = MMI_TRUE; // 添加此行
// ...
}
//...
if (is_DTMF) // 添加此if 及else部分
{
cui_menu_set_item_hidden(owner_gid, MENU_ID_UCM_BT_INCALL_OPTION_DTMF, MMI_FALSE);
}
else
{
cui_menu_set_item_hidden(owner_gid, MENU_ID_UCM_BT_INCALL_OPTION_DTMF, MMI_TRUE);
}
}
5) mmi_ret mmi_ucm_incall_opt_proc_bt(mmi_event_struct *evt)中添加响应
//...
case EVT_ID_CUI_MENU_ITEM_SELECT:
// ...
case MENU_ID_UCM_BT_INCALL_OPTION_SWAP:
{
mmi_ucm_swap_option_bt();
show_pro_scrn = MMI_TRUE;
}
break;
case MENU_ID_UCM_BT_INCALL_OPTION_DTMF: //添加此case.
{
mmi_ucm_pre_entry_dtmf_editor_bt();
}
break;
//...
6) 将mmi_ucm_entry_in_call_bt函数中
//..
SetCenterSoftkeyFunction(mmi_ucm_pre_entry_dtmf_editor_bt, KEY_EVENT_UP);//替换此处callback
//...
SetGroupKeyHandler(
mmi_ucm_send_dtmf_by_key, // 替换callback
(U16*) PresentAllDialerKeys,
TOTAL_DIALER_KEYS,
KEY_EVENT_DOWN);
mmi_frm_set_dial_key_tone_type(MMI_DIALER_KEY_TONE_DTMF);// 添加此处
4. UcminterfaceBT.c文件mmi_ucm_call_launch_bt函数中:
mmi_ucm_call_launch_bt
{
//...
mmi_ucs2_to_asc( (CHAR *)g_ucm_p_bt->num_uri, (CHAR *)g_ucm_p_bt->disp_dtmf);
memset(g_ucm_p_bt->disp_dtmf, 0, sizeof(g_ucm_p_bt->disp_dtmf)); // 添加此行
//...
}
发送DTMF***面显示。
[SOLUTION]
BT Dialer v2.1及其以前版本,未添加此项功能。
可以参考下面的方法添加这部分功能:
(注:可以显示出输入数字,但不能发起第二个拨号)
(建议不要增加发起第二个拨号的响应,添加之后处理的case会变多,此部分没有进行过测试,会有风险)
1 .mcu\plutoMMI\MMI\BT_UCM\UcmBTRes\ucmbt.res文件中
1) 添加string id <STRING id="STR_ID_UCM_BT_DTMF"/>
2) 添加一个screen id <SCREEN id="SCR_ID_UCM_BT_DTMF_Editor"/>
3) 添加一个menu id
<MENU id="MENU_ID_UCM_BT_INCALL_OPTION" type="OPTION" str="STR_GLOBAL_OPTIONS">
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_HOLD</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_RETRIEVE</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_SWAP</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_DTMF</MENUITEM_ID> // 添加此行
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_MUTE</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_UNMUTE</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_END_SINGLE</MENUITEM_ID>
<MENUITEM_ID>MENU_ID_UCM_BT_INCALL_OPTION_END_ALL</MENUITEM_ID>
</MENU>
4) 添加menu对应字串
<MENUITEM id="MENU_ID_UCM_BT_INCALL_OPTION_SWAP" str="STR_ID_UCM_BT_SWAP"/>
<MENUITEM id="MENU_ID_UCM_BT_INCALL_OPTION_DTMF" str="STR_ID_UCM_BT_DTMF"/> // 添加此行
<MENUITEM id="MENU_ID_UCM_BT_INCALL_OPTION_MUTE" str="STR_GLOBAL_MUTE"/>
2. mcu\plutommi\MMI\BT_UCM\ref_list_ucmbt.txt 中添加STR_ID_UCM_BT_DTMF对应的内容
3. UcmUiBT.c文件
1) 将void mmi_ucm_send_dtmf_action_bt(void)函数及其实现替换为:
static void mmi_ucm_send_dtmf_action_bt(U16 keyCode)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 asc_digit;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
asc_digit = mmi_ucm_convert_dtmf_to_ascii_bt(&keyCode);
MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_MMI_UCM_BT_SEND_DTMF, asc_digit);
if((asc_digit == (U8)'*')
|| (asc_digit == (U8)'#')
|| ((asc_digit >= (U8)'0') && (asc_digit <= (U8)'9')))
{
srv_bt_dialer_send_generate_dtmf_tone_req(srv_hd,asc_digit);
}
}
2) 添加声明
static void mmi_ucm_enter_dtmf_editor_bt(void);
static void mmi_ucm_pre_entry_dtmf_editor_bt(void);
static void mmi_ucm_send_dtmf_by_key(void);
3) 添加下面函数
static void mmi_ucm_send_dtmf_by_key(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 keyCode = 0, keyType = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
GetkeyInfo(&keyCode, &keyType);
if (MMI_FALSE == wgui_inputs_dialer_is_dialer_keys(keyCode))
{
return;
}
/* For first spec digit keycode like '*' to disable highlight */
mmi_frm_send_incomplete_key_event_to_new_screen(MMI_TRUE);
mmi_ucm_send_dtmf_action_bt(keyCode);
mmi_ucm_pre_entry_dtmf_editor_bt();
wgui_inputs_dialer_display_char(keyCode);
}
static void mmi_ucm_delete_dtmf_editor_screen_bt(void)
{
mmi_frm_scrn_close(GRP_ID_UCM_BT_INCALL, SCR_ID_UCM_BT_DTMF_EDITOR);
}
mmi_ret mmi_ucm_dtmf_editor_key_proc_bt(mmi_event_struct *evt)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_frm_key_evt_struct *key_evt = (mmi_frm_key_evt_struct *)(evt);
U8 key_code = key_evt->key_code;
U8 key_type = key_evt->key_type;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (key_evt->evt_id)
{
case EVT_ID_PRE_KEY:
{
if (wgui_inputs_dialer_is_dialer_keys(key_code) == MMI_TRUE)
{
if (key_type == KEY_EVENT_DOWN)
{
mmi_ucm_send_dtmf_action_bt(key_code);
}
}
break;
}
}
return MMI_RET_OK;
}
static void mmi_ucm_entry_dtmf_editor_bt(mmi_scrn_essential_struct* scr_info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 *guiBuffer = NULL;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!mmi_frm_scrn_enter(
scr_info->group_id,
SCR_ID_UCM_BT_DTMF_EDITOR,
(FuncPtr)NULL,
(FuncPtr)mmi_ucm_entry_dtmf_editor_bt,
MMI_FRM_FULL_SCRN))
{
return;
}
mmi_frm_scrn_set_key_proc(GRP_ID_root, SCR_ID_UCM_BT_DTMF_EDITOR, mmi_ucm_dtmf_editor_key_proc_bt);
guiBuffer = mmi_frm_scrn_get_gui_buf(scr_info->group_id, SCR_ID_UCM_BT_DTMF_EDITOR);
#if defined(__MMI_touch_SCREEN__) && defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__)
SetDialingkeypadCallHandler(NULL);
SetDialingKeypadPhonebookHandler(NULL);
#endif /* __MMI_TOUCH_SCREEN__ */
ShowCategory16Screen(
0,
0,
STR_GLOBAL_BACK,
IMG_GLOBAL_BACK,
(U8*)g_ucm_p_bt->disp_dtmf,
(MMI_UCM_DTMF_LEN + 1),
guiBuffer);
SetCategory16RightSoftkeyFunction(mmi_frm_scrn_close_active_id, KEY_EVENT_UP);
mmi_frm_set_key_handler(mmi_ucm_in_call_endkey_bt, KEY_END, KEY_EVENT_DOWN);
}
static void mmi_ucm_enter_dtmf_editor_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_id dialer_parent_gid = mmi_frm_group_get_active_id();
dialer_parent_gid = mmi_frm_group_get_top_parent_group_id(dialer_parent_gid);
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (GRP_ID_UCM_BT_INCALL == dialer_parent_gid)
{
mmi_frm_scrn_first_enter(
dialer_parent_gid, SCR_ID_UCM_BT_DTMF_EDITOR,
(FuncPtr)mmi_ucm_entry_dtmf_editor_bt,
(void*)NULL);
}
else
{
/* because dtmf editor scrn is triggered by user touch key or select itEMS, curr_active group must call
scrn */
MMI_ASSERT(0);
}
}
static void mmi_ucm_pre_entry_dtmf_editor_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* Avoid re-entry of DTMF editor */
mmi_ucm_delete_dtmf_editor_screen_bt();
mmi_ucm_close_cui_bt(&g_ucm_p_bt->incall_opt_cui_id);
mmi_ucm_enter_dtmf_editor_bt();
}
4) 在mmi_ucm_handle_incall_option_bt中添加显示
void mmi_ucm_handle_incall_option_bt(mmi_id owner_gid)
{
//...
MMI_BOOL is_DTMF = MMI_FALSE; // 添加此变量
//...
if (hold_call_count == 0 && active_call_count > 0) // acitve call only
{
is_DTMF = MMI_TRUE; // 添加此行
//...
}
//...
if (hold_call_count > 0 && active_call_count > 0) // swap
{
is_DTMF = MMI_TRUE; // 添加此行
// ...
}
//...
if (is_DTMF) // 添加此if 及else部分
{
cui_menu_set_item_hidden(owner_gid, MENU_ID_UCM_BT_INCALL_OPTION_DTMF, MMI_FALSE);
}
else
{
cui_menu_set_item_hidden(owner_gid, MENU_ID_UCM_BT_INCALL_OPTION_DTMF, MMI_TRUE);
}
}
5) mmi_ret mmi_ucm_incall_opt_proc_bt(mmi_event_struct *evt)中添加响应
//...
case EVT_ID_CUI_MENU_ITEM_SELECT:
// ...
case MENU_ID_UCM_BT_INCALL_OPTION_SWAP:
{
mmi_ucm_swap_option_bt();
show_pro_scrn = MMI_TRUE;
}
break;
case MENU_ID_UCM_BT_INCALL_OPTION_DTMF: //添加此case.
{
mmi_ucm_pre_entry_dtmf_editor_bt();
}
break;
//...
6) 将mmi_ucm_entry_in_call_bt函数中
//..
SetCenterSoftkeyFunction(mmi_ucm_pre_entry_dtmf_editor_bt, KEY_EVENT_UP);//替换此处callback
//...
SetGroupKeyHandler(
mmi_ucm_send_dtmf_by_key, // 替换callback
(U16*) PresentAllDialerKeys,
TOTAL_DIALER_KEYS,
KEY_EVENT_DOWN);
mmi_frm_set_dial_key_tone_type(MMI_DIALER_KEY_TONE_DTMF);// 添加此处
4. UcminterfaceBT.c文件mmi_ucm_call_launch_bt函数中:
mmi_ucm_call_launch_bt
{
//...
mmi_ucs2_to_asc( (CHAR *)g_ucm_p_bt->num_uri, (CHAR *)g_ucm_p_bt->disp_dtmf);
memset(g_ucm_p_bt->disp_dtmf, 0, sizeof(g_ucm_p_bt->disp_dtmf)); // 添加此行
//...
}