gengxin
authorCCC <2393524978@qq.com>
Fri, 25 Aug 2023 08:46:32 +0000 (16:46 +0800)
committerCCC <2393524978@qq.com>
Fri, 25 Aug 2023 08:46:32 +0000 (16:46 +0800)
2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call.c
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_fzd.c
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.c
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_video_call/mmi_video_call_tongxin.h
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c

index b373731..5c7220f 100644 (file)
@@ -225,8 +225,8 @@ typedef struct
 
 
 #define NV_WATCH_VC_CONTACT_TOTAL              (50)
-#define NV_WATCH_VC_CONTACT_NAME_LEN      (16+1)
-#define NV_WATCH_VC_CONTACT_NUMBER_LEN    (20+1)
+#define NV_WATCH_VC_CONTACT_NAME_LEN      (32+1)
+#define NV_WATCH_VC_CONTACT_NUMBER_LEN    (64+1)
 
 typedef struct
 {
index 6a805f6..032f2fb 100644 (file)
@@ -740,6 +740,14 @@ void mmi_vc_contact_set(nv_watch_vc_contact_t * contact_list)
 
 }
 
+static 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-hang up or reject; 1-accepte; 2-dial
 void mmi_vc_call_operate_send_to_server(uint_8 flag)
 {
@@ -932,6 +940,22 @@ void mmi_vc_ring_off_action(lv_obj_t * btn, lv_event_t e)
     voip_rat_check_stop();
 }
 
+void mmi_ui_msg_update_vc_call_stop(void)
+{
+       mmi_vc_ring_off_action(NULL, LV_EVENT_CLICKED);         
+}
+
+void mmi_vc_call_action_call_stop(void)
+{
+       if(true != mmi_video_call_is_in_call())
+       {
+               return;
+       }
+       
+       mmi_watch_wake_up();
+       mmi_ui_msg_action_vc_call_stop();
+}
+
 static void mmi_vc_ui_dialing(lv_obj_t * content)
 {
        VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
@@ -1423,17 +1447,6 @@ static lv_obj_t * mmi_vc_ui_create(lv_obj_t * activity_obj)
     return obj;
 }
 
-void mmi_ui_msg_update_vc_call_stop(void)
-{
-       mmi_vc_ring_off_action(NULL, LV_EVENT_CLICKED);         
-}
-
-void mmi_vc_call_action_call_stop(void)
-{
-       mmi_watch_wake_up();
-       mmi_ui_msg_action_vc_call_stop();
-}
-
 void mmi_ui_msg_update_vc_call_incoming(void)
 {
        s_vc_call_ui = MMI_VC_UI_INCOMING;
@@ -1447,6 +1460,7 @@ void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type)
                #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
                || true == mmi_watch_is_in_do_not_disturb_time()
                #endif
+               || true == mmi_video_call_is_in_call()
                )
        {
                VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
index 7877cbc..0f40050 100644 (file)
@@ -744,6 +744,14 @@ void mmi_vc_contact_set(nv_watch_vc_contact_t * contact_list)
 
 }
 
+static 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)
 {
@@ -942,6 +950,11 @@ void mmi_ui_msg_update_vc_call_stop(void)
 
 void mmi_vc_call_action_call_stop(void)
 {
+       if(true != mmi_video_call_is_in_call())
+       {
+               return;
+       }
+       
        mmi_watch_wake_up();
        mmi_ui_msg_action_vc_call_stop();
 }
@@ -1450,6 +1463,7 @@ void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type, char
                #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
                || true == mmi_watch_is_in_do_not_disturb_time()
                #endif
+               || true == mmi_video_call_is_in_call()
                )
        {
                VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
@@ -1492,7 +1506,6 @@ 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_watch_wake_up();
                
index 7b6d2e3..3cd5847 100644 (file)
@@ -748,7 +748,7 @@ void mmi_vc_contact_set(nv_watch_vc_contact_t * contact_list)
 
 }
 
-bool mmi_video_call_is_in_call(void)
+static 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;
@@ -954,6 +954,11 @@ void mmi_ui_msg_update_vc_call_stop(void)
 
 void mmi_vc_call_action_call_stop(void)
 {
+       if(true != mmi_video_call_is_in_call())
+       {
+               return;
+       }
+       
        mmi_watch_wake_up();
        mmi_ui_msg_action_vc_call_stop();
 }
@@ -1464,6 +1469,7 @@ void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type,
                #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
                || true == mmi_watch_is_in_do_not_disturb_time()
                #endif
+               || true == mmi_video_call_is_in_call()
                )
        {
                VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
index fedc0ef..4ba7b70 100644 (file)
@@ -188,7 +188,7 @@ typedef struct {
 #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)
+#define MMI_WATCH_VC_UID_LEN  (32 + 1)
 
 
 
@@ -205,7 +205,6 @@ void mmi_video_call_jrtc_config_init_00(void);
 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);
index cee4bd7..18bc631 100644 (file)
@@ -2759,35 +2759,36 @@ bool mmi_protocol_fzd_parse_SERVER_VC_CALL_REQUEST(unsigned char * next_buff, un
        }
 
        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);
+       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;
+       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;
+       uint8_t t_value = 0;
 
-               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\n", __FUNCTION__, __LINE__, next_buff_len);
+       //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: %s\n", __LINE__, next_buff+0);
+       //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: %s\n", __LINE__, next_buff+31);
+       //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: %s\n", __LINE__, next_buff+63);
+       //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: %s\n", __LINE__, next_buff+95);
+       
+       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;
+       t_value = atoi(t_type);
 
-               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);
-       }
+       PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%d,%d,%d,%d\n", __FUNCTION__, __LINE__, 
+                                                       strlen(t_ticket), strlen(t_appkey), strlen(t_secret), strlen(t_tokens), strlen(t_uid));
+       
+       mmi_vc_call_action_incoming(t_number, t_value, t_ticket, t_appkey, t_secret, t_tokens, t_uid);
        
        return result;
 }
@@ -2807,7 +2808,7 @@ bool mmi_protocol_fzd_action_VC_CALL_RESPONSE(char * number, char * ticket, MODE
                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);
+               sprintf(content_buff, ",%s,%d,%s", number, type, ticket);
                content_lenth = strlen(content_buff);
 
                result = mmi_protocol_fzd_send_with_data(action, content_buff, content_lenth);