Class PolarBleApi
-
- All Implemented Interfaces:
-
com.polar.sdk.api.PolarActivityApi,com.polar.sdk.api.PolarBleLowLevelApi,com.polar.sdk.api.PolarDeviceToHostNotificationsApi,com.polar.sdk.api.PolarFirmwareUpdateApi,com.polar.sdk.api.PolarH10OfflineExerciseApi,com.polar.sdk.api.PolarOfflineRecordingApi,com.polar.sdk.api.PolarOnlineStreamingApi,com.polar.sdk.api.PolarRestServiceApi,com.polar.sdk.api.PolarSdkModeApi,com.polar.sdk.api.PolarSleepApi,com.polar.sdk.api.PolarTemperatureApi,com.polar.sdk.api.PolarTestApi,com.polar.sdk.api.PolarTrainingSessionApi
public abstract class PolarBleApi implements PolarOnlineStreamingApi, PolarOfflineRecordingApi, PolarH10OfflineExerciseApi, PolarSdkModeApi, PolarFirmwareUpdateApi, PolarActivityApi, PolarSleepApi, PolarRestServiceApi, PolarTemperatureApi, PolarTrainingSessionApi, PolarBleLowLevelApi, PolarDeviceToHostNotificationsApi, PolarTestApi
Polar BLE API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumPolarBleApi.PolarBleSdkFeatureFeatures available in Polar BLE SDK library
public enumPolarBleApi.PolarStoredDataTypeThe data types in Polar devices that are available for cleanup.
public interfacePolarBleApi.PolarBleApiLoggerLogger interface for logging events from SDK. Shall be used only for tracing and debugging purposes.
public enumPolarBleApi.PolarDeviceDataTypeThe data types available in Polar devices for online streaming or offline recording.
public enumPolarBleApi.PolarActivityDataTypeThe activity recording data types available in Polar devices.
-
Field Summary
Fields Modifier and Type Field Description private final Set<PolarBleApi.PolarBleSdkFeature>features
-
Constructor Summary
Constructors Constructor Description PolarBleApi(Set<PolarBleApi.PolarBleSdkFeature> features)
-
Method Summary
Modifier and Type Method Description final Set<PolarBleApi.PolarBleSdkFeature>getFeatures()the set of the features API is used for. abstract UnitsetMtu(@IntRange(from = 70, to = 512) Integer mtu)set mtu to lower than default (232 is the default for polar devices, minimum for H10 is 70 and for OH1 is 140) to minimize latency abstract UnitshutDown()Releases the SDK resources. abstract Unitcleanup()removes all known devices which are not in use currently abstract UnitsetPolarFilter(Boolean enable)When enabled only Polar devices are found by the searchForDevice, if set to false any BLE devices with HR services are returned by the searchForDevice. abstract BooleanisFeatureReady(String deviceId, PolarBleApi.PolarBleSdkFeature feature)Check if the feature is ready. abstract UnitforegroundEntered()Optionally call when application enters to the foreground. abstract UnitsetApiCallback(PolarBleApiCallbackProvider callback)Sets the API callback abstract UnitsetApiLogger(PolarBleApi.PolarBleApiLogger logger)Sets the API logger abstract Flow<PolarDeviceInfo>searchForDevice()Starts searching for BLE devices when subscribed. abstract Flow<PolarDeviceInfo>searchForDevice(String withDeviceNameFilterPrefix)Starts searching for BLE devices when subscribed. abstract UnitsetAutomaticReconnection(Boolean enable)When enabled the reconnection is attempted if device connection is lost. abstract UnitautoConnectToDevice(Integer rssiLimit, String service, Integer timeout, TimeUnit unit, String polarDeviceType)Start connecting to a nearby Polar device. abstract UnitautoConnectToDevice(Integer rssiLimit, String service, String polarDeviceType)Start connecting to a nearby Polar device. abstract StringgetDeviceName(String deviceId)Fetch device BLE name from BLE session. abstract UnitconnectToDevice(String identifier)Request a connection to a BLE device. abstract UnitdisconnectFromDevice(String identifier)Request disconnecting from a BLE device. abstract UnitsetLocalTime(String identifier, LocalDateTime dateAndTime)Set the device time. abstract LocalDateTimegetLocalTime(String identifier)Get current time in device. abstract ZonedDateTimegetLocalTimeWithZone(String identifier)Get current time and timezone from device. abstract Flow<PolarHrBroadcastData>startListenForPolarHrBroadcasts(Set<String> deviceIds)Start listening the heart rate from Polar devices when subscribed. abstract ByteArraygetFile(String identifier, String path)Get file as ByteArray from device. abstract PolarDiskSpaceDatagetDiskSpace(String identifier)Get PolarDiskSpaceData from device. abstract UnitsetLedConfig(String identifier, LedConfig ledConfig)Set LedConfig for device (Verity Sense 2.2.1+). abstract UnitdoFactoryReset(String identifier, Boolean preservePairingInformation)Perform factory reset to given device. abstract UnitdoFactoryReset(String identifier)Perform factory reset to given device. abstract UnitdoRestart(String identifier)Perform restart device. abstract LogConfiggetLogConfig(String identifier)Get LogConfig from device. abstract UnitsetLogConfig(String identifier, LogConfig logConfig)Set LogConfig for device. abstract UnitsetWareHouseSleep(String identifier)Set warehouse sleep setting to a given device. abstract UnitturnDeviceOff(String identifier)Turn of device by setting the device to sleep state. abstract UnitdoFirstTimeUse(String identifier, PolarFirstTimeUseConfig ftuConfig)Configure the Polar device with first-time use settings and user identifier. abstract BooleanisFtuDone(String identifier)Check if the First Time Use has been done for the given device. abstract PolarPhysicalConfigurationgetUserPhysicalConfiguration(String identifier)Get the user's physical data from the given device. abstract UnitsetUserDeviceSettings(String identifier, PolarUserDeviceSettings deviceUserSetting)Set PolarUserDeviceSettings for device. abstract PolarUserDeviceSettingsgetUserDeviceSettings(String identifier)Get PolarUserDeviceSettings from device. abstract UnitsetUserDeviceLocation(String identifier, Integer location)Set the user device location on the device. abstract UnitsetUsbConnectionMode(String identifier, Boolean enabled)Set the USB connection mode on the device. abstract UnitsetAutomaticTrainingDetectionSettings(String identifier, Boolean automaticTrainingDetectionMode, Integer automaticTrainingDetectionSensitivity, Integer minimumTrainingDurationSeconds)Set the automatic training detection settings on the device. abstract UnitsetDaylightSavingTime(String identifier)Set the next Daylight Saving Time (DST) settings on the device in the current timezone. abstract UnitdeleteStoredDeviceData(String identifier, PolarBleApi.PolarStoredDataType dataType, LocalDate until)Delete data PolarStoredDataType from a device. abstract UnitsetTelemetryEnabled(String deviceId, Boolean enabled)Enable or disable telemetry (trace logging / diagnostics) on the device. abstract UnitdeleteDeviceDateFolders(String identifier, LocalDate fromDate, LocalDate toDate)Deletes device day (YYYMMDD) folders from the given date range from a device. abstract UnitdeleteTelemetryData(String identifier)Deletes all telemetry data files from a device. abstract UnitwaitForConnection(String identifier)Waits for a connection to the specified device. abstract UnitsetMultiBLEConnectionMode(String identifier, Boolean enable)Enable multi BLE connection mode on a given device. abstract BooleangetMultiBLEConnectionMode(String identifier)Request multi BLE connection mode status from device. abstract BooleansendInitializationAndStartSyncNotifications(String identifier)Notify device of the incoming data transfer operation(s). abstract UnitsendTerminateAndStopSyncNotifications(String identifier)Notify device that data transfer operations are completed. abstract UnitsetAutomaticOHRMeasurementEnabled(String identifier, Boolean enabled)Enable or disable AUTOS file generation on the device. abstract IntegergetBatteryLevel(String identifier)Request last observed battery level value from device. abstract <Error class: unknown class>getChargerState(String identifier)Request last observed charging status value from device. abstract Pair<Boolean, Integer>checkIfDeviceDisconnectedDueRemovedPairing(String identifier)abstract IntegergetRSSIValue(String identifier)Request last observed RSSI (Received Signal Strength Indication) value from device. -
Methods inherited from class com.polar.sdk.api.PolarOnlineStreamingApi
getAvailableHRServiceDataTypes, getAvailableOnlineStreamDataTypes, requestFullStreamSettings, requestStreamSettings, startAccStreaming, startEcgStreaming, startGyroStreaming, startHrStreaming, startLocationStreaming, startMagnetometerStreaming, startPpgStreaming, startPpiStreaming, startPressureStreaming, startSkinTemperatureStreaming, startTemperatureStreaming, stopHrStreaming, stopStreaming -
Methods inherited from class com.polar.sdk.api.PolarOfflineRecordingApi
getAvailableOfflineRecordingDataTypes, getOfflineRecord, getOfflineRecordWithProgress, getOfflineRecordingStatus, getOfflineRecordingTriggerSetup, getSplitOfflineRecord, listOfflineRecordings, listSplitOfflineRecordings, removeOfflineRecord, requestFullOfflineRecordingSettings, requestOfflineRecordingSettings, setOfflineRecordingTrigger, startOfflineRecording, stopOfflineRecording -
Methods inherited from class com.polar.sdk.api.PolarH10OfflineExerciseApi
fetchExercise, listExercises, removeExercise, requestRecordingStatus, startRecording, stopRecording -
Methods inherited from class com.polar.sdk.api.PolarSdkModeApi
disableSDKMode, enableSDKMode, isSDKModeEnabled -
Methods inherited from class com.polar.sdk.api.PolarFirmwareUpdateApi
checkFirmwareUpdate, updateFirmware, updateFirmware -
Methods inherited from class com.polar.sdk.api.PolarActivityApi
get247HrSamples, get247PPiSamples, getActiveTime, getActivitySampleData, getCalories, getDailySummaryData, getDistance, getNightlyRecharge, getSteps -
Methods inherited from class com.polar.sdk.api.PolarSleepApi
getSleep, getSleepRecordingState, observeSleepRecordingState, stopSleepRecording -
Methods inherited from class com.polar.sdk.api.PolarRestServiceApi
getRestApiDescription, listRestApiServices, putNotification, receiveRestApiEvents -
Methods inherited from class com.polar.sdk.api.PolarTemperatureApi
getSkinTemperature -
Methods inherited from class com.polar.sdk.api.PolarTrainingSessionApi
deleteTrainingSession, getExerciseStatus, getTrainingSession, getTrainingSessionReferences, getTrainingSessionWithProgress, observeExerciseStatus, pauseExercise, resumeExercise, startExercise, stopExercise -
Methods inherited from class com.polar.sdk.api.PolarBleLowLevelApi
deleteFileOrDirectory, getFileList, readFile, writeFile -
Methods inherited from class com.polar.sdk.api.PolarDeviceToHostNotificationsApi
observeDeviceToHostNotifications -
Methods inherited from class com.polar.sdk.api.PolarTestApi
getSpo2Test -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PolarBleApi
PolarBleApi(Set<PolarBleApi.PolarBleSdkFeature> features)
-
-
Method Detail
-
getFeatures
final Set<PolarBleApi.PolarBleSdkFeature> getFeatures()
the set of the features API is used for. By giving only the needed features the SDK may reserve only the required resources
-
setMtu
abstract Unit setMtu(@IntRange(from = 70, to = 512) Integer mtu)
set mtu to lower than default (232 is the default for polar devices, minimum for H10 is 70 and for OH1 is 140) to minimize latency
- Parameters:
mtu- value between 70-512 to be set
-
shutDown
abstract Unit shutDown()
Releases the SDK resources. When the SDK is used on scope of the android component (e.g. Activity or Service) then the shutDown may be called on component destroy function. After shutDown the new instance of the SDK is needed:
-
setPolarFilter
abstract Unit setPolarFilter(Boolean enable)
When enabled only Polar devices are found by the searchForDevice, if set to false any BLE devices with HR services are returned by the searchForDevice. The default setting for Polar filter is true.
- Parameters:
enable- false disables polar filter
-
isFeatureReady
abstract Boolean isFeatureReady(String deviceId, PolarBleApi.PolarBleSdkFeature feature)
Check if the feature is ready.
- Parameters:
deviceId- polar device id or bt addressfeature- feature to be requested- Returns:
true if feature is ready for use,
-
foregroundEntered
abstract Unit foregroundEntered()
Optionally call when application enters to the foreground. By calling foregroundEntered() you make sure BLE scan is restarted. BLE scan start is not working when Android device display is off (related to Android power save). By calling foregroundEntered() helps in some rare situations e.g. if connection is lost to the device and .setAutomaticReconnection is enabled, reconnection is created when application is back in foreground.
-
setApiCallback
abstract Unit setApiCallback(PolarBleApiCallbackProvider callback)
Sets the API callback
- Parameters:
callback- instance of PolarBleApiCallbackProvider
-
setApiLogger
abstract Unit setApiLogger(PolarBleApi.PolarBleApiLogger logger)
Sets the API logger
- Parameters:
logger- instance of PolarBleApiLogger
-
searchForDevice
abstract Flow<PolarDeviceInfo> searchForDevice()
Starts searching for BLE devices when subscribed. Search continues as long as observable is subscribed or error. Each found device is emitted only once. By default searches only for Polar devices, but can be controlled by .setPolarFilter. If .setPolarFilter is false then searches for any BLE heart rate capable devices.
- Returns:
Flowable stream of PolarDeviceInfo
-
searchForDevice
abstract Flow<PolarDeviceInfo> searchForDevice(String withDeviceNameFilterPrefix)
Starts searching for BLE devices when subscribed. Search continues as long as observable is subscribed or error. Each found device is emitted only once. By default searches only for Polar devices, but can be controlled by .setPolarFilter. If .setPolarFilter is false then searches for any BLE heart rate capable devices.
- Parameters:
withDeviceNameFilterPrefix-returned devices are filtered on given device name prefix string. Default: "Polar".
- Returns:
Flowable stream of PolarDeviceInfo
-
setAutomaticReconnection
abstract Unit setAutomaticReconnection(Boolean enable)
When enabled the reconnection is attempted if device connection is lost. By default automatic reconnection is enabled. Note that firmware update (FWU) turns on automatic reconnection automatically, and restores the setting automatically when operation completes. One should not change this setting during FWU.
- Parameters:
enable- true = automatic reconnection is enabled, false = automatic reconnection is disabled
-
autoConnectToDevice
abstract Unit autoConnectToDevice(Integer rssiLimit, String service, Integer timeout, TimeUnit unit, String polarDeviceType)
Start connecting to a nearby Polar device. PolarBleApiCallback.deviceConnected callback is invoked when connection to a nearby device is established.
- Parameters:
rssiLimit- RSSI (Received Signal Strength Indication) value is typically from -40 to -60 (dBm), depends on the used Bluetooth chipset and/or antenna tuningservice- in hex string format like "180D" PolarInvalidArgument invoked if not in correct formattimeout- min time to search nearby device default = 2sunit- time unit to be usedpolarDeviceType- like H10, OH1 etc...- Returns:
Returns when nearby device found, and connection attempt started. deviceConnecting callback invoked to inform connection attempt
-
autoConnectToDevice
abstract Unit autoConnectToDevice(Integer rssiLimit, String service, String polarDeviceType)
Start connecting to a nearby Polar device. PolarBleApiCallback.deviceConnected callback is invoked when connection to a nearby device is established.
- Parameters:
rssiLimit- RSSI (Received Signal Strength Indication) value is typically from -40 to -60 (dBm), depends on the used Bluetooth chipset and/or antenna tuningservice- in hex string format like "180D" PolarInvalidArgument invoked if not in correct formatpolarDeviceType- like H10, OH1 etc...- Returns:
Returns when nearby device found, and connection attempt started. deviceConnecting callback invoked to inform connection attempt
-
getDeviceName
abstract String getDeviceName(String deviceId)
Fetch device BLE name from BLE session.
-
connectToDevice
abstract Unit connectToDevice(String identifier)
Request a connection to a BLE device. Invokes PolarBleApiCallback.deviceConnected callback.
- Parameters:
identifier- Polar device id found printed on the sensor/device (in format "12345678") or bt address (in format "00:11:22:33:44:55")
-
disconnectFromDevice
abstract Unit disconnectFromDevice(String identifier)
Request disconnecting from a BLE device. Invokes PolarBleApiCallback.deviceDisconnected callback.
- Parameters:
identifier- Polar device id found printed on the sensor/device or bt address (in format "00:11:22:33:44:55")
-
setLocalTime
abstract Unit setLocalTime(String identifier, LocalDateTime dateAndTime)
Set the device time. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_TIME_SETUP
- Parameters:
identifier- polar device id or bt addressdateAndTime- time to set- Returns:
Success or error
-
getLocalTime
@Deprecated(message = "Use getLocalTimeWithZone() instead to also get timezone", replaceWith = @ReplaceWith(imports = {}, expression = "getLocalTimeWithZone(identifier)")) abstract LocalDateTime getLocalTime(String identifier)
Get current time in device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_TIME_SETUP. Note, the H10 is not supporting time read.
- Parameters:
identifier- polar device id or bt address- Returns:
Single observable which emits device time in LocalDateTime instance when observable is subscribed
-
getLocalTimeWithZone
abstract ZonedDateTime getLocalTimeWithZone(String identifier)
Get current time and timezone from device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_TIME_SETUP. Note, the H10 is not supporting time read.
- Parameters:
identifier- polar device id or bt address- Returns:
Single observable which emits device time as ZonedDateTime (including timezone offset) when observable is subscribed
-
startListenForPolarHrBroadcasts
abstract Flow<PolarHrBroadcastData> startListenForPolarHrBroadcasts(Set<String> deviceIds)
Start listening the heart rate from Polar devices when subscribed. This observable listens BLE broadcast and parses heart rate from BLE broadcast. The BLE device don't need to be connected when using this function, the heart rate is parsed from the BLE advertisement
- Parameters:
deviceIds- set of Polar device ids to filter or null for a any Polar device- Returns:
Flow of PolarHrBroadcastData
-
getFile
abstract ByteArray getFile(String identifier, String path)
Get file as ByteArray from device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_FILE_TRANSFER
- Parameters:
identifier- polar device id or bt addresspath- filesystem file path- Returns:
File bytes or error
-
getDiskSpace
abstract PolarDiskSpaceData getDiskSpace(String identifier)
Get PolarDiskSpaceData from device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address- Returns:
PolarDiskSpaceData or error
-
setLedConfig
abstract Unit setLedConfig(String identifier, LedConfig ledConfig)
Set LedConfig for device (Verity Sense 2.2.1+). Requires feature PolarBleSdkFeature.FEATURE_POLAR_LED_ANIMATION
- Parameters:
identifier- Polar device ID or BT addressledConfig- new LedConfig@return Success or error
-
doFactoryReset
@Deprecated(message = "Use method doFactoryReset(identifier: String) instead.") abstract Unit doFactoryReset(String identifier, Boolean preservePairingInformation)
Perform factory reset to given device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT addresspreservePairingInformation- preserve pairing information during factory reset- Returns:
Success or error
-
doFactoryReset
abstract Unit doFactoryReset(String identifier)
Perform factory reset to given device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address- Returns:
Success or error
-
doRestart
abstract Unit doRestart(String identifier)
Perform restart device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address- Returns:
Success or error
-
getLogConfig
abstract LogConfig getLogConfig(String identifier)
Get LogConfig from device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address@return LogConfig or error
-
setLogConfig
abstract Unit setLogConfig(String identifier, LogConfig logConfig)
Set LogConfig for device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT addresslogConfig- new LogConfig@return Success or error
-
setWareHouseSleep
abstract Unit setWareHouseSleep(String identifier)
Set warehouse sleep setting to a given device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL Warehouse sleep does factory reset to the device and makes it sleep.
- Parameters:
identifier- Polar device ID or BT address- Returns:
Success or error
-
turnDeviceOff
abstract Unit turnDeviceOff(String identifier)
Turn of device by setting the device to sleep state. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address- Returns:
Success or error
-
doFirstTimeUse
abstract Unit doFirstTimeUse(String identifier, PolarFirstTimeUseConfig ftuConfig)
Configure the Polar device with first-time use settings and user identifier. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or Bluetooth address.ftuConfig- Configuration data for the first-time use, encapsulated in PolarFirstTimeUseConfig.- Returns:
Success or error
PolarFirstTimeUseConfig class requires valid values for each parameter within specific ranges:
Gender: "Male" or "Female"
Height: 90 to 240 cm
Weight: 15 to 300 kg
Max heart rate: 100 to 240 bpm
Resting heart rate: 20 to 120 bpm
VO2 max: 10 to 95
Training background: One of the predefined levels (10, 20, 30, 40, 50, 60)
Sleep goal: In minutes between 300 to 660
Typical day: "MOSTLY_SITTING", "MOSTLY_STANDING", or "MOSTLY_MOVING"
-
isFtuDone
abstract Boolean isFtuDone(String identifier)
Check if the First Time Use has been done for the given device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or Bluetooth address.- Returns:
Success with "true" or "false" response, or error.
-
getUserPhysicalConfiguration
abstract PolarPhysicalConfiguration getUserPhysicalConfiguration(String identifier)
Get the user's physical data from the given device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or Bluetooth address- Returns:
PolarPhysicalConfiguration if available, null if FTU not done or error
-
setUserDeviceSettings
@Deprecated(message = "Use setting specific methods instead, e.g. setUserDeviceLocation()") abstract Unit setUserDeviceSettings(String identifier, PolarUserDeviceSettings deviceUserSetting)
Set PolarUserDeviceSettings for device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address.deviceUserSetting- New PolarUserDeviceSettings- Returns:
Success or error
-
getUserDeviceSettings
abstract PolarUserDeviceSettings getUserDeviceSettings(String identifier)
Get PolarUserDeviceSettings from device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address@return PolarUserDeviceSettings or error
-
setUserDeviceLocation
abstract Unit setUserDeviceLocation(String identifier, Integer location)
Set the user device location on the device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address.location- The location to be set (usually an enum value representing the location).- Returns:
Success or error
-
setUsbConnectionMode
abstract Unit setUsbConnectionMode(String identifier, Boolean enabled)
Set the USB connection mode on the device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address.enabled- Whether to enable or disable USB connection mode.- Returns:
Success or error
-
setAutomaticTrainingDetectionSettings
abstract Unit setAutomaticTrainingDetectionSettings(String identifier, Boolean automaticTrainingDetectionMode, Integer automaticTrainingDetectionSensitivity, Integer minimumTrainingDurationSeconds)
Set the automatic training detection settings on the device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- Polar device ID or BT address.automaticTrainingDetectionMode- Whether the automatic training detection should be enabled or disabled.automaticTrainingDetectionSensitivity- The sensitivity for automatic training detection.minimumTrainingDurationSeconds- The minimum duration in seconds required for automatic training detection.- Returns:
Success or error
-
setDaylightSavingTime
abstract Unit setDaylightSavingTime(String identifier)
Set the next Daylight Saving Time (DST) settings on the device in the current timezone. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL Gets the current timezone from the device and sets DST value based on that.
- Parameters:
identifier- Polar device ID or BT address.- Returns:
Success or error
-
deleteStoredDeviceData
abstract Unit deleteStoredDeviceData(String identifier, PolarBleApi.PolarStoredDataType dataType, LocalDate until)
Delete data PolarStoredDataType from a device. Note that you will need to await for completion. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- , Polar device ID or BT addressdataType- , PolarStoredDataType A specific data type that shall be deleteduntil- , Data will be deleted from device from history until this date.- Returns:
Success or error
-
setTelemetryEnabled
abstract Unit setTelemetryEnabled(String deviceId, Boolean enabled)
Enable or disable telemetry (trace logging / diagnostics) on the device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
enabled- true = telemetry on, false = off- Returns:
Success or error
-
deleteDeviceDateFolders
abstract Unit deleteDeviceDateFolders(String identifier, LocalDate fromDate, LocalDate toDate)
Deletes device day (YYYMMDD) folders from the given date range from a device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL The date range is inclusive. Deletes the day folder (plus all sub-folders with any contents). If date directories are not found for the given date range the operation is still successful and no error is emitted.
- Parameters:
identifier- , Polar device ID or BT addressfromDate- The starting date to delete date folders fromtoDate- The ending date of last date to delete folders from- Returns:
Success or error
-
deleteTelemetryData
abstract Unit deleteTelemetryData(String identifier)
Deletes all telemetry data files from a device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL
- Parameters:
identifier- , Polar device ID or BT address- Returns:
Success or error
-
waitForConnection
abstract Unit waitForConnection(String identifier)
Waits for a connection to the specified device. Emits success when the connection is established or an error if the connection fails.
- Parameters:
identifier- Polar device ID or Bluetooth address- Returns:
Success or error
-
setMultiBLEConnectionMode
abstract Unit setMultiBLEConnectionMode(String identifier, Boolean enable)
Enable multi BLE connection mode on a given device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_FEATURES_CONFIGURATION_SERVICE
- Parameters:
identifier- Polar device ID or BT addressenable- , set to true to enable, false to disable multi BLE connection mode.- Returns:
Success or error
-
getMultiBLEConnectionMode
abstract Boolean getMultiBLEConnectionMode(String identifier)
Request multi BLE connection mode status from device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_FEATURES_CONFIGURATION_SERVICE
- Parameters:
identifier- Polar device ID or BT address- Returns:
true if multi BLE connection has been enabled, false otherwise.
-
sendInitializationAndStartSyncNotifications
abstract Boolean sendInitializationAndStartSyncNotifications(String identifier)
Notify device of the incoming data transfer operation(s). By using this method the device will handle data transfer operations more efficiently by setting it to faster data transfer mode. It also will cause the device to flush the latest data to files giving you the most up-to-date data. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL handle data transfer operations more efficiently by setting it to faster data transfer mode. It also will cause the device to flush the latest data to files giving you the most up-to-date data.
- Parameters:
identifier- Polar device ID or BT address- Returns:
true if start sync notifications sending was successful, false otherwise.
-
sendTerminateAndStopSyncNotifications
abstract Unit sendTerminateAndStopSyncNotifications(String identifier)
Notify device that data transfer operations are completed. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL By calling this API device will set itself back to normal data transfer mode that will use less battery.
- Parameters:
identifier- Polar device ID or BT address- Returns:
true if stop sync notifications sending was successful, false otherwise.
-
setAutomaticOHRMeasurementEnabled
abstract Unit setAutomaticOHRMeasurementEnabled(String identifier, Boolean enabled)
Enable or disable AUTOS file generation on the device. Requires feature PolarBleSdkFeature.FEATURE_POLAR_DEVICE_CONTROL AUTOS files contain 24/7 OHR data. Status of this setting can be read with getUserDeviceSettings().
- Parameters:
identifier- Polar device ID or BT addressenabled- true = AUTOS files enabled, false = disabled- Returns:
Completable (success or error)
-
getBatteryLevel
abstract Integer getBatteryLevel(String identifier)
Request last observed battery level value from device. Requires feature PolarBleSdkFeature.FEATURE_BATTERY_INFO
- Parameters:
identifier- Polar device ID or BT address- Returns:
Level of battery level percentage 0 - 100%. Will return -1 if battery level is not available.
-
getChargerState
abstract <Error class: unknown class> getChargerState(String identifier)
Request last observed charging status value from device. Requires feature PolarBleSdkFeature.FEATURE_BATTERY_INFO
- Parameters:
identifier- Polar device ID or BT address- Returns:
ChargeState value indicating the last observed charging status of the device.
-
checkIfDeviceDisconnectedDueRemovedPairing
abstract Pair<Boolean, Integer> checkIfDeviceDisconnectedDueRemovedPairing(String identifier)
-
getRSSIValue
abstract Integer getRSSIValue(String identifier)
Request last observed RSSI (Received Signal Strength Indication) value from device. Does not require any specific feature (core API)
- Parameters:
identifier- Polar device ID or BT address- Returns:
Int value indicating the last observed BLE signal strength value from the device. If the RSSI value is not available returns -1.
-
-
-
-