同步Z5的优化
author@CHENG <2393524978@qq.com>
Tue, 17 Dec 2024 06:45:15 +0000 (14:45 +0800)
committer@CHENG <2393524978@qq.com>
Tue, 17 Dec 2024 06:45:15 +0000 (14:45 +0800)
2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c
2.sdk/sdk/gui/lv_watch/lv_apps/sms_msg/sms_msg.c
2.sdk/sdk/gui/lv_watch/lv_apps/sms_msg/sms_msg.h
2.sdk/sdk/gui/lv_watch/lv_watch.c
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.h
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c
2.sdk/sdk/gui/lv_watch/modem/mmi_modem_tcp/mmi_modem_tcp_net.c
2.sdk/sdk/gui/lv_watch/modem/mmi_modem_tcp/mmi_modem_tcp_net.h
2.sdk/sdk/gui/lv_watch/modem/mmi_modem_tcp/mmi_modem_tcp_task.c
2.sdk/sdk/gui/lv_watch/modem/mmi_modem_tcp/mmi_modem_tcp_task.h

index 401a95c..add07ab 100644 (file)
@@ -175,8 +175,11 @@ void watch_ui_message_handle(uint16_t msgid, void * msg)
             break;
 #if USE_LV_WATCH_SMS_MSG != 0
         case MMI_MODEM_RECV_SMS_NOTIFY_UI_CMD:
-        sms_msg_list_update();
-        break;
+                       #ifdef __MMI_ZHSX_SUPPORT__
+                       mmi_sms_new_msg_prompt();
+                       #endif
+               sms_msg_list_update();
+               break;
 #endif
 
         case MMI_HAL_LOW_POWER_IND:
index c1b84f1..7df67cc 100644 (file)
@@ -391,6 +391,31 @@ static void mmi_sms_vib_prompt_task_cb(lv_task_t * task)
        Hal_Vibrator_Play_End();
 }
 
+void mmi_sms_new_msg_prompt(void)
+{
+       uint8_t volume = 0;
+       
+#ifdef __MMI_USER_PROFILE_SUPPORT__
+       volume = mmi_user_profile_current_mode_new_sms_volume_get();
+#else
+       volume = query_current_volume();
+#endif
+#ifdef __MMI_NEW_SMS_SILENT_SUPPORT__
+       if(0 != mmi_new_sms_silent_swtich_get())
+               volume = 0;
+#endif
+       if(0 != volume)
+       {
+               Hal_NFFS_File_Play_Onetime(AUDIO_SETTING_AUDIO_MSG, volume, NULL, 0);
+       }
+       if(true == mmi_watch_vibrate_is_permitted())
+       {
+               Hal_Vibrator_Play_Onetime(NULL, 800);
+               lv_task_t * task_ptr = lv_task_create(mmi_sms_vib_prompt_task_cb, 900, LV_TASK_PRIO_MID, NULL);
+               lv_task_once(task_ptr);
+       }
+}
+
 void sms_msg_app_new_sms_info_ind(app_adp_new_sms_info_ind_t *sms_info)
 {
        if(sms_info == NULL)
@@ -453,10 +478,10 @@ void sms_msg_app_new_sms_info_ind(app_adp_new_sms_info_ind_t *sms_info)
                        && (false == mmi_health_measure_state_is_ui_measure())
                        #endif
                        )
