Skip to content

05.Sync Data

Kilnn edited this page Jun 24, 2023 · 12 revisions

The function of sync data refers to obtaining the data of each functional module from the device. This is also the main capability of the device.

Use FcDataFeature.syncData to sync data from device, like this:

val dataFeature = fcSDK.connector.dataFeature()
dataFeature.syncData().observeOn(Schedulers.io(), true).subscribe({
    when (it.type) {
        FcSyncDataType.STEP -> {
            val data = it.toStep()//the step data
        }
        FcSyncDataType.OXYGEN -> {
            val data = it.toOxygen()
        }
        FcSyncDataType.OXYGEN_MEASURE -> {
            val data = it.toOxygenMeasure()
        }
        ...
    }
}, {
    //error
})

Sync Data Type

Base

Devices may contain multiple types of data, but not all devices support them. Use FcDeviceInfo.Feature to determine whether the device supports these types of data, as shown below:

Name Flag Type
Step All supported FcSyncDataType.STEP
Sleep All supported FcSyncDataType.SLEEP
Heart Rate Feature.HEART_RATE FcSyncDataType.HEART_RATE
Oxygen Feature.OXYGEN FcSyncDataType.OXYGEN
Blood Pressure Feature.BLOOD_PRESSURE FcSyncDataType.BLOOD_PRESSURE
Temperature Feature.TEMPERATURE FcSyncDataType.TEMPERATURE
Pressure Feature.PRESSURE FcSyncDataType.PRESSURE
Sport Feature.SPORT FcSyncDataType.SPORT
ECG Feature.ECG FcSyncDataType.ECG
Game Feature.GAME FcSyncDataType.GAME
GPS Feature.GPS FcSyncDataType.GPS

Among them, Heart Rate, Oxygen, Blood Pressure, Temperature and Pressure are collectively referred to as Health data. These types of data are affected by FcHealthMonitorConfig, and APP can use FcDataFeature.openHealthRealTimeData to measure real-time data. Similarly, real-time data measurement can also be performed on the device. These data generated one device are of the following types:

Module Flag Type
Heart Rate Feature.HEART_RATE FcSyncDataType.HEART_RATE
Oxygen Feature.OXYGEN FcSyncDataType.OXYGEN
Blood Pressure Feature.BLOOD_PRESSURE FcSyncDataType.BLOOD_PRESSURE
Temperature Feature.TEMPERATURE FcSyncDataType.TEMPERATURE
Pressure Feature.PRESSURE FcSyncDataType.PRESSURE

|Heart Rate|Feature.HEART_RATE|FcSyncDataType.HEART_RATE|

Sports SyncDataParser#TYPE_SPORT Total data for today SyncDataParser#TYPE_TOTAL_DATA ECG SyncDataParser#TYPE_ECG SyncDataParser#TYPE_TEMPERATURE

Clone this wiki locally