Interface PolarOfflineRecordingApi
-
- All Implemented Interfaces:
public interface PolarOfflineRecordingApiOffline recording API.
Offline recording makes it possible to record PolarBleApi.PolarDeviceDataType data to device memory. With Offline recording the Polar device and phone don't need to be connected all the time, as offline recording continues in Polar device even the BLE disconnects.
Offline records saved into the device can be encrypted. The PolarRecordingSecret is provided for startOfflineRecording and setOfflineRecordingTrigger when encryption is wanted. The PolarRecordingSecret with same key must be provided in getOfflineRecord to correctly decrypt the data in the device.
Requires features FEATURE_POLAR_OFFLINE_RECORDING
Note, offline recording is supported in Polar Verity Sense device (starting from firmware version 2.1.0)
-
-
Method Summary
Modifier and Type Method Description abstract Set<PolarBleApi.PolarDeviceDataType>getAvailableOfflineRecordingDataTypes(String identifier)Get the data types available in this device for offline recording. abstract PolarSensorSettingrequestOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)Request the offline recording settings available in current operation mode. abstract PolarSensorSettingrequestFullOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)Request all the settings available in the device. abstract List<PolarBleApi.PolarDeviceDataType>getOfflineRecordingStatus(String identifier)Get current offline recording status. abstract Flow<PolarOfflineRecordingEntry>listOfflineRecordings(String identifier)List offline recordings stored in the device. abstract PolarOfflineRecordingDatagetOfflineRecord(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)Fetch recording from the Polar device. abstract Flow<PolarOfflineRecordingResult>getOfflineRecordWithProgress(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)Fetch recording from the Polar device with progress tracking. abstract Flow<PolarOfflineRecordingEntry>listSplitOfflineRecordings(String identifier)Lists all parts of all offline recordings (split and non-split) stored in the device. abstract PolarOfflineRecordingDatagetSplitOfflineRecord(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)Fetch split recording from the Polar device. abstract UnitremoveOfflineRecord(String identifier, PolarOfflineRecordingEntry entry)Removes offline recording from the device. abstract UnitstartOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature, PolarSensorSetting settings, PolarRecordingSecret secret)Start offline recording. abstract UnitstopOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature)Request to stop offline recording. abstract UnitsetOfflineRecordingTrigger(String identifier, PolarOfflineRecordingTrigger trigger, PolarRecordingSecret secret)Sets the offline recording triggers for a given Polar device. abstract PolarOfflineRecordingTriggergetOfflineRecordingTriggerSetup(String identifier)Retrieves the current offline recording trigger setup in the device. -
-
Method Detail
-
getAvailableOfflineRecordingDataTypes
abstract Set<PolarBleApi.PolarDeviceDataType> getAvailableOfflineRecordingDataTypes(String identifier)
Get the data types available in this device for offline recording. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt address- Returns:
the set of available offline recording data types in this device
-
requestOfflineRecordingSettings
abstract PolarSensorSetting requestOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request the offline recording settings available in current operation mode. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING This request shall be used before the offline recording is started to decide currently available settings. The available settings depend on the state of the device.
- Parameters:
identifier- polar device id or bt addressfeature- the stream feature of interest- Returns:
PolarSensorSetting with the settings available in current device state for the requested stream feature. The available settings depend on the state of the device and may be empty if no settings are currently available for the requested stream feature.
-
requestFullOfflineRecordingSettings
abstract PolarSensorSetting requestFullOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request all the settings available in the device. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING The request returns the all capabilities of the requested streaming feature not limited by the current operation mode.
- Parameters:
identifier- polar device id or bt addressfeature- the stream feature of interest- Returns:
PolarSensorSetting with the settings available in current device state for the requested stream feature. The available settings depend on the state of the device and may be empty if no settings are currently available for the requested stream feature.
-
getOfflineRecordingStatus
abstract List<PolarBleApi.PolarDeviceDataType> getOfflineRecordingStatus(String identifier)
Get current offline recording status. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
- Parameters:
identifier- polar device id or bt address- Returns:
the list of currently recording offline recordings, if the list is empty no offline recordings currently recorded
-
listOfflineRecordings
abstract Flow<PolarOfflineRecordingEntry> listOfflineRecordings(String identifier)
List offline recordings stored in the device. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt address- Returns:
Flow stream of found offline recording entries in PolarOfflineRecordingEntry
-
getOfflineRecord
abstract PolarOfflineRecordingData getOfflineRecord(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)
Fetch recording from the Polar device. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
Note, the fetching of the recording may take several seconds if the recording is big. Note, if a faulty data block is encountered while parsing offline data from device that particular data block will be discarded. This will lead to gaps in the data.
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt addressentry- The offline recording to be fetchedsecret- If the secret is provided in startOfflineRecording or setOfflineRecordingTrigger then the same secret must be provided when fetching the offline record- Returns:
the offline recording data
-
getOfflineRecordWithProgress
abstract Flow<PolarOfflineRecordingResult> getOfflineRecordWithProgress(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)
Fetch recording from the Polar device with progress tracking. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
Note, the fetching of the recording may take several seconds if the recording is big. Note, if a faulty data block is encountered while parsing offline data from device that particular data block will be discarded. This will lead to gaps in the data. This method provides progress updates during the download.
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt addressentry- The offline recording to be fetchedsecret- If the secret is provided in startOfflineRecording or setOfflineRecordingTrigger then the same secret must be provided when fetching the offline record- Returns:
Flow stream of PolarOfflineRecordingResult
-
listSplitOfflineRecordings
@Deprecated(message = "Use listOfflineRecordings instead") abstract Flow<PolarOfflineRecordingEntry> listSplitOfflineRecordings(String identifier)
Lists all parts of all offline recordings (split and non-split) stored in the device. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
-
getSplitOfflineRecord
@Deprecated(message = "Use getOfflineRecordWithProgress method instead") abstract PolarOfflineRecordingData getSplitOfflineRecord(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)
Fetch split recording from the Polar device. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
Note, the fetching of the recording may take several seconds if the recording is big. Note, if a faulty data block is encountered while parsing offline data from device that particular data block will be discarded. This will lead to gaps in the data.
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt addressentry- The offline recording to be fetchedsecret- If the secret is provided in startOfflineRecording or setOfflineRecordingTrigger then the same secret must be provided when fetching the offline record- Returns:
Success or error
-
removeOfflineRecord
abstract Unit removeOfflineRecord(String identifier, PolarOfflineRecordingEntry entry)
Removes offline recording from the device. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
-
startOfflineRecording
abstract Unit startOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature, PolarSensorSetting settings, PolarRecordingSecret secret)
Start offline recording. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt addressfeature- the feature to be startedsettings- settings for the started offline recording.secret- if the secret is provided the offline recordings are encrypted in device- Returns:
Success or error.
-
stopOfflineRecording
abstract Unit stopOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request to stop offline recording. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
- Parameters:
identifier- polar device idfeature- which is stopped- Returns:
Success or error.
-
setOfflineRecordingTrigger
abstract Unit setOfflineRecordingTrigger(String identifier, PolarOfflineRecordingTrigger trigger, PolarRecordingSecret secret)
Sets the offline recording triggers for a given Polar device. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING The offline recording can be started automatically in the device by setting the triggers. The changes to the trigger settings will take effect on the next device startup.
Automatically started offline recording can be stopped by stopOfflineRecording. Also if user switches off the device power, the offline recording is stopped but starts again once power is switched on and the trigger event happens.
Trigger functionality can be disabled by setting PolarOfflineRecordingTriggerMode.TRIGGER_DISABLED, the already running offline recording is not stopped by disable.
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt addresstrigger- the type of triggersecret- if the secret is provided the offline recordings are encrypted in device- Returns:
Success or error.
-
getOfflineRecordingTriggerSetup
abstract PolarOfflineRecordingTrigger getOfflineRecordingTriggerSetup(String identifier)
Retrieves the current offline recording trigger setup in the device. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_OFFLINE_RECORDING
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt address- Returns:
PolarOfflineRecordingTrigger, the current offline recording trigger setup in the device
-
-
-
-