From: @CHENG <2393524978@qq.com> Date: Mon, 14 Oct 2024 08:08:43 +0000 (+0800) Subject: k18 send sleep data format X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=ea390b3feb3e68700297fc0de03b8eafb90fea3f;p=mirrors%2FASR3603_Z5.git k18 send sleep data format --- 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 b541a448..f13545fa 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 @@ -40,7 +40,7 @@ static bool mmi_hengai_sleep_data_send(void) temp_count = 0; temp_ptr += temp_count; - sprintf(temp_ptr, "%d-%d-%d %d:%d,%d-%d-%d %d:%d,%d,%d", + 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, @@ -71,6 +71,30 @@ static bool mmi_hengai_sleep_data_send(void) } } +#if 0 +void __test_hengai_sleep_data_send(void) +{ + 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; + + 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; + + mmi_hengai_sleep_data_send(); +} +#endif + static void mmi_hengai_sleep_data_get(void) { sleep_time_t curtime = {0}; 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 eb137f90..0a055fcf 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 @@ -4006,7 +4006,7 @@ bool mmi_protocol_fzd_action_sleep_data(char * data_ptr, uint32_t data_len) _lv_memset_00(content_buff, data_len + 2); sprintf(content_buff, ","); _lv_memcpy(content_buff + 1, data_ptr, data_len); - content_lenth = data_len; + content_lenth = strlen(content_buff); result = mmi_protocol_fzd_send_with_data(action, content_buff, content_lenth); lv_mem_free(content_buff);