From: penglei <1624952103@qq.com> Date: Mon, 18 Nov 2024 10:15:17 +0000 (+0800) Subject: 睡眠佩戴检测改为活体检测,频率为10分钟 X-Git-Tag: fd230_release_V1.3.102~56^2~7 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1419%2F2;p=mirrors%2FFD230.git 睡眠佩戴检测改为活体检测,频率为10分钟 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index 84e899579..66b90050d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -538,7 +538,7 @@ extern "C" // if(uapi_dev_runtime_get_nap_monitoring_status() == 1) // uapi_clean_sleep_flag(); // 清除睡眠标志文件 // OHOS::create_sleep_folder(); // 创建睡眠文件夹 - set_keep_in_wear_det_mode(1); + set_keep_in_wear_det_mode(0); do_cywee_service_check_msg(CYWEE_SERVICE_CMD_GET_SLEEP_DATA, &cmd); // 强制获取小睡数据,结束小睡 // 睡眠弹窗 @@ -597,9 +597,13 @@ extern "C" //心率周期检测 void HandleHeartRateDetection(const struct tm *curTime) { - int heartRateDetectionInterval = - OHOS::ConfigModel::GetInstance()->get_configData_int( - OHOS::ConfigModel::CONFIGMODEL_ITEM_HEARTRATE_DETECTED); + int heartRateDetectionInterval = 0; + + if(uapi_dev_runtime_get_sleep_monitoring_status()) + heartRateDetectionInterval = 10; + else + heartRateDetectionInterval = OHOS::ConfigModel::GetInstance()->get_configData_int(OHOS::ConfigModel::CONFIGMODEL_ITEM_HEARTRATE_DETECTED); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Heart rate detection cycle detection is enabled %d",heartRateDetectionInterval); if (heartRateDetectionInterval) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Heart rate detection cycle detection is enabled %d",curTime->tm_min % heartRateDetectionInterval); diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index 7d5132efc..da04832f7 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -2983,7 +2983,7 @@ void hx3695_hrs_ppg_Int_handle(void) } } //PRINT("hrsresult.wearstatus : %d , his_wear : %d , wear_cnt : %d \n",hrsresult.wearstatus,his_wear,wear_cnt); - //PRINT("hrsresult.wearstatus : %d , cywee_wear_status : %d , hr_living : %d \n",hrsresult.wearstatus,cywee_wear_status,hrsresult.hr_living); + PRINT("hrsresult.wearstatus : %d , cywee_wear_status : %d , hr_living : %d \n",hrsresult.wearstatus,cywee_wear_status,hrsresult.hr_living); // if(hrs_wear_status == MSG_HRS_WEAR && hrsresult.hr_living == MSG_LIVING_TRUE) // { // if(hrsresult.lastesthrs > 30 && hrsresult.lastesthrs < 220) diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c index 1adbe4893..82d728413 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c @@ -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) {