From: @CHENG <2393524978@qq.com> Date: Mon, 21 Oct 2024 03:17:58 +0000 (+0800) Subject: k18 sleep X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=60b9abbafbd86f22810af075624f046c4c45815d;p=mirrors%2FASR3603_Z5.git k18 sleep --- diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c index 4de4ebfd..e6e2608e 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c @@ -1323,6 +1323,7 @@ static void mmi_hengai_tcp_algorithm_login_cb(uint32_t para) void mmi_hengai_tcp_algorithm_login_action(void) { HENGAI_HEALTH_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + if(NULL == s_delay_timer_id) { uos_timer_create(&s_delay_timer_id); @@ -2521,7 +2522,7 @@ void mmi_hengai_bp_calibrated_time_get(hal_rtc_t * time_ptr) void mmi_hengai_health_sleep_activated_flag_set(uint8_t flag) { s_hengai_health_data.is_sleep_activated = flag; - mmi_hengai_health_data_nv_write(); +// mmi_hengai_health_data_nv_write(); } uint8_t mmi_hengai_health_sleep_activated_flag_get(void) diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.c index f13545fa..b2a1c001 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.c @@ -16,11 +16,154 @@ static gsensor_data_t s_hengai_sleep_gsensor_data[HENGAI_SLEEP_GSENSOR_DATA_MAX] static uint32_t s_hengai_sleep_gsensor_counter = 0; static sleep_data_t s_hengai_sdata = {0}; +static bool s_sleep_data_in_same_cycle = false; +static void mmi_hengai_sleep_data_get(void); static void mmi_hengai_gsensor_data_get(uint32_t para); -static bool mmi_hengai_sleep_data_send(void) + +#ifdef __hengai_sleep_test__ +static uint8_t s_gsensor_upload_switch = 1; // 0; // 0-off; 1-on +static char s_gsensor_buff_send[45000] = {0}; // 3000 * 3 * (4 + 1) + +#define HENGAI_SLEEP_RESULT_FILE "C:/hengai_sleep_result.txt" + + +void mmi_hengai_k18_gsensor_upload_action(void) +{ + if(0 == s_gsensor_upload_switch) + return; + + _lv_memset_00(s_gsensor_buff_send, sizeof(s_gsensor_buff_send)); + + char * temp_ptr = s_gsensor_buff_send; + uint32_t counter = 0; + uint32_t index = 0; + for(index = 0; index < (HENGAI_SLEEP_GSENSOR_DATA_MAX / 3); index++) + { + temp_ptr += counter; + sprintf(temp_ptr, "%d,%d,%d,%d,%d,%d,%d,%d,%d,", + s_hengai_sleep_gsensor_data[index].x, + s_hengai_sleep_gsensor_data[index].y, + s_hengai_sleep_gsensor_data[index].z, + s_hengai_sleep_gsensor_data[index + 1].x, + s_hengai_sleep_gsensor_data[index + 1].y, + s_hengai_sleep_gsensor_data[index + 1].z, + s_hengai_sleep_gsensor_data[index + 2].x, + s_hengai_sleep_gsensor_data[index + 2].y, + s_hengai_sleep_gsensor_data[index + 2].z); + counter = strlen(temp_ptr); + } + + mmi_protocol_fzd_action_hengai_gsensor_data(s_gsensor_buff_send, strlen(s_gsensor_buff_send)); +} + +void mmi_heng_ai_gsensor_upload_switch_set(uint8_t value) +{ + s_gsensor_upload_switch = value; +} + +static void mmi_hengai_data_save_to_file(char * path, void * data_buf, uint32_t data_size) +{ + lv_fs_file_t file_p; + lv_fs_res_t res; + uint32_t bytes_write = 0; + + res = lv_fs_open(&file_p, path, LV_FS_MODE_WR | LV_FS_MODE_APPEND); + if(LV_FS_RES_OK != res) + { + printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res); + lv_fs_close(&file_p); + return false; + } + + res = lv_fs_write(&file_p, data_buf, data_size, &bytes_write); + lv_fs_close(&file_p); + if(LV_FS_RES_OK != res) + { + printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res); + return false; + } + printf("[@CHENG_DEBUG][%s][%d]: file_size=%d,write_size=%d\n", __FUNCTION__, __LINE__, data_size, bytes_write); + + return true; +} + +static void mmi_hengai_sleep_result_save(sleep_time_t * curtime, int result) +{ + char * temp_buff = NULL; + uint32_t buff_size = 64; + + temp_buff = lv_mem_alloc(buff_size + 1); + if(NULL == temp_buff) + { + printf("[@CHENG_DEBUG][%s][%d]: memory alloc failed\n", __FUNCTION__, __LINE__); + return; + } + _lv_memset_00(temp_buff, buff_size + 1); + + sprintf(temp_buff, "%d-%d-%d %d:%d.%d\n", + curtime->year, + curtime->month, + curtime->day, + curtime->hour, + curtime->minute, + result); + + mmi_hengai_data_save_to_file(HENGAI_SLEEP_RESULT_FILE, temp_buff, strlen(temp_buff)); + + if(NULL != temp_buff) + { + lv_mem_free(temp_buff); + temp_buff = NULL; + } +} + +bool mmi_hengai_sleep_result_send(void) +{ + char * file_buf = NULL; + uint32_t file_size = 0; + lv_fs_file_t file_p; + lv_fs_res_t res; + uint32_t bytes_read = 0; + + res = lv_fs_open(&file_p, HENGAI_SLEEP_RESULT_FILE, LV_FS_MODE_RD); + if(LV_FS_RES_OK != res) + { + printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res); + goto exit_free_res; + } + + lv_fs_size(&file_p, &file_size); + file_buf = (char *)lv_mem_alloc(file_size + 1); + if(NULL == file_buf) + { + printf("[@CHENG_DEBUG][%s][%d]: memory alloce fail\n", __FUNCTION__, __LINE__); + goto exit_free_res; + } + _lv_memset_00(file_buf, file_size + 1); + res = lv_fs_read(&file_p, file_buf, file_size, &bytes_read); + if(LV_FS_RES_OK != res) + { + printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res); + goto exit_free_res; + } + printf("[@CHENG_DEBUG][%s][%d]: file_size=%d,bytes_read=%d,file_buf=%p\n", __FUNCTION__, __LINE__, file_size, bytes_read, file_buf); + + mmi_protocol_fzd_action_hengai_sleep_data_test(file_buf, file_size); + + +exit_free_res: + lv_fs_close(&file_p); + if(NULL != file_buf) + { + lv_mem_free(file_buf); + file_buf = NULL; + } +} + +bool mmi_hengai_k18_sleep_data_test_send(void) { char * temp_buff = NULL; uint32_t buff_size = sizeof(sleep_data_t); @@ -36,11 +179,10 @@ static bool mmi_hengai_sleep_data_send(void) } _lv_memset_00(temp_buff, buff_size + 1); - temp_ptr = temp_buff; temp_count = 0; - - temp_ptr += temp_count; - sprintf(temp_ptr, "%04d-%02d-%02d %02d:%02d,%04d-%02d-%02d %02d:%02d,%d,%d", + temp_ptr = temp_buff + temp_count; + sprintf(temp_ptr, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", + s_hengai_sdata.total_sleep_time, s_hengai_sdata.begin_sleep_time.year, s_hengai_sdata.begin_sleep_time.month, s_hengai_sdata.begin_sleep_time.day, @@ -50,19 +192,21 @@ static bool mmi_hengai_sleep_data_send(void) s_hengai_sdata.end_sleep_time.month, s_hengai_sdata.end_sleep_time.day, s_hengai_sdata.end_sleep_time.hour, - s_hengai_sdata.end_sleep_time.minute, - s_hengai_sdata.total_sleep_time, - s_hengai_sdata.state_count); + s_hengai_sdata.end_sleep_time.minute); + temp_count = strlen(temp_ptr); + + temp_ptr += temp_count; + sprintf(temp_ptr, ",%d", s_hengai_sdata.state_count); temp_count = strlen(temp_ptr); for(i = 0; i < s_hengai_sdata.state_count; i++) { temp_ptr += temp_count; - sprintf(temp_ptr, ",%d,%d", s_hengai_sdata.data[i].state, s_hengai_sdata.data[i].duration); + sprintf(temp_ptr, ",%d,%d", s_hengai_sdata.data[i].duration, s_hengai_sdata.data[i].state); temp_count = strlen(temp_ptr); } - mmi_protocol_fzd_action_sleep_data(temp_buff, strlen(temp_buff)); + mmi_protocol_fzd_action_hengai_sleep_data_test(temp_buff, strlen(temp_buff)); if(NULL != temp_buff) { @@ -71,54 +215,135 @@ static bool mmi_hengai_sleep_data_send(void) } } -#if 0 -void __test_hengai_sleep_data_send(void) +#ifdef __hengai_sleep_test_server_gsensor_data__ +static uint32_t __sleep_gsensor_counter = 0; +void __gsensor_data_set(unsigned char * next_buff, unsigned int next_buff_len) { - s_hengai_sdata.begin_sleep_time.year = 2024, - s_hengai_sdata.begin_sleep_time.month = 10, - s_hengai_sdata.begin_sleep_time.day = 13, - s_hengai_sdata.begin_sleep_time.hour = 22, - s_hengai_sdata.begin_sleep_time.minute = 50, - s_hengai_sdata.end_sleep_time.year = 2024, - s_hengai_sdata.end_sleep_time.month = 10, - s_hengai_sdata.end_sleep_time.day = 14, - s_hengai_sdata.end_sleep_time.hour = 6, - s_hengai_sdata.end_sleep_time.minute = 10, - s_hengai_sdata.total_sleep_time = 500, - s_hengai_sdata.state_count = 3; + // 300 set datas per 3 seconds + uint32_t index = 0; + char * temp_ptr = NULL; + uint32_t i = 0; + + for(i = 0; i < 300; i++) + { + index = __sleep_gsensor_counter + i; - s_hengai_sdata.data[0].state = 11, s_hengai_sdata.data[0].duration = 10, - s_hengai_sdata.data[1].state = 12, s_hengai_sdata.data[1].duration = 50, - s_hengai_sdata.data[2].state = 2, s_hengai_sdata.data[2].duration = 90; + temp_ptr = km_strtok_r(NULL, ",", &next_buff); + s_hengai_sleep_gsensor_data[index].x = atoi(temp_ptr); - mmi_hengai_sleep_data_send(); + temp_ptr = km_strtok_r(NULL, ",", &next_buff); + s_hengai_sleep_gsensor_data[index].y = atoi(temp_ptr); + + temp_ptr = km_strtok_r(NULL, ",", &next_buff); + s_hengai_sleep_gsensor_data[index].z = atoi(temp_ptr); + } + + __sleep_gsensor_counter += 300; + printf("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, __sleep_gsensor_counter); + if(HENGAI_SLEEP_GSENSOR_DATA_MAX <= __sleep_gsensor_counter) + { + printf("[@CHENG_DEBUG][%d]: %d,%d,%d,%d,%d,%d\n", __LINE__, + s_hengai_sleep_gsensor_data[0].x, + s_hengai_sleep_gsensor_data[0].y, + s_hengai_sleep_gsensor_data[0].z, + s_hengai_sleep_gsensor_data[1].x, + s_hengai_sleep_gsensor_data[1].y, + s_hengai_sleep_gsensor_data[1].z + ); + + __sleep_gsensor_counter = 0; + mmi_hengai_sleep_data_get(); + } } +#else +void __gsensor_data_set(unsigned char * next_buff, unsigned int next_buff_len) +{} +#endif #endif -static void mmi_hengai_sleep_data_get(void) + +static bool mmi_hengai_sleep_data_send(void) { - sleep_time_t curtime = {0}; - hal_rtc_t cur_time = {0}; + char * temp_buff = NULL; + uint32_t buff_size = sizeof(sleep_data_t); + char * temp_ptr = NULL; + uint32_t temp_count = 0; + uint8_t i = 0; + + temp_buff = lv_mem_alloc(buff_size + 128); + if(NULL == temp_buff) + { + printf("[@CHENG_DEBUG][%s][%d]: memory alloc failed\n", __FUNCTION__, __LINE__); + return; + } + _lv_memset_00(temp_buff, buff_size + 128); + + temp_ptr = temp_buff; + temp_count = 0; - Hal_Rtc_Gettime(&cur_time); - curtime.year = cur_time.tm_year; - curtime.month = cur_time.tm_mon; - curtime.day = cur_time.tm_mday; - curtime.hour = cur_time.tm_hour; - curtime.minute = cur_time.tm_min; + temp_ptr += temp_count; + sprintf(temp_ptr, "%04d-%02d-%02d %02d:%02d,%04d-%02d-%02d %02d:%02d,%d,%d", + s_hengai_sdata.begin_sleep_time.year, + s_hengai_sdata.begin_sleep_time.month, + s_hengai_sdata.begin_sleep_time.day, + s_hengai_sdata.begin_sleep_time.hour, + s_hengai_sdata.begin_sleep_time.minute, + s_hengai_sdata.end_sleep_time.year, + s_hengai_sdata.end_sleep_time.month, + s_hengai_sdata.end_sleep_time.day, + s_hengai_sdata.end_sleep_time.hour, + s_hengai_sdata.end_sleep_time.minute, + s_hengai_sdata.total_sleep_time, + s_hengai_sdata.state_count); + temp_count = strlen(temp_ptr); + + for(i = 0; i < s_hengai_sdata.state_count; i++) + { + temp_ptr += temp_count; + sprintf(temp_ptr, ",%d,%d", s_hengai_sdata.data[i].state, s_hengai_sdata.data[i].duration); + temp_count = strlen(temp_ptr); + } + + mmi_protocol_fzd_action_sleep_data(temp_buff, strlen(temp_buff)); - int result = 0; - result = get_sleep_time(s_hengai_sleep_gsensor_data, HENGAI_SLEEP_GSENSOR_DATA_MAX, curtime, &s_hengai_sdata); - printf("[@CHENG_DEBUG][%s][%d]: result=%d\n", __FUNCTION__, __LINE__, result); - UART_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: result=%d\n", __FUNCTION__, __LINE__, result); - if(1 == result) + if(NULL != temp_buff) { - mmi_hengai_sleep_data_send(); - mmi_hengai_sleep_data_set(&s_hengai_sdata); + lv_mem_free(temp_buff); + temp_buff = NULL; } - else if(-1 == result) +} + +static void mmi_hengai_sleep_data_get(void) +{ + //if(0 != mmi_hsensor_measure_get_wear_status()) { - mmi_hengai_health_sleep_lib_active(); + sleep_time_t curtime = {0}; + hal_rtc_t cur_time = {0}; + + Hal_Rtc_Gettime(&cur_time); + curtime.year = cur_time.tm_year; + curtime.month = cur_time.tm_mon; + curtime.day = cur_time.tm_mday; + curtime.hour = cur_time.tm_hour; + curtime.minute = cur_time.tm_min; + + int result = 0; + result = get_sleep_time(s_hengai_sleep_gsensor_data, HENGAI_SLEEP_GSENSOR_DATA_MAX, curtime, &s_hengai_sdata); + printf("[@CHENG_DEBUG][%s][%d]: result=%d\n", __FUNCTION__, __LINE__, result); + UART_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: result=%d\n", __FUNCTION__, __LINE__, result); + if(1 == result) + { + mmi_hengai_sleep_data_send(); + mmi_hengai_sleep_data_set(&s_hengai_sdata); + } + else if(-1 == result) + { + mmi_hengai_health_sleep_lib_active(); + } + #ifdef __hengai_sleep_test__ + mmi_hengai_k18_sleep_data_test_send(); + mmi_hengai_sleep_result_save(&curtime, result); + #endif } _lv_memset_00(s_hengai_sleep_gsensor_data, sizeof(s_hengai_sleep_gsensor_data)); @@ -127,6 +352,10 @@ static void mmi_hengai_sleep_data_get(void) static void mmi_hengai_gsensor_data_get(uint32_t para) { +#ifdef __hengai_sleep_test_server_gsensor_data__ + return; +#endif + int16_t t_mems_data[32 * 3] = {0}; uint8_t i = 0; @@ -138,6 +367,17 @@ static void mmi_hengai_gsensor_data_get(uint32_t para) s_hengai_sleep_gsensor_data[index].x = *(t_mems_data + i*3); s_hengai_sleep_gsensor_data[index].y = *(t_mems_data + i*3 + 1); s_hengai_sleep_gsensor_data[index].z = *(t_mems_data + i*3 + 2); + + if(0 != index + && 0 == s_hengai_sleep_gsensor_data[index].x + && 0 == s_hengai_sleep_gsensor_data[index].y + && 0 == s_hengai_sleep_gsensor_data[index].z + ) + { + s_hengai_sleep_gsensor_data[index].x = s_hengai_sleep_gsensor_data[index - 1].x; + s_hengai_sleep_gsensor_data[index].y = s_hengai_sleep_gsensor_data[index - 1].y; + s_hengai_sleep_gsensor_data[index].z = s_hengai_sleep_gsensor_data[index - 1].z; + } } s_hengai_sleep_gsensor_counter++; @@ -145,6 +385,9 @@ static void mmi_hengai_gsensor_data_get(uint32_t para) { uos_timer_stop(s_hengai_sleep_gsensor_timer_id); s_hengai_sleep_gsensor_counter = 0; + #ifdef __hengai_sleep_test__ + mmi_hengai_k18_gsensor_upload_action(); + #endif mmi_hengai_sleep_data_get(); } else @@ -156,6 +399,10 @@ static void mmi_hengai_gsensor_data_get(uint32_t para) void mmi_hengai_get_sleep_data_start(void) { +#ifdef __hengai_sleep_test_server_gsensor_data__ + return; +#endif + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); UART_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); @@ -175,6 +422,10 @@ void mmi_hengai_get_sleep_data_start(void) void mmi_hengai_get_sleep_data_stop(void) { +#ifdef __hengai_sleep_test_server_gsensor_data__ + return; +#endif + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); if(NULL != s_hengai_sleep_gsensor_timer_id) @@ -183,28 +434,11 @@ void mmi_hengai_get_sleep_data_stop(void) uos_timer_delete(s_hengai_sleep_gsensor_timer_id); } + s_sleep_data_in_same_cycle = false; s_hengai_sleep_gsensor_counter = 0; _lv_memset_00(s_hengai_sleep_gsensor_data, sizeof(s_hengai_sleep_gsensor_data)); } -/* -static unsigned char s_sleep_req_code[128 + 1] = {0}; -static char * mmi_hengai_health_sleep_req_code_get(void) -{ - if(0 == strlen(s_sleep_req_code)) - { - char imei[16 + 1] = {0}; - app_adp_get_imei_req(imei); - - unsigned int* req_len = 0; - //UART_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); - request_validation((unsigned char *)"ZHSX", 4, (unsigned char *)imei, strlen(imei), (unsigned char *)s_sleep_req_code, &req_len); - } - - return s_sleep_req_code; -} -*/ - void mmi_hengai_health_sleep_lib_active(void) { char * req_code = mmi_hengai_health_lib_req_code_get(); @@ -229,7 +463,7 @@ void mmi_hengai_health_sleep_lib_active(void) } -#if 10 // ui +#if 1 // ui static uint8_t s_hengai_sleep_data_init = 0; static nv_watch_hengai_sleep_data_t s_hengai_sleep_data = {0}; @@ -256,11 +490,30 @@ void mmi_hengai_sleep_data_nv_read(void) void mmi_hengai_sleep_data_set(nv_watch_hengai_sleep_data_t * data) { - if(NULL != data) + if(NULL == data) + return; + + if(false == s_sleep_data_in_same_cycle) { + s_sleep_data_in_same_cycle = true; _lv_memcpy(&s_hengai_sleep_data, data, sizeof(nv_watch_hengai_sleep_data_t)); - mmi_hengai_sleep_data_nv_write(); } + else + { + s_hengai_sleep_data.total_sleep_time += data->total_sleep_time; + _lv_memcpy(&(s_hengai_sleep_data.end_sleep_time), &(data->end_sleep_time), sizeof(nv_sleep_time_t)); + + if(NV_MAX_SLEEP_STATE > s_hengai_sleep_data.state_count) + { + uint8_t count = s_hengai_sleep_data.state_count; + s_hengai_sleep_data.state_count += data->state_count; + if(NV_MAX_SLEEP_STATE < s_hengai_sleep_data.state_count) + s_hengai_sleep_data.state_count = NV_MAX_SLEEP_STATE; + + _lv_memcpy(s_hengai_sleep_data.data + count, data->data, sizeof(nv_sleep_detail_data_t) * (s_hengai_sleep_data.state_count - count)); + } + } + mmi_hengai_sleep_data_nv_write(); } @@ -429,7 +682,8 @@ static lv_obj_t * mmi_sleep_info_create(lv_obj_t * tileview, uint16_t id) } else { - snprintf(temp_buf, 128, "%02d%s %02d%s", + //snprintf(temp_buf, 128, "%02d%s %02d%s", + snprintf(temp_buf, 128, "%d%s %d%s", s_hengai_sleep_data.total_sleep_time / 60, lv_lang_get_text(WATCH_TEXT_ID_ACT_HOUR), s_hengai_sleep_data.total_sleep_time % 60, diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c index c705a351..7046a749 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c @@ -3715,8 +3715,9 @@ bool mmi_protocol_fzd_action_hengai_sleep_data(char * file_buf, uint32_t file_si return result; } +#endif -#if 0 +#ifdef __hengai_sleep_test__ bool mmi_protocol_fzd_action_hengai_gsensor_data(char * file_buf, uint32_t file_size) { bool result = false; @@ -3814,7 +3815,6 @@ bool mmi_protocol_fzd_action_hengai_sleep_data_test(char * file_buf, uint32_t fi #endif -#endif #ifdef __MMI_CUSTOM_HENGAI_TCMS__ bool mmi_protocol_fzd_parse_SERVER_SET_HENGAI_TCMS_SWITCH(unsigned char * next_buff, unsigned int next_buff_len) diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h index 41f9f9fd..79fa0929 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h @@ -196,12 +196,12 @@ typedef enum #endif #if defined(__MMI_CUSTOM_HENGAI_SLEEP__) MMI_FZD_ACTION_HENGAI_SLEEP_DATA, -#if 0 -MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD, -MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH, -MMI_FZD_SERVER_SET_GSENSOR_DATA, -MMI_FZD_ACTION_HENGAI_SLEEP_DATA_TEST, #endif +#ifdef __hengai_sleep_test__ + MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD, + MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH, + MMI_FZD_SERVER_SET_GSENSOR_DATA, + MMI_FZD_ACTION_HENGAI_SLEEP_DATA_TEST, #endif #ifdef __MMI_CUSTOM_HENGAI_TCMS__ MMI_FZD_SERVER_SET_HENGAI_TCMS_SWITCH, diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c index 4339d90c..852e90cc 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c @@ -128,13 +128,12 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO #endif #if defined(__MMI_CUSTOM_HENGAI_SLEEP__) {MMI_FZD_ACTION_HENGAI_SLEEP_DATA, "HENGAI_SLEEP_DATA"}, - - #if 0 + #endif + #ifdef __hengai_sleep_test__ {MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD, "TEST_SLEEP_UPLOAD"}, {MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH, "TEST_SLEEP_CONTROL"}, {MMI_FZD_SERVER_SET_GSENSOR_DATA, "TEST_SLEEP_SNED"}, - {MMI_FZD_ACTION_HENGAI_SLEEP_DATA_TEST, "TEST_SLEEP_DATA"}, - #endif + {MMI_FZD_ACTION_HENGAI_SLEEP_DATA_TEST, "TEST_SLEEP_DATA"}, #endif #ifdef __MMI_CUSTOM_HENGAI_TCMS__ {MMI_FZD_SERVER_SET_HENGAI_TCMS_SWITCH, "TRIGGER_CNDOCD"}, @@ -453,8 +452,9 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned #if defined(__MMI_CUSTOM_HENGAI_SLEEP__) case MMI_FZD_ACTION_HENGAI_SLEEP_DATA: break; - - #if 0 + #endif + + #ifdef __hengai_sleep_test__ case MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD: break; case MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH: @@ -465,7 +465,6 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned break; case MMI_FZD_ACTION_HENGAI_SLEEP_DATA_TEST: break; - #endif #endif #ifdef __MMI_CUSTOM_HENGAI_TCMS__