From ea494adae495a0a36193e389f59bd53c170cb559 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BD=AD=E7=A3=8A?= <1624952103@qq.com> Date: Thu, 29 Aug 2024 03:32:00 +0000 Subject: [PATCH] Merge #820 into sdk602patch0626 from refs/changes/820/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 优化睡眠状态时间戳计算 * refs/changes/820/head: (1 commits squashed) - 优化睡眠状态时间戳计算 Signed-off-by: aliyun6865282430 <1624952103@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/820 --- .../service/msg_center/src/msg_center_customer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 2cd458c82..3ee6db719 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -1205,9 +1205,9 @@ void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyInactivityProc !"); //unused(topic); #ifdef FD230 + uint32_t timestamp = 0; if(day_timestamp == 0) { - uint32_t timestamp = 0; time_t rawtime; struct tm* timeinfo; time(&rawtime); @@ -1274,7 +1274,11 @@ void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) { sleep_data.sleep_status[state_num].timestamp = day_timestamp + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; sleep_data.sleep_status[state_num].stat = cywee_Inactivity_Info->status; - + if(sleep_data.sleep_status[state_num].stat == 6 || sleep_data.sleep_status[state_num].stat == 13) + { + uapi_get_timestampe_ss(×tamp); + sleep_data.sleep_status[state_num].timestamp = timestamp; + } if(sleep_data.sleep_status[state_num].stat == 0) //0进入睡眠 1潜睡 2深睡 3清醒 4结束睡眠 6入睡 7出睡最后一笔输出 8未出睡最后一笔输出 12快速动眼 13取消入睡 { sleep_data.fall_asleep_timestamp = sleep_data.sleep_status[state_num].timestamp; -- 2.17.1