睡眠佩戴检测改为活体检测,频率为10分钟 1419/2
authorpenglei <1624952103@qq.com>
Mon, 18 Nov 2024 10:15:17 +0000 (18:15 +0800)
committerpenglei <1624952103@qq.com>
Mon, 18 Nov 2024 10:15:17 +0000 (18:15 +0800)
code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp
code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c
code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c

index 84e8995..66b9005 100644 (file)
@@ -538,7 +538,7 @@ extern "C"
                 // if(uapi_dev_runtime_get_nap_monitoring_status() == 1)\r
                     // uapi_clean_sleep_flag();                        // 清除睡眠标志文件\r
                 // OHOS::create_sleep_folder();                     // 创建睡眠文件夹              \r
-                set_keep_in_wear_det_mode(1);                       \r
+                set_keep_in_wear_det_mode(0);                       \r
                 do_cywee_service_check_msg(CYWEE_SERVICE_CMD_GET_SLEEP_DATA, &cmd); // 强制获取小睡数据,结束小睡\r
 \r
                 // 睡眠弹窗\r
@@ -597,9 +597,13 @@ extern "C"
 \r
     //心率周期检测\r
     void HandleHeartRateDetection(const struct tm *curTime) {\r
-      int heartRateDetectionInterval =\r
-          OHOS::ConfigModel::GetInstance()->get_configData_int(\r
-              OHOS::ConfigModel::CONFIGMODEL_ITEM_HEARTRATE_DETECTED);\r
+      int heartRateDetectionInterval = 0;\r
+\r
+      if(uapi_dev_runtime_get_sleep_monitoring_status())\r
+        heartRateDetectionInterval = 10;\r
+      else\r
+        heartRateDetectionInterval = OHOS::ConfigModel::GetInstance()->get_configData_int(OHOS::ConfigModel::CONFIGMODEL_ITEM_HEARTRATE_DETECTED);\r
+        \r
       WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Heart rate detection cycle detection is enabled %d",heartRateDetectionInterval);\r
       if (heartRateDetectionInterval) {\r
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Heart rate detection cycle detection is enabled %d",curTime->tm_min % heartRateDetectionInterval);\r
index 7d5132e..da04832 100644 (file)
@@ -2983,7 +2983,7 @@ void hx3695_hrs_ppg_Int_handle(void)
       }\r
     }\r
     //PRINT("hrsresult.wearstatus : %d , his_wear : %d , wear_cnt : %d \n",hrsresult.wearstatus,his_wear,wear_cnt);\r
-    //PRINT("hrsresult.wearstatus : %d , cywee_wear_status : %d , hr_living : %d \n",hrsresult.wearstatus,cywee_wear_status,hrsresult.hr_living);\r
+    PRINT("hrsresult.wearstatus : %d , cywee_wear_status : %d , hr_living : %d \n",hrsresult.wearstatus,cywee_wear_status,hrsresult.hr_living);\r
     // if(hrs_wear_status == MSG_HRS_WEAR && hrsresult.hr_living == MSG_LIVING_TRUE)\r
     // {\r
     //     if(hrsresult.lastesthrs > 30 && hrsresult.lastesthrs < 220)\r
index 1adbe48..82d7284 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: 2024-03-13 15:08:38
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-11-14 17:09:10
+ * @LastEditTime: 2024-11-18 18:04:37
  * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c
  * @Description: 
  * 
@@ -76,11 +76,11 @@ void ppg_send_cmd_to_driver(char* mode, uint8_t enable)
         {
 #ifdef HRS_ALG_LIB   
             hx3695_hrs_disable();
-            // if(uapi_dev_runtime_get_sleep_monitoring_status() && uapi_dev_runtime_get_hrs_passivity_flag())//处于睡眠监测 且在心率周期检测期间 上报活体佩戴 
-            // {
-            //     hx3695_wearstatus_update();   
-            //     uapi_dev_runtime_set_hrs_passivity(0);//清除被动检测runtime     
-            // }
+            if(uapi_dev_runtime_get_sleep_monitoring_status() && uapi_dev_runtime_get_hrs_passivity_flag())//处于睡眠监测 且在心率周期检测期间 上报活体佩戴 
+            {
+                hx3695_wearstatus_update();   
+                uapi_dev_runtime_set_hrs_passivity(0);//清除被动检测runtime     
+            }
 #endif
         }else  if(md == HRV_MODE)
         {