gengxin
author@CHENG <2393524978@qq.com>
Mon, 8 Apr 2024 07:22:11 +0000 (15:22 +0800)
committer@CHENG <2393524978@qq.com>
Mon, 8 Apr 2024 07:22:11 +0000 (15:22 +0800)
2.sdk/sdk/gui/lv_drivers/indev/FR8012HAQ/fr8012haq.c
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c

index 4940e53..ab39c0b 100644 (file)
@@ -1333,25 +1333,37 @@ void FR8012HAQ_result_set_heart_rate(unsigned char heart_rate)
 }
 void FR8012HAQ_result_set_wear_status(unsigned char wear_status)
 {
+       if(BP_MODE == FR8012HAQ_run_mode) // bp_mode not check wear
+       {
+               //printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+               return;
+       }
+       
     //static char wear_tmp = 0;
     if(wear_status == 0 && s_FR8012HAQ_wear_status == 1)//佩戴变未佩戴
     {
         FR8012HAQ_LOG("s_FR8012HAQ_wear_status111:wear_status%d,s_FR8012HAQ_wear_status%d !!!!!!!!!!!!!!!!!\n\n\n",wear_status,s_FR8012HAQ_wear_status);
         s_FR8012HAQ_wear_status = 0;
         fr8012haq_measure_wear_start();//开始佩戴模式
+               //printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
     }else if(wear_status == 1 && s_FR8012HAQ_wear_status == 0)//未佩戴变佩戴
     {
                s_FR8012HAQ_wear_status = 1;
         //fr8012haq_timer_cfg(TRUE);//恢复定时器
 
                mmi_hengai_tcms_action();
+               //printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
     }
        //printf("[@CHENG_DEBUG][%s][%d]: wear=%d,s_wear=%d\n", __FUNCTION__, __LINE__, wear_status, s_FR8012HAQ_wear_status);
    FR8012HAQ_LOG("s_FR8012HAQ_wear_status:%d !!!!!!!!!!!!!!!!!\n\n\n",s_FR8012HAQ_wear_status);
 }
 unsigned char FR8012HAQ_result_get_wear_status(void)
 {
-       if((0 == s_FR8012HAQ_wear_status) && (WEAR_MODE != FR8012HAQ_run_mode))
+       //printf("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, FR8012HAQ_run_mode);
+       if((0 == s_FR8012HAQ_wear_status) && (WEAR_MODE != FR8012HAQ_run_mode)
+               && (FACTORY_MODE != FR8012HAQ_run_mode) // factory_mode not check wear
+               && (BP_MODE != FR8012HAQ_run_mode) // bp_mode not check wear
+               )
        {
                fr8012haq_measure_wear_start();
                //printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
index 110ba4b..9effbde 100644 (file)
@@ -208,15 +208,22 @@ void mmi_hengai_tcp_bp_back_measure_raw_data_send(void)
        int * temp_int_ptr = mmi_hengai_bp_raw_data_ptr_get();
        int temp_int_len = mmi_hengai_bp_raw_data_len_get();
        temp_len += sprintf(json_data + temp_len, "\"pulse_wave\":[");
-       for(i = 0; i < temp_int_len; i++)
+       if(0 == temp_int_len)
        {
-               if(i == (temp_int_len - 1))
-               {
-                       temp_len += sprintf(json_data + temp_len, "%d],", temp_int_ptr[i]);
-               }
-               else
+               temp_len += sprintf(json_data + temp_len, "],");
+       }
+       else
+       {
+               for(i = 0; i < temp_int_len; i++)
                {
-                       temp_len += sprintf(json_data + temp_len, "%d,", temp_int_ptr[i]);
+                       if(i == (temp_int_len - 1))
+                       {
+                               temp_len += sprintf(json_data + temp_len, "%d],", temp_int_ptr[i]);
+                       }
+                       else
+                       {
+                               temp_len += sprintf(json_data + temp_len, "%d,", temp_int_ptr[i]);
+                       }
                }
        }
        
@@ -495,15 +502,22 @@ void mmi_hengai_tcp_bp_measure_raw_data_send(void)
        int * temp_int_ptr = mmi_hengai_bp_raw_data_ptr_get();
        int temp_int_len = mmi_hengai_bp_raw_data_len_get();
        temp_len += sprintf(json_data + temp_len, "\"pulse_wave\":[");
-       for(i = 0; i < temp_int_len; i++)
+       if(0 == temp_int_len)
        {
-               if(i == (temp_int_len - 1))
-               {
-                       temp_len += sprintf(json_data + temp_len, "%d],", temp_int_ptr[i]);
-               }
-               else
+               temp_len += sprintf(json_data + temp_len, "],");
+       }
+       else
+       {
+               for(i = 0; i < temp_int_len; i++)
                {
-                       temp_len += sprintf(json_data + temp_len, "%d,", temp_int_ptr[i]);
+                       if(i == (temp_int_len - 1))
+                       {
+                               temp_len += sprintf(json_data + temp_len, "%d],", temp_int_ptr[i]);
+                       }
+                       else
+                       {
+                               temp_len += sprintf(json_data + temp_len, "%d,", temp_int_ptr[i]);
+                       }
                }
        }
        
@@ -761,15 +775,22 @@ void mmi_hengai_tcp_bp_calibrate_raw_data_send(uint8_t calibrate_times, uint16_t
        int * temp_int_ptr = mmi_hengai_bp_raw_data_ptr_get();
        int temp_int_len = mmi_hengai_bp_raw_data_len_get();
        temp_len += sprintf(json_data + temp_len, "\"pulse_wave\":[");
-       for(i = 0; i < temp_int_len; i++)
+       if(0 == temp_int_len)
        {
-               if(i == (temp_int_len - 1))
-               {
-                       temp_len += sprintf(json_data + temp_len, "%d],", temp_int_ptr[i]);
-               }
-               else
+               temp_len += sprintf(json_data + temp_len, "],");
+       }
+       else
+       {
+               for(i = 0; i < temp_int_len; i++)
                {
-                       temp_len += sprintf(json_data + temp_len, "%d,", temp_int_ptr[i]);
+                       if(i == (temp_int_len - 1))
+                       {
+                               temp_len += sprintf(json_data + temp_len, "%d],", temp_int_ptr[i]);
+                       }
+                       else
+                       {
+                               temp_len += sprintf(json_data + temp_len, "%d,", temp_int_ptr[i]);
+                       }
                }
        }