From: Caisking <3449750381@qq.com> Date: Tue, 30 Jul 2024 11:50:57 +0000 (+0800) Subject: 健康服务增加异常状态 X-Git-Tag: release_V1.2.70_20241020_135402~730^2~7 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=754440a7ad814bb9b9c54cced8291b5d53403862;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 21acbe923..415f895ca 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 @@ -376,4 +376,13 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CleanHealthData is ok"); return true; } + + HealthState HealthService::GetHealthCurrent() + { + return healthState_; + } + void HealthService::SetHealthCurrent(HealthState healthState) + { + healthState_ = healthState; + } } \ No newline at end of file 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 3bd44d945..13fd71823 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 @@ -1,21 +1,10 @@ -/*** - * @Date: 2024-06-14 11:34:19 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-07-09 16:25:59 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.h - */ /*** * @Date: 2024-06-14 11:34:19 * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-06-28 19:49:27 + * @LastEditTime: 2024-07-30 17:45:59 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.h */ -/*** - * @Date: 2024-06-14 11:34:19 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-06-24 16:08:36 - * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.h - */ + #ifndef HEART_SERVICE_H #define HEART_SERVICE_H @@ -64,6 +53,28 @@ namespace OHOS uint32_t timestamp; // 最近一次检测时间 } HeartRateData; + // 检查类 + typedef enum + { + BLOOD_CHECK, + HEART_CHECK + } CheckClass; + + // 检查结果 + typedef enum + { + HIGH, + LOW + } CheckResult; + + // 健康状态 + typedef struct + { + CheckClass checkType; // 检查类型 + CheckResult resultStatus; // 结果状态 + uint16_t checkResult; // 检查结果 + } HealthState; + class HealthService { public: @@ -79,6 +90,12 @@ namespace OHOS void ReleaseJsonData(uint8_t type); // 释放json bool UpdateJsonData(uint8_t type); // 更新json bool CleanHealthData(); + + HealthState GetHealthCurrent(); + void SetHealthCurrent(HealthState healthState); + + private: + HealthState healthState_; }; } #endif // HEALTH_MODEL_H \ No newline at end of file