Skip to content

06.RealTime data

Kilnn edited this page Jun 29, 2023 · 2 revisions

Health data

sample project: Refer to HealthRealtimeFragment.kt

The device supports multiple real-time data measurement, but its effectiveness depends on whether the device has this functional module. Such as if FcDeviceInfo.Feature.HEART_RATE is supported, the device supports real-time heart rate measurement.

Use FcDataFeature.openHealthRealTimeData to start measure health data. You can enable multiple types of measurements simultaneously, like this:

val dataFeature = connector.dataFeature()
dataFeature.openHealthRealTimeData(FcHealthDataType.HEART_RATE or FcHealthDataType.OXYGEN, 1).subscribe {
    //result
}

The measurement can't start when syncing data, and you should stop measure ASAP, such as stop when Fragment onPause.

Measurement results may contain invalid data values. If the heart rate measurement is started, the return value may be 0, so you need to filter out the invalid data.

Heart Rate

Only FcHealthDataResult.hartRate greater than 0 are considered as a valid heart rate value.

Oxygen

Only FcHealthDataResult.oxygen greater than 0 are considered as a valid oxygen value.

Blood Pressure

When FcDeviceInfo.Feature.BLOOD_PRESSURE_AIR_PUMP is support, the measurement time is determined by the device, and you should not display the measurement time, which may result in inaccurate time. And the actual measurement value is only returned at the end, and only FcHealthDataResult.systolicPressure has a value in the measurement, representing the value of the air pump.

Temperature

The actual temperature may be 0, but due to the limitation of the device, we still think that it is only valid when the temperature is not equal to 0. And FcHealthDataResult.temperatureBody only returns valid values after the measurement is completed, otherwise it is 0. And when measure the temperature, an additional FcTemperatureRealTimeException may be thrown

Pressure

Only FcHealthDataResult.pressure greater than 0 are considered as a valid pressure value.

ECG

sample project: Refer to EcgRealtimeHelper.kt

When FcDeviceInfo.Feature.ECG is supported, use FcDataFeature.openEcgRealTimeData to start measure ecg data

Clone this wiki locally