-               {                       
+               {
                        if(0 == Hal_Pm_Get_State())
                        {
-                               printf("sms_msg_list_update -----> onkey_wakeup\n");
+                               printf("new_sms -----> onkey_wakeup\n");
                                extern void onkey_wakeup(void) __attribute__((weak));
                                if (onkey_wakeup != NULL)
                                {
@@ -465,35 +490,11 @@ void sms_msg_app_new_sms_info_ind(app_adp_new_sms_info_ind_t *sms_info)
                        }
                        else
                        {
-                               printf("sms_msg_list_update -----> watch_set_lcd_status\n");
+                               printf("new_sms -----> watch_set_lcd_status\n");
                                watch_set_lcd_status(true);
                                watch_wakeup_time_reset();
                        }
 
-               #ifdef __MMI_ZHSX_SUPPORT__
-                       uint8_t volume = 0;
-                       
-                       #ifdef __MMI_USER_PROFILE_SUPPORT__
-                       volume = mmi_user_profile_current_mode_new_sms_volume_get();
-                       #else
-                       volume = query_current_volume();
-                       #endif
-                       #ifdef __MMI_NEW_SMS_SILENT_SUPPORT__
-                       if(0 != mmi_new_sms_silent_swtich_get())
-                               volume = 0;
-                       #endif
-                       if(0 != volume)
-                       {
-                               Hal_NFFS_File_Play_Onetime(AUDIO_SETTING_AUDIO_MSG, volume, NULL, 0);
-                       }
-                       if(true == mmi_watch_vibrate_is_permitted())
-                       {
-                               Hal_Vibrator_Play_Onetime(NULL, 800);
-                               lv_task_t * task_ptr = lv_task_create(mmi_sms_vib_prompt_task_cb, 900, LV_TASK_PRIO_MID, NULL);
-                               lv_task_once(task_ptr);
-                       }
-               #endif
-
                        //notify ui 
                        app_adaptor_recv_sms_notsify_update_ui();
                }
index 1e71fca..c99f05c 100644 (file)
@@ -70,6 +70,9 @@ typedef struct
  */
 void sms_msg_list_update(void);
 void  sms_msg_create_event_cb(lv_obj_t * btn,lv_event_t e);
+#ifdef __MMI_ZHSX_SUPPORT__
+void mmi_sms_new_msg_prompt(void);
+#endif
 void sms_msg_app_new_sms_info_ind(app_adp_new_sms_info_ind_t *sms_info);
 lv_obj_t * sms_msg_create(lv_obj_t * tileview,uint16_t id);
 
index ff2ab9a..cda7f61 100644 (file)
@@ -86,6 +86,12 @@ static bool watch_ambient = false;
 #ifdef __MMI_ZHSX_SUPPORT__
 static void mmi_data_init_before_watch_create(void)
 {
+       // create task
+       mmi_protocol_timing_task_create();
+#ifdef __MMI_ZHSX_SUPPORT_HEALTH_SENSOR__
+       mmi_health_measure_task_init();
+#endif
+       
        // mmi_watch_common_task_create();
        mmi_sos_number_nv_read();
        mmi_center_number_nv_read();
@@ -315,11 +321,17 @@ void option_key(struct _lv_obj_t * obj, lv_event_t event)
 
 #ifdef __MMI_ZHSX_SUPPORT__
 static bool s_is_ACT_ID_POWON_LOGO = false;
+static bool s_poweron_logo_is_finish = false;
 
 bool mmi_is_ACT_ID_POWON_LOGO(void)
 {
        return s_is_ACT_ID_POWON_LOGO;
 }
+
+bool mmi_poweron_logo_is_finish(void)
+{
+       return s_poweron_logo_is_finish;
+}
 #endif
 
 void watch_poweron_logo(void)
@@ -385,6 +397,8 @@ static void watch_poweron_logo_del(void)
 
 #ifdef __MMI_ZHSX_SUPPORT__
        s_is_ACT_ID_POWON_LOGO = false;
+
+       s_poweron_logo_is_finish = true;
 #endif
 }
 
index 454d817..894f191 100644 (file)
@@ -321,11 +321,11 @@ void mmi_watch_authenticate_action(void)
                                }
 
                                mmi_watch_authenticate_flag_set(1);
-                               mmi_launcher_tcp_first_connect(0);
+                               mmi_launcher_tcp_first_connect_check_start();
                        }
                        else
                        {
-                               PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: false\n", __FUNCTION__, __LINE__);
+                               PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: false.imei=%s\n", __FUNCTION__, __LINE__, imei);
                                //cplog_printf("[@CHENG_DEBUG][%s][%d]: false\n", __FUNCTION__, __LINE__);
                        }
                }
@@ -578,7 +578,7 @@ static void mmi_protocol_timing_task_entry(void * para)
     }
 }
 
-static void mmi_protocol_timing_task_create(void)
+void mmi_protocol_timing_task_create(void)
 {
        if(NULL != s_protocol_timing_task_id)
        {
@@ -591,7 +591,7 @@ static void mmi_protocol_timing_task_create(void)
                                                                                        PROTOCOL_TIMING_MSG_QUEUE_SIZE,
                                                                                        PROTOCOL_TIMING_TASK_STACK_SIZE,
                                                                                        PROTOCOL_TIMING_TASK_PRIORITY,
-                                                                                       "mmi_protocol_timing_task");
+                                                                                       "protocol_timing");
 
        PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: task_id=0x%x\n",__FUNCTION__,__LINE__, s_protocol_timing_task_id);
 }
