Interface PolarOfflineRecordingApi
-
- All Implemented Interfaces:
public interface PolarOfflineRecordingApi
Offline 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 Single<Set<PolarBleApi.PolarDeviceDataType>>
getAvailableOfflineRecordingDataTypes(String identifier)
Get the data types available in this device for offline recording abstract Single<PolarSensorSetting>
requestOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request the offline recording settings available in current operation mode. abstract Single<PolarSensorSetting>
requestFullOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request all the settings available in the device. abstract Single<List<PolarBleApi.PolarDeviceDataType>>
getOfflineRecordingStatus(String identifier)
Get current offline recording status. abstract Flowable<PolarOfflineRecordingEntry>
listOfflineRecordings(String identifier)
List offline recordings stored in the device. abstract Single<PolarOfflineRecordingData>
getOfflineRecord(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)
Fetch recording from the Polar device. abstract Flowable<PolarOfflineRecordingEntry>
listSplitOfflineRecordings(String identifier)
List split offline recordings stored in the device. abstract Single<PolarOfflineRecordingData>
getSplitOfflineRecord(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)
Fetch split recording from the Polar device. abstract Completable
removeOfflineRecord(String identifier, PolarOfflineRecordingEntry entry)
Removes offline recording from the device abstract Completable
startOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature, PolarSensorSetting settings, PolarRecordingSecret secret)
Start offline recording. abstract Completable
stopOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request to stop offline recording. abstract Completable
setOfflineRecordingTrigger(String identifier, PolarOfflineRecordingTrigger trigger, PolarRecordingSecret secret)
Sets the offline recording triggers for a given Polar device. abstract Single<PolarOfflineRecordingTrigger>
getOfflineRecordingTriggerSetup(String identifier)
Retrieves the current offline recording trigger setup in the device. -
-
Method Detail
-
getAvailableOfflineRecordingDataTypes
abstract Single<Set<PolarBleApi.PolarDeviceDataType>> getAvailableOfflineRecordingDataTypes(String identifier)
Get the data types available in this device for offline recording
- Parameters:
identifier
- Polar device id found printed on the sensor/device or bt address- Returns:
Single Produces: <BR></BR> - onSuccess the set of available offline recording data types in this device <BR></BR> - onError status request failed
-
requestOfflineRecordingSettings
abstract Single<PolarSensorSetting> requestOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request the offline recording settings available in current operation mode. 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:
Single stream
-
requestFullOfflineRecordingSettings
abstract Single<PolarSensorSetting> requestFullOfflineRecordingSettings(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request all the settings available in the device. 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:
Single stream
-
getOfflineRecordingStatus
abstract Single<List<PolarBleApi.PolarDeviceDataType>> getOfflineRecordingStatus(String identifier)
Get current offline recording status.
- Parameters:
identifier
- polar device id or bt address- Returns:
Single Produces: <BR></BR> - onSuccess the list of currently recording offline recordings, if the list is empty no offline recordings currently recorded <BR></BR> - onError status request failed
-
listOfflineRecordings
abstract Flowable<PolarOfflineRecordingEntry> listOfflineRecordings(String identifier)
List offline recordings stored in the device.
- Parameters:
identifier
- Polar device id found printed on the sensor/device or bt address- Returns:
Flowable stream <BR></BR> - onNext the found offline recording entry in PolarOfflineRecordingEntry <BR></BR> - onComplete the listing completed <BR></BR> - onError listing request failed
-
getOfflineRecord
abstract Single<PolarOfflineRecordingData> getOfflineRecord(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)
Fetch recording from the Polar device.
Note, the fetching of the recording may take several seconds if the recording is big.
- 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:
Single Produces: <BR></BR> - onSuccess the offline recording data <BR></BR> - onError fetch recording request failed
-
listSplitOfflineRecordings
abstract Flowable<PolarOfflineRecordingEntry> listSplitOfflineRecordings(String identifier)
List split offline recordings stored in the device.
- Parameters:
identifier
- Polar device id found printed on the sensor/device or bt address- Returns:
Flowable stream <BR></BR> - onNext the found offline recording entry in PolarOfflineRecordingEntry <BR></BR> - onComplete the listing completed <BR></BR> - onError listing request failed
-
getSplitOfflineRecord
abstract Single<PolarOfflineRecordingData> getSplitOfflineRecord(String identifier, PolarOfflineRecordingEntry entry, PolarRecordingSecret secret)
Fetch split recording from the Polar device.
Note, the fetching of the recording may take several seconds if the recording is big.
- 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:
Single Produces: <BR></BR> - onSuccess the offline recording data <BR></BR> - onError fetch recording request failed
-
removeOfflineRecord
abstract Completable removeOfflineRecord(String identifier, PolarOfflineRecordingEntry entry)
Removes offline recording from the device
- Parameters:
identifier
- Polar device id found printed on the sensor/device or bt addressentry
- entry to be removed- Returns:
Completable Produces: <BR></BR> - onComplete offline record is removed <BR></BR> - onError offline record removal failed
-
startOfflineRecording
abstract Completable startOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature, PolarSensorSetting settings, PolarRecordingSecret secret)
Start 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:
Completable Produces: <BR></BR> - onComplete offline recording is started successfully <BR></BR> - onError offline recording start failed.
-
stopOfflineRecording
abstract Completable stopOfflineRecording(String identifier, PolarBleApi.PolarDeviceDataType feature)
Request to stop offline recording.
- Parameters:
identifier
- polar device idfeature
- which is stopped- Returns:
Completable Produces: <BR></BR> - onComplete offline recording is stop successfully <BR></BR> - onError offline recording stop failed.
-
setOfflineRecordingTrigger
abstract Completable setOfflineRecordingTrigger(String identifier, PolarOfflineRecordingTrigger trigger, PolarRecordingSecret secret)
Sets the offline recording triggers for a given Polar device. 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 deviceProduces: <BR></BR> - onComplete offline recording trigger set successfully <BR></BR> - onError offline recording trigger set failed.
-
getOfflineRecordingTriggerSetup
abstract Single<PolarOfflineRecordingTrigger> getOfflineRecordingTriggerSetup(String identifier)
Retrieves the current offline recording trigger setup in the device.
- Parameters:
identifier
- Polar device id found printed on the sensor/device or bt addressProduces: <BR></BR> - onSuccess the offline recording trigger setup in the device <BR></BR> - onError fetch recording request failed
-
-
-
-