From: Caisking <3449750381@qq.com> Date: Tue, 14 Jan 2025 09:05:38 +0000 (+0800) Subject: 心率:修复了心率血氧结构体的数据读取 X-Git-Tag: v1.3.113-repair_tp~21^2~11 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1629%2Fhead;p=mirrors%2FFD230.git 心率:修复了心率血氧结构体的数据读取 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp index bf84199c2..1e924908a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp @@ -651,7 +651,7 @@ std::string HealthService::get_heart_data() { // 将数据格式化为字符串,拼接到结果中 result << formatTime(data.timestamp) << "," << std::to_string(data.Heart) << "\n"; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "get_heart_data %d %d", + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get_heart_data %d %d", data.timestamp, data.Heart); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.h b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.h index 6c4fe38b0..9028f3933 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.h +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.h @@ -31,13 +31,13 @@ namespace OHOS #pragma pack(push, 1) // 设置对齐为1字节 typedef struct { - uint8_t SPO2; // 血氧值 uint32_t timestamp; // 最近一次检测时间 + uint8_t SPO2; // 血氧值 } BloodOxygenData; typedef struct { - uint8_t Heart; // 心率值 uint32_t timestamp; // 最近一次检测时间 + uint8_t Heart; // 心率值 } HeartRateData; #pragma pack(pop) // 恢复默认对齐 // 检查类