gengxin
author@HU <1224667075@qq.com>
Mon, 8 Jan 2024 11:36:44 +0000 (19:36 +0800)
committer1 <1>
Tue, 9 Jan 2024 02:55:05 +0000 (10:55 +0800)
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.c
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.h
2.sdk/sdk/gui/lv_watch/lv_apps/primary_menu/primary_menu.c
2.sdk/sdk/gui/lv_watch/lv_watch.c
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c

index 53f8c28..08396cc 100644 (file)
@@ -412,7 +412,9 @@ void mmi_hengai_bp_calibrate_raw_data_send(uint8_t calibrate_times, uint16_t bp_
 
        temp_len += sprintf(post_data + temp_len, "\"sbp\":%d,", bp_value_high);
 
-       temp_len += sprintf(post_data + temp_len, "\"dbp\":%d}", bp_value_low);
+       temp_len += sprintf(post_data + temp_len, "\"dbp\":%d,", bp_value_low);
+
+       temp_len += sprintf(post_data + temp_len, "\"category\":%d}", calibrate_times);
 
 #endif
 
index 5ce3825..ad9089b 100644 (file)
@@ -40,11 +40,80 @@ static mmi_remind_screen_info_t s_remind_info[] =
        { MMI_REMIND_TYPE_MAX, 0, NULL, NULL},
 };
 
+#ifdef __MMI_REMIND_take_off_SUPPORT__
+
+static void * take_off_remind_timer = NULL;
+static bool take_on_or_off;
+
+static void mmi_sedentary_remind_trigger(uint32_t para);
+
+void mmi_take_off_remind_timer_stop(void)
+{
+       if(NULL != take_off_remind_timer)
+       {
+               uos_timer_stop(take_off_remind_timer);
+               take_off_remind_timer=NULL;
+
+       }
+}
+
+static void mmi_take_off_remind_trigger(uint32_t para)
+{
+       
+       if(true != mmi_health_measure_wear_state_get() && take_on_or_off==true)
+       {
+               watch_wakeup_lcd(true);
+               mmi_protocol_action_take_off();
+               printf("test_take_off %d or %d \n",mmi_health_measure_wear_state_get(),take_on_or_off);
+               take_on_or_off=false;
+       }
+       else if(true == mmi_health_measure_wear_state_get() && take_on_or_off!=true)
+       {
+               watch_wakeup_lcd(true);
+               //mmi_protocol_action_take_on();
+               //printf("test_take_off %d or %d \n",mmi_health_measure_wear_state_get(),take_on_or_off);
+               take_on_or_off=true;
+       }
+       
+       printf("test_take_off________1111 %d or %d \n",mmi_health_measure_wear_state_get(),take_on_or_off);
+       mmi_take_off_remind_timer_start();
+}
+
+
+
+void mmi_take_off_remind_timer_start(void)
+{
+       //take_on_or_off=mmi_health_measure_wear_state_get();
+       if(NULL != take_off_remind_timer)
+               uos_timer_stop(take_off_remind_timer);
+       else
+               uos_timer_create(&take_off_remind_timer);
+       uos_timer_start(take_off_remind_timer, MS_TO_TICKS(1 * 60 * 1000), 0, mmi_take_off_remind_trigger, NULL);
+}
+
+void mmi_take_off_remind_init(void)
+{
+       
+       if(mmi_take_off_switch_get())
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: nv write fail\n", __FUNCTION__, __LINE__);
+       take_on_or_off=mmi_health_measure_wear_state_get();
+       mmi_take_off_remind_timer_start();
+               
+       }
+       
+}
+
+
+
+#endif
+
 
 
 #ifdef __MMI_REMIND_WAKE_UP_SUPPORT__
 static nv_watch_remind_item_t s_remind_wake_up_data = {0};
 
+
 void mmi_remind_wake_up_nv_write(void)
 {
        uint32_t nv_data_length = sizeof(nv_watch_remind_item_t);
index dd21b82..296ff96 100644 (file)
@@ -88,6 +88,25 @@ void mmi_remind_screen_active(void);
 void mmi_remind_mission_check(hal_rtc_t cur_time);
 void mmi_remind_data_init(void);
 
+#ifdef __MMI_REMIND_take_off_SUPPORT__
+
+void mmi_take_off_remind_timer_stop(void);
+
+
+static void mmi_take_off_remind_trigger(uint32_t para);
+
+
+void mmi_take_off_remind_timer_start(void);
+
+
+void mmi_take_off_remind_init(void);
+
+
+#endif
+
+
+
+
 
 #endif
 
index 92ac5c8..f457ece 100644 (file)
@@ -350,11 +350,13 @@ static lv_obj_t * mmi_main_menu_style_list_display(lv_obj_t * tab)
                lv_label_set_long_mode(label, LV_LABEL_LONG_SROLL);
                #ifdef USE_LV_WATCH_UI_466_466
                lv_obj_set_width(label, lv_obj_get_width(btn) - 100);
+               lv_label_set_text_id(label, s_main_menu_list[i].txtId);
+               lv_obj_align(label, img, LV_ALIGN_OUT_RIGHT_MID, 15, 0);
                #else // USE_LV_WATCH_UI_240_240
                lv_obj_set_width(label, lv_obj_get_width(btn) - 70);
-               #endif
                lv_label_set_text_id(label, s_main_menu_list[i].txtId);
                lv_obj_align(label, img, LV_ALIGN_OUT_RIGHT_MID, 10, 0);
+               #endif
        #endif
        }
 
index 47b89c5..b086ae4 100644 (file)
@@ -569,6 +569,10 @@ static lv_obj_t * watch_create(bool silentReset)
 #ifdef __MMI_ZHSX_SUPPORT__
        mmi_data_init_after_watch_create();
 #endif
+#ifdef __MMI_REMIND_WAKE_UP_take_off_SUPPORT__
+printf("123456789");
+    mmi_take_off_remind_init();
+#endif
 
     return obj;
 }
index 77250de..73260dc 100644 (file)
@@ -3065,6 +3065,18 @@ bool mmi_protocol_fzd_parse_SERVER_SET_TAKE_OFF_SWITCH(unsigned char * next_buff
        uint32_t value = atoi(next_buff);
        mmi_take_off_switch_set(value);
        
+       #ifdef __MMI_REMIND_take_off_SUPPORT__
+       if(value)
+       {
+               mmi_take_off_remind_init();
+       }
+       else
+       {
+               mmi_take_off_remind_timer_stop();
+       }
+       #endif
+       
+       
        return result;
 }
 
index ceeb076..01e52b0 100644 (file)
@@ -363,10 +363,11 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned
                case MMI_FZD_SERVER_SET_FALL_DOWN_SWITCH:
                        mmi_protocol_fzd_parse_SERVER_SET_FALL_DOWN_SWITCH(next_buff, next_buff_len);
                        break;
-
+       #ifdef __MMI_REMIND_take_off_SUPPORT__
                case MMI_FZD_SERVER_SET_TAKE_OFF_SWITCH:
                        mmi_protocol_fzd_parse_SERVER_SET_TAKE_OFF_SWITCH(next_buff, next_buff_len);
                        break;
+       #endif
                        
        #ifdef __MMI_REMIND_WAKE_UP_SUPPORT__
                case MMI_FZD_SERVER_SET_REMIND_WAKE_UP: