From: CCC <2393524978@qq.com> Date: Thu, 24 Aug 2023 07:56:59 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=6a89e3d9dcab10ff63593620ee888e6d98a84a71;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/CMakeLists.txt b/2.sdk/sdk/gui/lv_watch/CMakeLists.txt index a237058c..3b2a6ffb 100644 --- a/2.sdk/sdk/gui/lv_watch/CMakeLists.txt +++ b/2.sdk/sdk/gui/lv_watch/CMakeLists.txt @@ -208,6 +208,8 @@ set(lv_watch_sources lv_apps/mmi_video_call/mmi_jrtc_client.c lv_apps/mmi_video_call/mmi_video_call_fzd.c lv_apps/mmi_video_call/mmi_jrtc_client_fzd.c + lv_apps/mmi_video_call/mmi_video_call_tongxin.c + lv_apps/mmi_video_call/mmi_jrtc_client_tongxin.c #wechat lv_apps/mmi_wechat/wechat_ui.c #primary menu data diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_jrtc_client_tongxin.c b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_jrtc_client_tongxin.c index c723cc86..310a76a6 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_jrtc_client_tongxin.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_jrtc_client_tongxin.c @@ -4,7 +4,7 @@ #include "lv_watch.h" #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ -#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__ +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__ //#include #include "../../../../product/craneg_modem/framework/inc/jrtc.h" @@ -52,26 +52,15 @@ void mmi_video_call_jrtc_config_init_00(void) #endif } -void mmi_video_call_jrtc_config_init_01(char * t_tokens) +void mmi_video_call_jrtc_config_init_01(char * t_appkey, char * t_secret, char * t_tokens, char * t_uid) { #ifndef __VIDEO_CALL_TEST__ - char appkey[24+1] = "efe9f8800a39d96244234097"; - char key[16+1] = "25v9C652123QL3N8"; - char uid[64+1] = {0}; - char tokens[128+1] = {0}; - - char imei[16] = {0}; - app_adp_get_imei_req(imei); - strncpy(uid, imei, 16); - - memcpy(tokens, t_tokens, 128); - - VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%s\n", __FUNCTION__, __LINE__, strlen(appkey), appkey); - VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%s\n", __FUNCTION__, __LINE__, strlen(uid), uid); - VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%s\n", __FUNCTION__, __LINE__, strlen(key), key); - VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%s\n", __FUNCTION__, __LINE__, strlen(tokens), tokens); + VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%s\n", __FUNCTION__, __LINE__, strlen(t_appkey), t_appkey); + VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%s\n", __FUNCTION__, __LINE__, strlen(t_uid), t_uid); + VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%s\n", __FUNCTION__, __LINE__, strlen(t_secret), t_secret); + VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%s\n", __FUNCTION__, __LINE__, strlen(t_tokens), t_tokens); - jrtc_config(appkey, uid, key, tokens); + jrtc_config(t_appkey, t_uid, t_secret, t_tokens); Hal_Mem_Set(&s_video_call_jrtc, 0x0, sizeof(MMI_VIDEO_CALL_JRTC_T)); #endif } diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c index 7877cbc2..7b6d2e3d 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c @@ -5,9 +5,9 @@ #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 #include @@ -21,8 +21,11 @@ static lv_task_t * rat_check_task = NULL; 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}; /********************** @@ -58,7 +61,7 @@ void mmi_vc_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority) { return; } - mmi_vc_activity_destroy_req_fzd(); + mmi_vc_activity_destroy_req_tongxin(); Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_2); } } @@ -126,10 +129,11 @@ static void mmi_vc_call_screen_clean(void) 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) @@ -597,7 +601,7 @@ static void voip_set_volume_when_slider_act(void) 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); } @@ -744,11 +748,19 @@ void mmi_vc_contact_set(nv_watch_vc_contact_t * contact_list) } +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); } @@ -822,8 +834,8 @@ static void mmi_vc_hook_action(lv_obj_t * btn, lv_event_t e) 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); @@ -1443,7 +1455,9 @@ void mmi_ui_msg_update_vc_call_incoming(void) 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() @@ -1476,11 +1490,20 @@ void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type, char } } - 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)) @@ -1491,8 +1514,7 @@ void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type, char // - 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(); @@ -1596,16 +1618,25 @@ static void mmi_vc_call_dialing_timeout_cb(void * para) 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); @@ -1961,12 +1992,12 @@ void video_call_create_event_cb(lv_obj_t * btn, lv_event_t e) //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) @@ -1980,7 +2011,7 @@ bool mmi_vc_watch_suspend_check_fzd(void) 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()) { @@ -1990,7 +2021,7 @@ bool mmi_vc_connect_check_req_fzd(void) 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__); diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h index 968f94e7..fedc0ef9 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h @@ -1,8 +1,8 @@ -#ifndef __MMI_VIDEO_CALL_FZD_H__ -#define __MMI_VIDEO_CALL_FZD_H__ +#ifndef __MMI_VIDEO_CALL_TONGXIN_H__ +#define __MMI_VIDEO_CALL_TONGXIN_H__ #ifdef __cplusplus extern "C" { @@ -25,7 +25,7 @@ void voip_alarm_ind(void); #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ -#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__ +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__ #define __VIDEO_CALL_DEBUG__ @@ -185,7 +185,10 @@ typedef struct { #define MMI_WATCH_VC_TICKET_LEN (64 + 1) +#define MMI_WATCH_VC_APPKEY_LEN (24 + 1) +#define MMI_WATCH_VC_SECRET_LEN (16 + 1) #define MMI_WATCH_VC_TOKENS_LEN (128 + 1) +#define MMI_WATCH_VC_UID_LEN (64 + 1) @@ -199,14 +202,17 @@ void watch_voip_message_handle_init(void); void mmi_video_call_jrtc_config_init_00(void); -void mmi_video_call_jrtc_config_init_01(char * t_tokens); +void mmi_video_call_jrtc_config_init_01(char * t_appkey, char * t_secret, char * t_tokens, char * t_uid); void mmi_video_call_contact_nv_read(void); void mmi_vc_contact_set(nv_watch_vc_contact_t * contact_list); +bool mmi_video_call_is_in_call(void); void * mmi_video_call_phone_get_video_buffer(void); void mmi_vc_ring_off_no_carrier(uint8_t isNoCarrier); void mmi_vc_call_action_dialing(char * number, MODEM_VIDEO_CALL_TYPE type); -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); void mmi_vc_call_action_connecting(void); void mmi_vc_call_action_connected(void); @@ -224,10 +230,10 @@ void voip_fps_check(int8_t fps); void video_call_create_event_cb(lv_obj_t *btn, lv_event_t e); -bool mmi_vc_connect_check_req_fzd(void); -bool mmi_vc_watch_suspend_check_fzd(void); -void mmi_vc_activity_destroy_req_fzd(void); -uint8_t mmi_vc_get_call_volume_fzd(void); +bool mmi_vc_connect_check_req_tongxin(void); +bool mmi_vc_watch_suspend_check_tongxin(void); +void mmi_vc_activity_destroy_req_tongxin(void); +uint8_t mmi_vc_get_call_volume_tongxin(void); #endif diff --git a/2.sdk/sdk/gui/lv_watch/lv_watch.c b/2.sdk/sdk/gui/lv_watch/lv_watch.c index c90edafc..aae4509c 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_watch.c +++ b/2.sdk/sdk/gui/lv_watch/lv_watch.c @@ -901,6 +901,9 @@ uint8_t voip_get_call_volume(void) #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__ return (mmi_vc_get_call_volume_fzd()); #endif +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__ + return (mmi_vc_get_call_volume_tongxin()); +#endif #endif return 0; @@ -915,6 +918,9 @@ bool watch_voip_suspend_check(void) #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__ return (mmi_vc_watch_suspend_check_fzd()); #endif +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__ + return (mmi_vc_watch_suspend_check_tongxin()); +#endif #endif return true; @@ -929,6 +935,9 @@ bool voip_connect_check_req(void) #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__ return (mmi_vc_connect_check_req_fzd()); #endif +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__ + return (mmi_vc_connect_check_req_tongxin()); +#endif #endif return false; @@ -943,6 +952,9 @@ void voip_activity_destroy_req(void) #ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_FZD__ (mmi_vc_activity_destroy_req_fzd()); #endif +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL_TONGXIN__ + return (mmi_vc_activity_destroy_req_tongxin()); +#endif #endif } diff --git a/2.sdk/sdk/gui/lv_watch/lv_watch.h b/2.sdk/sdk/gui/lv_watch/lv_watch.h index 7fb5cd55..373e1217 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_watch.h +++ b/2.sdk/sdk/gui/lv_watch/lv_watch.h @@ -177,19 +177,12 @@ extern "C" { #include "framework/message/mmi_msg_zhsx.h" #include "lv_apps/mmi_video_call/mmi_video_call.h" #include "lv_apps/mmi_video_call/mmi_video_call_fzd.h" -#ifdef __MMI_WECHAT_SUPPORT__ +#include "lv_apps/mmi_video_call/mmi_video_call_tongxin.h" #include "lv_apps/mmi_wechat/wechat.h" -#endif #include "lv_apps/health_measure/health_measure.h" -#ifdef __MMI_HEALTH_MEASURE_HEART_SUPPORT__ #include "lv_apps/health_measure/health_heart_rate.h" -#endif -#ifdef __MMI_HEALTH_MEASURE_SPO2_SUPPORT__ #include "lv_apps/health_measure/health_spo2.h" -#endif -#ifdef __MMI_HEALTH_MEASURE_TEMPERATURE_SUPPORT__ #include "lv_apps/health_measure/health_temperature.h" -#endif #endif diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c index 8d266857..cee4bd7b 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c @@ -545,7 +545,7 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO {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"}, @@ -554,6 +554,11 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO {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*******/ @@ -719,7 +724,7 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned 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; @@ -745,6 +750,21 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned #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; @@ -1553,7 +1573,6 @@ bool mmi_protocol_fzd_parse_ACTION_TALK_MESSAGE(unsigned char * next_buff, unsig 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__); @@ -1562,12 +1581,13 @@ bool mmi_protocol_fzd_parse_ACTION_TALK_MESSAGE(unsigned char * next_buff, unsig 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; } @@ -2550,8 +2570,376 @@ bool mmi_protocol_fzd_action_VC_CALL_RESPONSE(char * number, char * ticket, MODE 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; +} + + diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h index f0fdfc70..12967391 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h @@ -132,7 +132,7 @@ typedef enum MMI_FZD_ACTION_UNBIND, #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__) MMI_FZD_WATCH_GET_VC_CONFIG, MMI_FZD_WATCH_GET_VC_CONTACT, MMI_FZD_WATCH_VC_CALL_REQUEST, @@ -142,6 +142,13 @@ typedef enum #endif #endif +#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ + MMI_FZD_SERVER_SET_NOT_DISTURB, +#endif + MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH, + MMI_FZD_SERVER_SET_WHITE_LIST_SWITCH, + + /*******add before this line*******/ MMI_FZD_ACTION_MAX @@ -252,6 +259,12 @@ bool mmi_protocol_fzd_action_get_vc_config(void); bool mmi_protocol_fzd_action_VC_CALL_REQUEST(char * number, uint8_t call_type); #endif +#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ +bool mmi_protocol_fzd_parse_SERVER_SET_NOT_DISTURB(unsigned char * next_buff, unsigned int next_buff_len); +#endif +bool mmi_protocol_fzd_parse_SERVER_SET_DIAL_PAD_SWITCH(unsigned char * next_buff, unsigned int next_buff_len); +bool mmi_protocol_fzd_parse_SERVER_SET_WHITE_LIST_SWITCH(unsigned char * next_buff, unsigned int next_buff_len); + #endif