return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "To few values of HRM event");
}
- LoggerD("|- values[0]: %f", event->values[0]);
- LoggerD("|- values[1]: %f", event->values[1]);
+ LoggerD("|- values[0][HR ]: %f", event->values[0]);
+ LoggerD("|- values[1][RRI]: %f", event->values[1]);
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<double>(hr))));
data->insert(std::make_pair("rRInterval", picojson::value(static_cast<double>(rri))));