#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__
-#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__
+#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__
-#include "mmi_video_call_fzd.h"
+#include "mmi_video_call_tongxin.h"
#include <stdio.h>
#include <stdlib.h>
static MMI_VIDEO_CALL_PARAMS_T s_video_call_params = {0};
lv_color_t g_cbuf[canvas_width * canvas_heigh + 8] __attribute__((aligned(8)));
-static char s_video_call_ticket[MMI_WATCH_VC_TICKET_LEN] = {0};
-static char s_video_call_tokens[MMI_WATCH_VC_TOKENS_LEN] = {0};
+static char s_vc_ticket[MMI_WATCH_VC_TICKET_LEN] = {0};
+static char s_vc_appkey[MMI_WATCH_VC_APPKEY_LEN] = {0};
+static char s_vc_secret[MMI_WATCH_VC_SECRET_LEN] = {0};
+static char s_vc_tokens[MMI_WATCH_VC_TOKENS_LEN] = {0};
+static char s_vc_uid[MMI_WATCH_VC_UID_LEN] = {0};
/**********************
{
return;
}
- mmi_vc_activity_destroy_req_fzd();
+ mmi_vc_activity_destroy_req_tongxin();
Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_2);
}
}
static void voip_phone_left_slide_callback(lv_obj_t * obj)
{
printf("%s %d\n", __FUNCTION__, __LINE__);
- if((MMI_VIDEO_CALL_STATE_CALLING == s_video_call_params.state)
- && (MODEM_VIDEO_CALL_TYPE_VIDEO == s_video_call_params.call_type)) {
- voip_local_remote_switch_action(NULL, LV_EVENT_CLICKED);
- }
+ if((MMI_VIDEO_CALL_STATE_CALLING == s_video_call_params.state)
+ && (MODEM_VIDEO_CALL_TYPE_VIDEO == s_video_call_params.call_type))
+ {
+ voip_local_remote_switch_action(NULL, LV_EVENT_CLICKED);
+ }
}
static void voip_phone_right_slide_callback(lv_obj_t * obj)
printf("%s\n", __FUNCTION__);
if(lv_watch_get_activity_obj(ACT_ID_SLIDER)) {
if(MMI_VIDEO_CALL_STATE_NONE != s_video_call_params.state) {
- uint8_t volume = mmi_vc_get_call_volume_fzd();
+ uint8_t volume = mmi_vc_get_call_volume_tongxin();
printf("set nv, speaker volume is %d.\n", volume);
UI_NV_Write_Req(NV_SECTION_UI_PHONE, 0, 1, &volume);
}
}
+bool mmi_video_call_is_in_call(void)
+{
+ if(MMI_VIDEO_CALL_STATE_NONE == s_video_call_params.state || MMI_VIDEO_CALL_STATE_INVALID == s_video_call_params.state)
+ return false;
+
+ return true;
+}
+
// state: 0-reject; 1-hang up
void mmi_vc_call_operate_send_to_server(uint_8 flag)
{
if(0 == flag)
- mmi_protocol_fzd_action_VC_CALL_RESPONSE(s_video_call_params.number, s_video_call_ticket, s_video_call_params.call_type);
+ mmi_protocol_fzd_action_VC_CALL_RESPONSE(s_video_call_params.number, s_vc_ticket, s_video_call_params.call_type);
else if(1 == flag)
mmi_protocol_fzd_action_VC_CALL_RESPONSE(NULL, NULL, 0);
}
mmi_vc_call_action_connecting();
- //mmi_video_call_jrtc_config_init_01(s_video_call_tokens);
- int8_t ret = mmi_video_call_answer_req(s_video_call_ticket);
+ //mmi_video_call_jrtc_config_init_01(s_vc_tokens);
+ int8_t ret = mmi_video_call_answer_req(s_vc_ticket);
if(ret < 0)
{
mmi_vc_ring_off_no_carrier(0);
mmi_vc_ui_create(NULL);
}
-void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type, char * t_ticket, char * t_tokens)
+void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type,
+ char * t_ticket, char * t_appkey, char * t_secret,
+ char * t_tokens, char * t_uid)
{
if(true == mmi_active_screen_is_prohibit_interrupted()
|| true == is_rat_gsm()
}
}
- memset(s_video_call_ticket, 0x0, MMI_WATCH_VC_TICKET_LEN);
- strncpy(s_video_call_ticket, t_ticket, MMI_WATCH_VC_TICKET_LEN - 1);
+ memset(s_vc_ticket, 0x0, MMI_WATCH_VC_TICKET_LEN);
+ strncpy(s_vc_ticket, t_ticket, MMI_WATCH_VC_TICKET_LEN - 1);
- memset(s_video_call_tokens, 0x0, MMI_WATCH_VC_TOKENS_LEN);
- strncpy(s_video_call_tokens, t_tokens, MMI_WATCH_VC_TOKENS_LEN - 1);
+ memset(s_vc_appkey, 0x0, MMI_WATCH_VC_APPKEY_LEN);
+ strncpy(s_vc_appkey, t_appkey, MMI_WATCH_VC_APPKEY_LEN - 1);
+
+ memset(s_vc_secret, 0x0, MMI_WATCH_VC_SECRET_LEN);
+ strncpy(s_vc_secret, t_secret, MMI_WATCH_VC_SECRET_LEN - 1);
+
+ memset(s_vc_tokens, 0x0, MMI_WATCH_VC_TOKENS_LEN);
+ strncpy(s_vc_tokens, t_tokens, MMI_WATCH_VC_TOKENS_LEN - 1);
+
+ memset(s_vc_uid, 0x0, MMI_WATCH_VC_UID_LEN);
+ strncpy(s_vc_uid, t_uid, MMI_WATCH_VC_UID_LEN - 1);
HAL_SPEAKER_GAIN volume = query_current_volume();
if(!Hal_Set_BT_Audio_Path(volume))
//
- mmi_video_call_jrtc_config_init_01(s_video_call_tokens);
-
+ mmi_video_call_jrtc_config_init_01(s_vc_appkey, s_vc_secret, s_vc_tokens, s_vc_uid);
mmi_watch_wake_up();
mmi_video_call_hangup_req(TRUE);
}
-void mmi_vc_call_action_dialing_ext(char * t_tokens, char * t_ticket)
+void mmi_vc_call_action_dialing_ext(char * t_ticket, char * t_appkey, char * t_secret, char * t_tokens, char * t_uid)
{
- memset(s_video_call_ticket, 0x0, MMI_WATCH_VC_TICKET_LEN);
- strncpy(s_video_call_ticket, t_ticket, MMI_WATCH_VC_TICKET_LEN - 1);
+ memset(s_vc_ticket, 0x0, MMI_WATCH_VC_TICKET_LEN);
+ strncpy(s_vc_ticket, t_ticket, MMI_WATCH_VC_TICKET_LEN - 1);
+
+ memset(s_vc_appkey, 0x0, MMI_WATCH_VC_APPKEY_LEN);
+ strncpy(s_vc_appkey, t_appkey, MMI_WATCH_VC_APPKEY_LEN - 1);
+
+ memset(s_vc_secret, 0x0, MMI_WATCH_VC_SECRET_LEN);
+ strncpy(s_vc_secret, t_secret, MMI_WATCH_VC_SECRET_LEN - 1);
- memset(s_video_call_tokens, 0x0, MMI_WATCH_VC_TOKENS_LEN);
- strncpy(s_video_call_tokens, t_tokens, MMI_WATCH_VC_TOKENS_LEN - 1);
+ memset(s_vc_tokens, 0x0, MMI_WATCH_VC_TOKENS_LEN);
+ strncpy(s_vc_tokens, t_tokens, MMI_WATCH_VC_TOKENS_LEN - 1);
+
+ memset(s_vc_uid, 0x0, MMI_WATCH_VC_UID_LEN);
+ strncpy(s_vc_uid, t_uid, MMI_WATCH_VC_UID_LEN - 1);
- mmi_video_call_jrtc_config_init_01(s_video_call_tokens);
- int8_t ret = mmi_video_call_dial_req(s_video_call_params.call_type, s_video_call_params.number, s_video_call_ticket);
+ mmi_video_call_jrtc_config_init_01(s_vc_appkey, s_vc_secret, s_vc_tokens, s_vc_uid);
+ int8_t ret = mmi_video_call_dial_req(s_video_call_params.call_type, s_video_call_params.number, s_vc_ticket);
if(0 > ret)
{
mmi_vc_call_dialing_timeout_cb(NULL);
//interface
-uint8_t mmi_vc_get_call_volume_fzd(void)
+uint8_t mmi_vc_get_call_volume_tongxin(void)
{
return(s_video_call_params.speaker_volume);
}
-bool mmi_vc_watch_suspend_check_fzd(void)
+bool mmi_vc_watch_suspend_check_tongxin(void)
{
if((s_video_call_params.call_type == MODEM_VIDEO_CALL_TYPE_VIDEO)
|| (MMI_VIDEO_CALL_STATE_INCOMING == s_video_call_params.state)
return true;
}
-bool mmi_vc_connect_check_req_fzd(void)
+bool mmi_vc_connect_check_req_tongxin(void)
{
if(mmi_vc_call_get_activity_obj())
{
return false;
}
-void mmi_vc_activity_destroy_req_fzd(void)
+void mmi_vc_activity_destroy_req_tongxin(void)
{
VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
{MMI_FZD_SERVER_VC_CALL_REQUEST, "jup_hoo_request"},
{MMI_FZD_WATCH_VC_CALL_RESPONSE, "jup_hoo_response"},
#endif
- #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__
+ #if defined(__MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__) || defined(__MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__)
{MMI_FZD_WATCH_GET_VC_CONFIG, "JPREG"},
{MMI_FZD_WATCH_GET_VC_CONTACT, "MEMBERS"},
{MMI_FZD_WATCH_VC_CALL_REQUEST, "AGTALK"},
{MMI_FZD_WATCH_VC_CALL_RESPONSE, "RCALLING"},
#endif
#endif
+ #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+ {MMI_FZD_SERVER_SET_NOT_DISTURB, "SILENCETIME2"},
+ #endif
+ {MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH, "KEYBRD"},
+ {MMI_FZD_SERVER_SET_WHITE_LIST_SWITCH, "WLKEY"},
/*******add before this line*******/
break;
#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__
- #if defined(__MMI_ZHSX_SUPPORT_VIDEO_CALL_WULIAN__) || defined(__MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__)
+ #if defined(__MMI_ZHSX_SUPPORT_VIDEO_CALL_WULIAN__) || defined(__MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__) || defined(__MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__)
case MMI_FZD_WATCH_GET_VC_CONFIG:
mmi_protocol_fzd_parse_WATCH_GET_VC_CONFIG(next_buff, next_buff_len);
break;
#endif
#endif
+ #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+ case MMI_FZD_SERVER_SET_NOT_DISTURB:
+ mmi_protocol_fzd_parse_SERVER_SET_NOT_DISTURB(next_buff, next_buff_len);
+ break;
+ #endif
+
+ case MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH:
+ mmi_protocol_fzd_parse_SERVER_SET_DIAL_PAD_SWITCH(next_buff, next_buff_len);
+ break;
+
+ case MMI_FZD_SERVER_SET_WHITE_LIST_SWITCH:
+ mmi_protocol_fzd_parse_SERVER_SET_WHITE_LIST_SWITCH(next_buff, next_buff_len);
+ break;
+
+
default:
break;
bool result = false;
MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_ACTION_TALK_MESSAGE;
-/*
if(NULL == next_buff || 0 == next_buff_len)
{
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
result = mmi_protocol_fzd_send_without_data(action);
- unsigned char t_buff[WECHAT_MSG_TEXT_LEN_MAX + 1] = {0};
- uint8_t t_len = 0;
+ unsigned char t_buff[WECHAT_MSG_TEXT_LEN_MAX * 4 + 1] = {0};
+ uint8_t t_len_1 = 0, t_len_2 = 0;
- mmi_unicode_hex_str_to_utf8_str(next_buff, next_buff_len, t_buff, &t_len);
- result = wechat_msg_receive_from_server(t_buff, t_len, WECHAT_MSG_TYPE_TEXT);
-*/
+ t_len_1 = (WECHAT_MSG_TEXT_LEN_MAX * 4 < next_buff_len) ? (WECHAT_MSG_TEXT_LEN_MAX * 4) : next_buff_len;
+ mmi_unicode_hex_str_to_utf8_str(next_buff, next_buff_len, t_buff, &t_len_2);
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%d,%d\n", __FUNCTION__, __LINE__, next_buff_len, t_len_1, t_len_2);
+ result = wechat_msg_receive_from_server(t_buff, t_len_2, WECHAT_MSG_TYPE_TEXT);
return result;
}
return result;
}
#endif
+
+#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__
+bool mmi_protocol_fzd_action_get_vc_contact(void)
+{
+ return mmi_protocol_fzd_send_without_data(MMI_FZD_WATCH_GET_VC_CONTACT);
+}
+
+bool mmi_protocol_fzd_action_get_vc_config(void)
+{
+ //get contact
+ return mmi_protocol_fzd_action_get_vc_contact();
+}
+
+bool mmi_protocol_fzd_parse_WATCH_GET_VC_CONFIG(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ return false;
+}
+
+bool mmi_protocol_fzd_parse_WATCH_GET_VC_CONTACT(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ bool result = false;
+ //MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_WATCH_GET_VC_CONTACT;
+
+ if(NULL == next_buff || 0 == next_buff_len)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
+ result = true;
+ //mmi_protocol_fzd_send_without_data(action);
+
+ nv_watch_vc_contact_t t_vc_contact = {0};
+ char * temp_ptr = NULL;
+ uint8_t i = 0;
+ uint8_t t_len_1 = 0, t_len_2 = 0;
+
+ while (NULL != next_buff)
+ {
+ temp_ptr = km_strtok_r(NULL, ",", &next_buff);
+ if (NULL != temp_ptr)
+ {
+ t_len_1 = FZD_MIN(strlen(temp_ptr), (NV_WATCH_VC_CONTACT_NUMBER_LEN - 1));
+ strncpy(t_vc_contact.number[i], temp_ptr, t_len_1);
+ }
+ else
+ {
+ break;
+ }
+
+ temp_ptr = km_strtok_r(NULL, ",", &next_buff);
+ if (NULL != temp_ptr)
+ {
+ t_len_1 = FZD_MIN(strlen(temp_ptr), ((NV_WATCH_VC_CONTACT_NAME_LEN - 1) * 4));
+ mmi_unicode_hex_str_to_utf8_str(temp_ptr, t_len_1, t_vc_contact.name[i], &t_len_2);
+
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%d\n", __FUNCTION__, __LINE__, t_len_1, t_len_2);
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %s\n", __FUNCTION__, __LINE__, temp_ptr);
+ }
+ else
+ {
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ break;
+ }
+
+ i++;
+ if(NV_WATCH_VC_CONTACT_TOTAL <= i)
+ {
+ break;
+ }
+ }
+
+ t_vc_contact.total = i;
+ mmi_vc_contact_set(&t_vc_contact);
+
+ return result;
+}
+
+bool mmi_protocol_fzd_action_VC_CALL_REQUEST(char * number, uint8_t call_type)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_WATCH_VC_CALL_REQUEST;
+ unsigned char content_buff[NV_WATCH_VC_CONTACT_NUMBER_LEN + 8] = {0};
+ unsigned int content_lenth = 0;
+
+ sprintf(content_buff, ",%s,%d", number, call_type);
+ content_lenth = strlen(content_buff);
+
+ result = mmi_protocol_fzd_send_with_data(action, content_buff, content_lenth);
+
+ return result;
+}
+
+// [XT*YYYYYYYYYYYYYYY*LEN*AGTALK,ÒôÊÓÆµ×´Ì¬,»áÒéid,appKey,ÃØÔ¿,token,uid]
+// ״̬ 0-continue; other-stop
+bool mmi_protocol_fzd_parse_WATCH_VC_CALL_REQUEST(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ bool result = false;
+
+ if(NULL == next_buff || 0 == next_buff_len)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
+ result = true;
+
+ char * t_value = NULL;
+ t_value = km_strtok_r(NULL, ",", &next_buff);
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: t_value=%s\n", __FUNCTION__, __LINE__, t_value);
+
+ if(0 == atoi(t_value))
+ {
+ // go on
+ char * t_ticket = NULL;
+ char * t_appkey = NULL;
+ char * t_secret = NULL;
+ char * t_tokens = NULL;
+ char * t_uid = NULL;
+
+ t_ticket = km_strtok_r(NULL, ",", &next_buff);
+ t_appkey = km_strtok_r(NULL, ",", &next_buff);
+ t_secret = km_strtok_r(NULL, ",", &next_buff);
+ t_tokens = km_strtok_r(NULL, ",", &next_buff);
+ t_uid = next_buff;
+
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%d,%d\n", __FUNCTION__, __LINE__, strlen(t_ticket), strlen(t_appkey), strlen(t_secret));
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%d\n", __FUNCTION__, __LINE__, strlen(t_tokens), strlen(t_uid));
+
+ mmi_vc_call_action_dialing_ext(t_ticket, t_appkey, t_secret, t_tokens, t_uid);
+ }
+ else
+ {
+ // stop
+ mmi_vc_call_action_call_stop();
+ }
+
+ return result;
+}
+
+// reject
+bool mmi_protocol_fzd_parse_SERVER_VC_CALL_RESPONSE(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_VC_CALL_RESPONSE;
+
+ if(NULL == next_buff || 0 == next_buff_len)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
+ result = true;
+ mmi_protocol_fzd_send_without_data(action);
+
+ // the other party is reject
+ mmi_vc_call_action_call_stop();
+
+ return result;
+}
+
+bool mmi_protocol_fzd_action_SERVER_VC_CALL_REQUEST(int8_t state)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_VC_CALL_REQUEST;
+ unsigned char content_buff[8] = {0};
+ unsigned int content_lenth = 0;
+
+ sprintf(content_buff, ",%d", state);
+ content_lenth = strlen(content_buff);
+
+ result = mmi_protocol_fzd_send_with_data(action, content_buff, content_lenth);
+
+ return result;
+}
+
+// [XT*YYYYYYYYYYYYYYY*LEN*CALLING,ºô½ÐÕßÕ˺Å,ͨ»°ÀàÐÍ,»áÒéid,appKey,ÃØÔ¿,token,uid]
+bool mmi_protocol_fzd_parse_SERVER_VC_CALL_REQUEST(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_VC_CALL_REQUEST;
+
+ if(NULL == next_buff || 0 == next_buff_len)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
+ result = true;
+ if(true == mmi_video_call_is_in_call())
+ {
+ mmi_protocol_fzd_action_SERVER_VC_CALL_REQUEST(1);
+ }
+ else
+ {
+ mmi_protocol_fzd_action_SERVER_VC_CALL_REQUEST(0);
+
+ char * t_number = NULL;
+ char * t_type = NULL;
+ char * t_ticket = NULL;
+ char * t_appkey = NULL;
+ char * t_secret = NULL;
+ char * t_tokens = NULL;
+ char * t_uid = NULL;
+
+ t_number = km_strtok_r(NULL, ",", &next_buff);
+ t_type = km_strtok_r(NULL, ",", &next_buff);
+ t_ticket = km_strtok_r(NULL, ",", &next_buff);
+ t_appkey = km_strtok_r(NULL, ",", &next_buff);
+ t_secret = km_strtok_r(NULL, ",", &next_buff);
+ t_tokens = km_strtok_r(NULL, ",", &next_buff);
+ t_uid = next_buff;
+
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%d,%d\n", __FUNCTION__, __LINE__, strlen(t_ticket), strlen(t_appkey), strlen(t_secret));
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%d\n", __FUNCTION__, __LINE__, strlen(t_tokens), strlen(t_uid));
+
+ mmi_vc_call_action_incoming(t_number, t_type, t_ticket, t_appkey, t_secret, t_tokens, t_uid);
+ }
+
+ return result;
+}
+
+// [XT*YYYYYYYYYYYYYYY*LEN*RCALLING,ºô½ÐÕßÕ˺Å,ͨ»°ÀàÐÍ,»áÒéid]
+bool mmi_protocol_fzd_action_VC_CALL_RESPONSE(char * number, char * ticket, MODEM_VIDEO_CALL_TYPE type)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_WATCH_VC_CALL_RESPONSE;
+
+ if(NULL == number) // hang up
+ {
+ result = mmi_protocol_fzd_send_without_data(action);
+ }
+ else // reject
+ {
+ unsigned char content_buff[NV_WATCH_VC_CONTACT_NUMBER_LEN + 64 + 8] = {0};
+ unsigned int content_lenth = 0;
+
+ sprintf(content_buff, ",%s,%s,%d", number, type, ticket);
+ content_lenth = strlen(content_buff);
+
+ result = mmi_protocol_fzd_send_with_data(action, content_buff, content_lenth);
+ }
+ return result;
+}
+#endif
+
+#endif
+
+#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+// [XT*334588000000156*0038*SILENCETIME2,7:30-21:10-1-0111110,7:30-21:10-1-0111110,7:30-21:10-0-0111110]
+bool mmi_protocol_fzd_parse_SERVER_SET_NOT_DISTURB(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_NOT_DISTURB;
+
+ if(NULL == next_buff || 0 == next_buff_len)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
+ result = true;
+ mmi_protocol_fzd_send_without_data(action);
+
+#if 0
+ nv_watch_do_not_disturb_t not_disturb_data = {0};
+ char * group_str = NULL;
+ char * group_last = NULL;
+ char * temp_ptr = NULL;
+ char * last = NULL;
+ uint8_t i = 0;
+
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: next_buff=%s\n", __FUNCTION__, __LINE__, next_buff);
+ group_str = km_strtok_r(next_buff, ",", &group_last);
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: temp_ptr1=%s,next_buff=%s\n", __FUNCTION__, __LINE__, group_str, next_buff);
+ while(NULL != group_str)
+ {
+ temp_ptr = km_strtok_r(group_str, ":", &last);
+ not_disturb_data.item_info[i].begin_hour = atoi(temp_ptr);
+
+ temp_ptr = km_strtok_r(NULL, "-", &last);
+ not_disturb_data.item_info[i].begin_min = atoi(temp_ptr);
+
+ temp_ptr = km_strtok_r(NULL, ":", &last);
+ not_disturb_data.item_info[i].end_hour = atoi(temp_ptr);
+
+ temp_ptr = km_strtok_r(NULL, "-", &last);
+ not_disturb_data.item_info[i].end_min = atoi(temp_ptr);
+
+ temp_ptr = km_strtok_r(NULL, "-", &last);
+ not_disturb_data.item_info[i].on_off = atoi(temp_ptr);
+
+ //not_disturb_data.item_info[i].week_bitmap = 0x80; // 0xff;
+ if(NULL != last)
+ {
+ uint8_t j = 0;
+ for(j = 0; j < 7; j++)
+ {
+ not_disturb_data.item_info[i].week_bitmap |= ((('0' == *(last + j)) ? 0 : 1) << j);
+ }
+ }
+
+ i++;
+ if(NV_WATCH_DO_NOT_DISTURB_ITEM_MAX <= i)
+ {
+ break;
+ }
+
+ group_str = km_strtok_r(NULL, ",", &group_last);
+ }
+
+ mmi_watch_do_not_disturb_data_set(¬_disturb_data);
+
+ //uint8_t x = 0;
+ //for(x = 0; x < i; x++)
+ //{
+ // PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: %d,%d\n", __LINE__, server_set_alarm[x].on_off, server_set_alarm[x].repeat_bitmap);
+ //}
#endif
+ return result;
+}
+#endif
+
+bool mmi_protocol_fzd_parse_SERVER_SET_DIAL_PAD_SWITCH(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH;
+
+ if(NULL == next_buff || 0 == next_buff_len)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
+ result = true;
+ mmi_protocol_fzd_send_without_data(action);
+
+ uint32_t value = atoi(next_buff);
+ mmi_dial_pad_switch_set(value);
+
+ return result;
+}
+
+bool mmi_protocol_fzd_parse_SERVER_SET_WHITE_LIST_SWITCH(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_WHITE_LIST_SWITCH;
+
+ if(NULL == next_buff || 0 == next_buff_len)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
+ result = true;
+ mmi_protocol_fzd_send_without_data(action);
+
+ uint32_t value = atoi(next_buff);
+
+ //
+ //
+ //mmi_protocol_watch_location_upload_interval_set(value);
+ //
+ //
+
+ return result;
+}
+
+