gengxin
author@CHENG <2393524978@qq.com>
Thu, 18 Jan 2024 08:49:52 +0000 (16:49 +0800)
committer@CHENG <2393524978@qq.com>
Thu, 18 Jan 2024 08:49:52 +0000 (16:49 +0800)
2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c
2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_timing_control.c
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.c
2.sdk/sdk/gui/lv_watch/lv_apps/factory_mode/factory_mode_test.c
2.sdk/sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c

index 1ad27fe..bb0c902 100644 (file)
@@ -229,13 +229,15 @@ void mmi_hsensor_bp_measure_start(void)
 #endif
 
 }
-#if USE_FR8012HAQ
+
 void mmi_hsensor_yyl_measure_start(void)
 {
     mmi_hsensor_measure_value_clear();
+#if USE_FR8012HAQ
     fr8012haq_measure_YYL_start();
-}
 #endif
+}
+
 void mmi_hsensor_measure_stop(void)
 {
 #if USE_HX3918
index 049cea1..ba3a45d 100644 (file)
@@ -46,6 +46,10 @@ static void timing_timer_callback(uint32_t param)
                mmi_watch_sleep_time_mission_check();
        #endif
 
+               // check tcms
+       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+               mmi_hengai_tcms_mission_check();
+       #endif
 
 
                
index 973aaf3..ad51f6c 100644 (file)
@@ -12,6 +12,9 @@
 #ifdef __MMI_CUSTOM_HENGAI_HEALTH__
 #include "heng_ai_blood_pressure.c"
 #include "heng_ai_http_protocol.c"
+#ifdef __MMI_CUSTOM_HENGAI_TCMS__
+#include "heng_ai_tcms.c"
+#endif
 #endif
 
 #ifdef __MMI_CUSTOM_BEI_KE_RUI_SHENG__
index eeaf038..1d4d8be 100644 (file)
@@ -26,6 +26,7 @@ extern "C" {
 #ifdef __MMI_CUSTOM_HENGAI_HEALTH__
 #include "heng_ai_blood_pressure.h"
 #include "heng_ai_http_protocol.h"
+#include "heng_ai_tcms.h"
 #endif
 
 #ifdef __MMI_CUSTOM_BEI_KE_RUI_SHENG__
index 667bb03..047ee42 100644 (file)
@@ -207,6 +207,9 @@ void mmi_heng_ai_bp_measure_screen_prepare_destory(lv_obj_t * activity_obj)
        if(mmi_hengai_bp_measuring_flag_get())
        {
                mmi_hsensor_close();
+       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+               mmi_hengai_tcms_action();
+       #endif
                mmi_hengai_bp_measuring_flag_set(false);
        }
 
@@ -455,6 +458,9 @@ void mmi_hengai_bp_measure_finish_screen(void)
        mmi_hengai_bp_raw_data_fill();
        mmi_hengai_bp_measure_action_time_string_set(0);
        mmi_hsensor_close();
+#ifdef __MMI_CUSTOM_HENGAI_TCMS__
+       mmi_hengai_tcms_action();
+#endif
        mmi_hengai_bp_measuring_flag_set(false);
 
        lv_task_t * data_send_task = lv_task_create(mmi_hengai_bp_measure_data_send_task_cb, 2000, LV_TASK_PRIO_HIGH, NULL);
@@ -466,6 +472,9 @@ void mmi_hengai_bp_measure_cycle_timeout(void * para)
        if(false == mmi_health_measure_wear_state_get())
        {
                mmi_hsensor_close();
+       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+               mmi_hengai_tcms_action();
+       #endif
                mmi_hengai_bp_measuring_flag_set(false);
                mmi_hengai_bp_measure_result_screen(3);
                
@@ -776,6 +785,9 @@ void mmi_heng_ai_bp_calibrate_screen_prepare_destory(lv_obj_t * activity_obj)
        if(mmi_hengai_bp_measuring_flag_get())
        {
                mmi_hsensor_close();
+       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+               mmi_hengai_tcms_action();
+       #endif
                mmi_hengai_bp_measuring_flag_set(false);
        }
 
@@ -1269,6 +1281,9 @@ void mmi_hengai_bp_calibrate_end_screen(void)
        mmi_hengai_bp_raw_data_fill();
        mmi_hengai_bp_measure_action_time_string_set(0);
        mmi_hsensor_close();
+#ifdef __MMI_CUSTOM_HENGAI_TCMS__
+       mmi_hengai_tcms_action();
+#endif
        mmi_hengai_bp_measuring_flag_set(false);
 
        mmi_bp_screen_common_bottom_button_create(watch_ext->cont, WATCH_TEXT_ID_IN_CALIBRATE_PROMPT_BTN, mmi_hengai_bp_calibrate_end_btn_event_cb);
@@ -1279,6 +1294,9 @@ void mmi_hengai_bp_calibrate_cycle_timeout(void * para)
        if(false == mmi_health_measure_wear_state_get())
        {
                mmi_hsensor_close();
+       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+               mmi_hengai_tcms_action();
+       #endif
                mmi_hengai_bp_measuring_flag_set(false);
                mmi_hengai_bp_calibrate_result_screen(false);
                
index 5b477d5..4ebc9ac 100644 (file)
@@ -164,11 +164,17 @@ static void factorymode_test_prepare_destory(lv_obj_t * activity_obj)
                #ifdef __MMI_HEALTH_MEASURE_HEART_SUPPORT__
                case FAC_HEART:
                        mmi_hsensor_close();
+                       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+                       mmi_hengai_tcms_action();
+                       #endif
                        break;
                
                #ifdef __MMI_HEALTH_MEASURE_SPO2_SUPPORT__
                case FAC_SPO2:
                        mmi_hsensor_close();
+                       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+                       mmi_hengai_tcms_action();
+                       #endif
                        break;
                #endif
                #endif
index 1d71487..79e8d4d 100644 (file)
@@ -26,24 +26,28 @@ void mmi_hsensor_close(void)
 void mmi_hsensor_heart_open(void)
 {
        HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+       mmi_hsensor_close();
        mmi_hsensor_hr_measure_start();
 }
 
 void mmi_hsensor_blood_open(void)
 {
        HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+       mmi_hsensor_close();
        mmi_hsensor_hr_measure_start();
 }
 
 void mmi_hsensor_spo2_open(void)
 {
        HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+       mmi_hsensor_close();
        mmi_hsensor_spo2_measure_start();
 }
 
 void mmi_hsensor_bp_open(void)
 {
        HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+       mmi_hsensor_close();
        mmi_hsensor_bp_measure_start();
 }
 
@@ -631,6 +635,9 @@ void mmi_health_measure_process_finish(void)
        {
                case MMI_HEALTH_MEASURE_HEART:
                        mmi_hsensor_close();
+                       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+                       mmi_hengai_tcms_action();
+                       #endif
                        mmi_health_measure_send_heart();
                        break;
        
@@ -641,11 +648,17 @@ void mmi_health_measure_process_finish(void)
        
                case MMI_HEALTH_MEASURE_BLOOD:
                        mmi_hsensor_close();
+                       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+                       mmi_hengai_tcms_action();
+                       #endif
                        mmi_health_measure_send_blood();
                        break;
                        
                case MMI_HEALTH_MEASURE_SPO2:
                        mmi_hsensor_close();
+                       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+                       mmi_hengai_tcms_action();
+                       #endif
                        mmi_health_measure_send_spo2();
                        break;
        
@@ -719,6 +732,9 @@ void mmi_health_measure_interrupt(void)
                case MMI_HEALTH_MEASURE_BLOOD:
                case MMI_HEALTH_MEASURE_SPO2:
                        mmi_hsensor_close();
+                       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+                       mmi_hengai_tcms_action();
+                       #endif
                        break;
        
                case MMI_HEALTH_MEASURE_TEMPERATURE:
index 73260dc..9b4e006 100644 (file)
@@ -653,6 +653,11 @@ bool mmi_protocol_fzd_parse_ACTION_BIND(unsigned char * next_buff, unsigned int
 
                        // socket heartbeat
                        mmi_protocol_watch_heartbeat_action();
+
+                       // hengai tcms  
+               #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+                       mmi_hengai_tcms_action();
+               #endif
                        
                        // timing mission
                        mmi_protocol_watch_timed_mission_action();
@@ -662,7 +667,7 @@ bool mmi_protocol_fzd_parse_ACTION_BIND(unsigned char * next_buff, unsigned int
                        mmi_protocol_fzd_action_get_vc_config();
                #endif
 
-                       // hengai
+                       // hengai sleep
                #ifdef __MMI_CUSTOM_HENG_AI__
                        mmi_hengai_sleep_activation_check_action();
                #endif
@@ -3733,6 +3738,34 @@ bool mmi_protocol_fzd_action_hengai_sleep_data_test(char * file_buf, uint32_t fi
 
 #endif
 
+#ifdef __MMI_CUSTOM_HENGAI_TCMS__
+bool mmi_protocol_fzd_action_hengai_tcms_data(char * file_buf, uint32_t file_size)
+{
+       bool result = false;
+       MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_ACTION_HENGAI_TCMS_DATA;
+       unsigned char * content_buff = NULL;
+       unsigned int content_lenth = 0;
+
+#if 0
+       content_buff = (unsigned char *)lv_mem_alloc(file_size + 2);
+       if(NULL == content_buff)
+       {
+               PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+               return false;
+       }
+       _lv_memset_00(content_buff, file_size + 2);
+       sprintf(content_buff, ",");
+       _lv_memcpy(content_buff + 1, file_buf, file_size);
+       content_lenth = file_size;
+       
+       result = mmi_protocol_fzd_send_with_data(action, content_buff, content_lenth);
+       lv_mem_free(content_buff);
+#endif
+       
+       return result;
+}
+#endif
+
 
 
 #endif
index 5ebecd5..b9311e1 100644 (file)
@@ -194,6 +194,9 @@ MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH,
 MMI_FZD_SERVER_SET_GSENSOR_DATA,
 MMI_FZD_ACTION_HENGAI_SLEEP_DATA_TEST,
 #endif
+#endif
+#ifdef __MMI_CUSTOM_HENGAI_TCMS__
+       MMI_FZD_ACTION_HENGAI_TCMS_DATA,
 #endif
        MMI_FZD_SERVER_SET_BOOTOFF,
        MMI_FZD_SEND_UP_REMIND,
@@ -344,7 +347,9 @@ bool mmi_protocol_fzd_parse_ACTION_HENGAI_ACTIVATION(unsigned char * next_buff,
 bool mmi_protocol_fzd_action_hengai_activation_feedback(void);
 bool mmi_protocol_fzd_action_hengai_sleep_data(char * file_buf, uint32_t file_size);
 #endif
-
+#ifdef __MMI_CUSTOM_HENGAI_TCMS__
+bool mmi_protocol_fzd_action_hengai_tcms_data(char * file_buf, uint32_t file_size);
+#endif
 
 #endif
 
index 01e52b0..94e83e8 100644 (file)
@@ -127,6 +127,9 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO
                        {MMI_FZD_SERVER_SET_GSENSOR_DATA, "TEST_SLEEP_SNED"},                   
                        {MMI_FZD_ACTION_HENGAI_SLEEP_DATA_TEST, "TEST_SLEEP_DATA"},                     
                        #endif
+               #endif
+               #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+                       {MMI_FZD_ACTION_HENGAI_TCMS_DATA, "CNDOCD"},                    
                #endif
                        {MMI_FZD_SERVER_SET_BOOTOFF, "BOOTOFF"},
                        {MMI_FZD_SEND_UP_REMIND, "UP_REMIND"},
@@ -441,6 +444,11 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned
                #endif
        #endif
 
+       #ifdef __MMI_CUSTOM_HENGAI_TCMS__
+               case MMI_FZD_ACTION_HENGAI_TCMS_DATA:
+                       break;
+       #endif
+
                case MMI_FZD_SERVER_SET_BOOTOFF:
                        mmi_protocol_fzd_parse_SERVER_SET_BOOTOFF(next_buff, next_buff_len);
                        break;