}
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__);
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]);
+ }
}
}
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]);
+ }
}
}
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]);
+ }
}
}