健康服务增加异常状态
authorCaisking <3449750381@qq.com>
Tue, 30 Jul 2024 11:50:57 +0000 (19:50 +0800)
committerCaisking <3449750381@qq.com>
Tue, 30 Jul 2024 11:50:57 +0000 (19:50 +0800)
code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp
code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.h

index 21acbe9..415f895 100644 (file)
@@ -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
index 3bd44d9..13fd718 100644 (file)
@@ -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