From cba60b27202993d6742f3c3619aed3cee4200963 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Thu, 19 Dec 2024 10:58:26 +0000 Subject: [PATCH] Merge #1535 into sdk602patch0911 from refs/changes/1535/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 系统:增加心率血氧运动字符串解析 系统:增加心率血氧运动字符串解析 系统:增加消息弹窗的功耗记录 --- .../msg_center/src/msg_center_customer.cpp | 2 ++ .../peripheral/utils/custom_save_runtime.h | 5 ++++ tools/log_parser/runtimeanalysis.py | 30 +++++++++++++------ 3 files changed, 28 insertions(+), 9 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 18304240b..0ed4c27e8 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 @@ -1015,6 +1015,8 @@ void MsgCenterNotifyMessageProc(const Topic topic, Request* req) // nullptr, 0); OHOS::NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_THREE); OHOS::NotificationManager::GetInstance()->ShowNotify(OHOS::CreateMessageView, TOPIC_EVENT_MESSAGENOTE, true); + //进行消息显示记录 + uapi_save_runtime_log(RUNTIME_LOG_MSG_SHOW); } } diff --git a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h index fbc817f27..a1df48cd6 100644 --- a/code/sdk/drivers/peripheral/utils/custom_save_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_save_runtime.h @@ -211,6 +211,11 @@ typedef enum { RUNTIME_LOG_RECORD_START_AI, // 0x1103 AI录音开始 RUNTIME_LOG_RECORD_STOP_AI, // 0x1104 AI录音停止 + //消息 + RUNTIME_LOG_MSG_MIN = 0x1200, + //消息显示 + RUNTIME_LOG_MSG_SHOW, + } runtime_log_cmd_Id; errcode_t uapi_save_runtime_log(uint16_t cmd); diff --git a/tools/log_parser/runtimeanalysis.py b/tools/log_parser/runtimeanalysis.py index 4ef7b3c13..8478d425e 100644 --- a/tools/log_parser/runtimeanalysis.py +++ b/tools/log_parser/runtimeanalysis.py @@ -10,11 +10,8 @@ os.makedirs(output_dir, exist_ok=True) # 定义输出文件的完整路径 output_file_path = os.path.join(output_dir, "runtimeout.txt") -# 定义默认的输入文件路径 -default_txtname = "default_input.txt" # 请将此处的文件名替换为你的默认输入文件名 - # 从命令行参数中获取输入文件名称,如果没有提供则使用默认文件 -txtname = sys.argv[-1] if len(sys.argv) > 1 else default_txtname +txtname = sys.argv[-1] # 字符串与其对应的消息的映射 str_bin_list = [ @@ -39,7 +36,22 @@ str_bin_list = [ ['1101', "录音开始 "], ['1102', "录音停止 "], ['1103', "AI录音开始 "], - ['1104', "AI录音停止 "] + ['1104', "AI录音停止 "], + ['0401',"手表发起运动"], + ['0402',"app发起运动"], + ['0403',"开始特殊运动"], + ['0404',"开始普通运动"], + ['0405',"停止运动"], + ['0406',"恢复运动"], + ['0407',"运动结束"], + ['0501',"主动检测心率"], + ['0502',"主动检测心率结束"], + ['0503',"被动检测心率"], + ['0504',"被动检测心率结束"], + ['0701',"主动检测血氧"], + ['0702',"主动检测血氧结束"], + ['1201',"消息弹窗显示"] + ] # 打开输出文件以写入 @@ -59,10 +71,10 @@ with open(output_file_path, "w+") as f_out: if l[0] == data_1_bin: f_out.write(l[1]) found = True - break - - if not found: - f_out.write(data_1_bin) # 如果没有找到对应的字符串,则写入二进制字符串 + break + + f_out.write(' ') + f_out.write(data_1_bin) # 如果没有找到对应的字符串,则写入二进制字符串 f_out.write(' ') f_out.write(data_2_bin) f_out.write('\n') -- 2.17.1