From 9acb235d0ea732dda1dc80de145224fa090af494 Mon Sep 17 00:00:00 2001 From: Rafal Walczyna Date: Wed, 16 May 2018 14:29:03 +0200 Subject: [PATCH] [humanactivitymonitor] Fixing rRinterval value in heartRate data rRinterval was always 0. This value is now available, but measurement is not present in unified builds. It was tested on R765 and R600 with solis binaries and it worked fine. [verification] AutoTCT - 100% pass Change-Id: I3c181c53e0832f429774f86277bcaeda4708c0b7 Signed-off-by: Rafal Walczyna --- src/humanactivitymonitor/humanactivitymonitor_manager.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/humanactivitymonitor/humanactivitymonitor_manager.cc b/src/humanactivitymonitor/humanactivitymonitor_manager.cc index 22d52b5..9a52f2f 100644 --- a/src/humanactivitymonitor/humanactivitymonitor_manager.cc +++ b/src/humanactivitymonitor/humanactivitymonitor_manager.cc @@ -1371,15 +1371,18 @@ HumanActivityMonitorManager::HumanActivityMonitorManager() return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "To few values of HRM event"); } - LOGGER(DEBUG) << " |- values[0]: " << event->values[0]; - LOGGER(DEBUG) << " |- values[1]: " << event->values[1]; + LOGGER(DEBUG) << " |- values[0][HR ]: " << event->values[0]; + LOGGER(DEBUG) << " |- values[2][RRI]: " << event->values[2]; float hr = floor(event->values[0] + 0.5); // heart beat rate 0 ~ 220 integer (bpm) - // there are no public native api for peak to peak interval. + // there are no public native api documentation for peak to peak interval. // but RRI = (60 / HR) * 1000 - // or unofficially values[1] is rri (0 ~ 5000 ms) - float rri = floor(event->values[1] + 0.5); + // @ 18.05.2018 + // in capi, rri is in values[2], but it is not documented because value can be unstable + // and it is not available on all devices. On solis it works fine. + + float rri = floor(event->values[2] + 0.5); // rr-interval 0 ~ 5000 integer (ms) data->insert(std::make_pair("heartRate", picojson::value(static_cast(hr)))); data->insert(std::make_pair("rRInterval", picojson::value(static_cast(rri)))); -- 2.7.4