@@ -701,7 +701,7 @@ void mmi_protocol_timing_mission_action(void)
 {
        mmi_protocol_timing_mission_stop();
        
-       mmi_protocol_timing_task_create();
+       //mmi_protocol_timing_task_create();
 
        uint32_t cur_time_stamp = 0;
        Hal_Rtc_Gettime_Count_Utc(&cur_time_stamp);
@@ -719,7 +719,7 @@ void mmi_protocol_timing_mission_action(void)
        s_protocol_timed_weather_time_stamp = cur_time_stamp;
 
 #ifdef __MMI_ZHSX_SUPPORT_HEALTH_SENSOR__
-       mmi_health_measure_task_init();
+       //mmi_health_measure_task_init();
        mmi_health_measure_timed_info_nv_read();
        mmi_health_measure_timed_mission_action(cur_time_stamp, true);
 #endif
@@ -764,10 +764,6 @@ void mmi_protocol_timing_mission_stop(void)
 extern void dm_send_msg_active(void);
 bool mmi_protocol_watch_link_action(void)
 {
-#ifdef __MMI_CUSTOM_HENGAI_HEALTH__
-       mmi_hengai_algorithm_interface_login_action();
-       mmi_hengai_health_lib_activation_check_action();
-#endif
 #if USE_DS_DM
        dm_send_msg_active();
 #endif
@@ -781,11 +777,13 @@ bool mmi_protocol_check_state_before_send_action(void)
                PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: no sim\n", __FUNCTION__, __LINE__);
                return false;
        }
+/*
     if(MMI_MODEM_SIGNAL_BAR_0 == watch_modem_get_signal_bar_req())
        {
                PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: no signal\n", __FUNCTION__, __LINE__);
                return false;
        }
+*/
        if(false == mmi_watch_tcp_connect_state_get())
        {
                PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: tcp not connect\n", __FUNCTION__, __LINE__);
index 84740f8..4133bbd 100644 (file)
@@ -89,6 +89,7 @@ uint8_t mmi_protocol_device_name_len_get(void);
 char * mmi_protocol_device_name_get(void);
 void mmi_protocol_device_name_set(char * device_name);
 
+void mmi_protocol_timing_task_create(void);
 void mmi_protocol_timing_task_msg_send(MMI_PROTOCOL_TIMING_MSG_ID_E msg_id, void * msg_param);
 void mmi_protocol_timing_mission_action(void);
 void mmi_protocol_timing_mission_stop(void);
index bb366d1..1998cc5 100644 (file)
@@ -578,13 +578,47 @@ static void mmi_watch_action_after_bind(void)
 
 }
 
+
+static void * s_login_timer_id = NULL;
+static void mmi_protocol_fzd_login_check_stop(void)
+{
+       if(NULL != s_login_timer_id)
+       {
+               uos_timer_stop(s_login_timer_id);
+               uos_timer_delete(s_login_timer_id);
+               s_login_timer_id = NULL;
+       }
+}
+
+static void mmi_protocol_fzd_login_check_cb(uint32_t para)
+{
+       send_task_msg_tcp_reconnect(NULL);
+}
+
+static void mmi_protocol_fzd_login_check_start(void)
+{
+       if(NULL == s_login_timer_id)
+       {
+               uos_timer_create(&s_login_timer_id);
+       }
+       else
+       {
+               uos_timer_stop(s_login_timer_id);
+       }
+       uos_timer_start(s_login_timer_id, MS_TO_TICKS(1000 * 20), 0, mmi_protocol_fzd_login_check_cb, NULL);
+}
+
 bool mmi_protocol_fzd_action_LINK(void)
 {
+       mmi_protocol_fzd_login_check_start();
+       
        return mmi_protocol_fzd_send_without_data(MMI_FZD_ACTION_LINK);
 }
 
 bool mmi_protocol_fzd_parse_LINK(unsigned char * next_buff, unsigned int next_buff_len)
 {
+       mmi_protocol_fzd_login_check_stop();
+
 #ifdef __MMI_FZD_PROTOCOL_WITHOUT_PING_COMMAND_SUPPORT__
        mmi_watch_action_after_bind();
 
index 794e9d0..b910799 100644 (file)
@@ -25,8 +25,10 @@ void tcp_connect_cb(int t)
 static void * s_tcp_first_connect_timer_id = NULL;
 static uint32_t s_tcp_first_connect_time = 0;
 
-void mmi_launcher_tcp_first_connect(uint32_t para)
+static void mmi_launcher_tcp_first_connect_check_cb(uint32_t para)
 {
+       send_task_msg_tcp_wake_up();
+       
        if((FALSE == watch_modem_sim_present_check_req())
                && (MMI_TCP_FIRST_CONNECT_TIMEOUT <= s_tcp_first_connect_time)
                )
@@ -49,18 +51,20 @@ void mmi_launcher_tcp_first_connect(uint32_t para)
                {
                        printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
 
-                       if(NULL == s_tcp_first_connect_timer_id)
+                       if(true == mmi_poweron_logo_is_finish())
                        {
-                               uos_timer_create(&s_tcp_first_connect_timer_id);
+                               s_tcp_first_connect_time += MMI_TCP_FIRST_CONNECT_TIME_INTERVAL;
                        }
-                       uos_timer_stop(s_tcp_first_connect_timer_id);
-                       uos_timer_start(s_tcp_first_connect_timer_id, MS_TO_TICKS(MMI_TCP_FIRST_CONNECT_TIME_INTERVAL), 0, mmi_launcher_tcp_first_connect, NULL);
-                       s_tcp_first_connect_time += MMI_TCP_FIRST_CONNECT_TIME_INTERVAL;
                }
                else
                {
                        printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
 
+                       if(true != mmi_poweron_logo_is_finish())
+                       {
+                               printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+                               return;
+                       }
                        if(NULL != s_tcp_first_connect_timer_id)
                        {
                                uos_timer_stop(s_tcp_first_connect_timer_id);
@@ -73,6 +77,24 @@ void mmi_launcher_tcp_first_connect(uint32_t para)
        }
 }
 
+void mmi_launcher_tcp_first_connect_check_start(void)
+{
+       printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+
+       s_tcp_first_connect_time = 0;
+       
+       if(NULL == s_tcp_first_connect_timer_id)
+               uos_timer_create(&s_tcp_first_connect_timer_id);
+       else
+               uos_timer_stop(s_tcp_first_connect_timer_id);
+       
+       uos_timer_start(s_tcp_first_connect_timer_id, 
+                                       MS_TO_TICKS(MMI_TCP_FIRST_CONNECT_TIME_INTERVAL), 
+                                       MS_TO_TICKS(MMI_TCP_FIRST_CONNECT_TIME_INTERVAL),
+                                       mmi_launcher_tcp_first_connect_check_cb,
+                                       NULL);
+}
+
 #ifdef __MMI_ZHSX_SUPPORT_AUTHENTICATE__
 #define MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL         (1000 * 5) // ms
 #define MMI_AUTHENTICATE_CONNECT_TIMEOUT               (1000 * 60 * 3) // ms
@@ -85,8 +107,10 @@ void mmi_watch_msg_authenticate(void)
        send_task_msg_authenticate_action();
 }
 
-void mmi_watch_authenticate_pre(uint32_t para)
+static void mmi_watch_authenticate_check_cb(uint32_t para)
 {
+       send_task_msg_tcp_wake_up();
+       
        if((FALSE == watch_modem_sim_present_check_req())
                && (MMI_AUTHENTICATE_CONNECT_TIMEOUT <= s_authenticate_connect_time)
                )
@@ -109,18 +133,20 @@ void mmi_watch_authenticate_pre(uint32_t para)
                {
                        printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
 
-                       if(NULL == s_authenticate_connect_timer_id)
+                       if(true == mmi_poweron_logo_is_finish())
                        {
-                               uos_timer_create(&s_authenticate_connect_timer_id);
+                               s_authenticate_connect_time += MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL;
                        }
-                       uos_timer_stop(s_authenticate_connect_timer_id);
-                       uos_timer_start(s_authenticate_connect_timer_id, MS_TO_TICKS(MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL), 0, mmi_watch_authenticate_pre, NULL);
-                       s_authenticate_connect_time += MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL;
                }
                else
                {
                        printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
 
+                       if(true != mmi_poweron_logo_is_finish())
+                       {
+                               printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+                               return;
+                       }                       
                        if(NULL != s_authenticate_connect_timer_id)
                        {
                                uos_timer_stop(s_authenticate_connect_timer_id);
@@ -132,8 +158,34 @@ void mmi_watch_authenticate_pre(uint32_t para)
                }
        }
 }
+
+static void mmi_watch_authenticate_check_start(void)
+{
+       printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+
+       s_authenticate_connect_time = 0;
+       
+       if(NULL == s_authenticate_connect_timer_id)
+               uos_timer_create(&s_authenticate_connect_timer_id);
+       else
+               uos_timer_stop(s_authenticate_connect_timer_id);
+       
+       uos_timer_start(s_authenticate_connect_timer_id, 
+                                       MS_TO_TICKS(MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL), 
+                                       MS_TO_TICKS(MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL), 
+                                       mmi_watch_authenticate_check_cb, 
+                                       NULL);
+}
 #endif
 
+void mmi_watch_tcp_wake_up_action(void)
+{
+       if(0 == Hal_Pm_Get_State())
+       {
+               Hal_Pm_WakeUp_No_Lcd();
+       }
+}
+
 #endif
 
 /**
@@ -150,14 +202,14 @@ void mmi_modem_tcp_task_init(void)
 #ifdef __MMI_ZHSX_SUPPORT_AUTHENTICATE__
        if(0 == mmi_watch_authenticate_flag_get())
        {
-               mmi_watch_authenticate_pre(0);
+               mmi_watch_authenticate_check_start();
        }
        else
        {
-               mmi_launcher_tcp_first_connect(0);
+               mmi_launcher_tcp_first_connect_check_start();
        }
 #else
-       mmi_launcher_tcp_first_connect(0);
+       mmi_launcher_tcp_first_connect_check_start();
 #endif
        
 #else
index 3bc4031..e3459b0 100644 (file)
@@ -87,7 +87,8 @@ void shutdownc_tcp_connect(FUNC_CB tcp_callback);
 void send_tcp_cmdmsg(int cmd_type,void* cmd_param);
 
 #ifdef __MMI_ZHSX_SUPPORT__
-void mmi_launcher_tcp_first_connect(uint32_t para);
+void mmi_launcher_tcp_first_connect_check_start(void);
+void mmi_watch_tcp_wake_up_action(void);
 #endif
 
 #ifdef __cplusplus
index ba01b20..d2e4b6b 100644 (file)
@@ -53,6 +53,12 @@ VOID mmi_modem_tcp_task_handle(UI_INTER_MSG_ID MsgId, UI_Inter_Msg_t * pmsg)
                        mmi_watch_authenticate_action();
                        break;
        #endif
+
+       #ifdef __MMI_ZHSX_SUPPORT__
+               case MMI_MODEM_TCP_MSG_WAKE_UP:
+                       mmi_watch_tcp_wake_up_action();
+                       break;
+       #endif
                
                default:
                        break;
@@ -175,6 +181,12 @@ void send_task_msg_authenticate_action(void)
 }
 #endif
 
+#ifdef __MMI_ZHSX_SUPPORT__
+void send_task_msg_tcp_wake_up(void)
+{
+       send_task_msg_tcp(MMI_MODEM_TCP_MSG_WAKE_UP, NULL);
+}
+#endif
 
 
 /**
index 10a54b2..de7ec96 100644 (file)
@@ -29,6 +29,9 @@ typedef enum
 #ifdef __MMI_ZHSX_SUPPORT_AUTHENTICATE__
        MMI_MODEM_TCP_MSG_AUTHENTICATE_ACTION,
 #endif
+#ifdef __MMI_ZHSX_SUPPORT__
+       MMI_MODEM_TCP_MSG_WAKE_UP,
+#endif
     
        MMI_MODEM_TCP_MSG_MAX,
     MMI_MODEM_TCP_MSG_ID_END = MMI_MODEM_TCP_MSG_MAX,
@@ -45,6 +48,9 @@ void send_task_msg_tcp_disconnect(void *param);
 #ifdef __MMI_ZHSX_SUPPORT_AUTHENTICATE__
 void send_task_msg_authenticate_action(void);
 #endif
+#ifdef __MMI_ZHSX_SUPPORT__
+void send_task_msg_tcp_wake_up(void);
+#endif
 
 void send_task_msg_tcp_write_msg(int cmd_type, void* cmd_param);