Interface PolarBleApiCallbackProvider
-
- All Implemented Interfaces:
public interface PolarBleApiCallbackProviderContains the callbacks of the API.
-
-
Method Summary
Modifier and Type Method Description abstract UnitblePowerStateChanged(Boolean powered)Bluetooth power state of the device where this SDK is running abstract UnitdeviceConnected(PolarDeviceInfo polarDeviceInfo)Device is now connected abstract UnitdeviceConnecting(PolarDeviceInfo polarDeviceInfo)Connecting to device abstract UnitdeviceDisconnected(PolarDeviceInfo polarDeviceInfo)Device is now disconnected. UnitdeviceDisconnected(PolarDeviceInfo polarDeviceInfo, PolarBleDisconnectInfo info)Device is disconnected with a reason and recovery recommendation. abstract UnitbleSdkFeatureReady(String identifier, PolarBleApi.PolarBleSdkFeature feature)The feature is available in this device and it is ready. abstract UnitbleSdkFeaturesReadiness(String identifier, List<PolarBleApi.PolarBleSdkFeature> ready, List<PolarBleApi.PolarBleSdkFeature> unavailable)Called once all requested features have been evaluated after a device connection. abstract UnitdisInformationReceived(String identifier, UUID uuid, String value)DIS information received. abstract Unit)>disInformationReceived(String identifier, <Error class: unknown class> disInfo)DIS information received. abstract UnitbatteryLevelReceived(String identifier, Integer level)Battery level received. abstract Unit)>batteryChargingStatusReceived(String identifier, <Error class: unknown class> chargingStatus)Battery charging status received. abstract Unit)>powerSourcesStateReceived(String identifier, <Error class: unknown class> powerSourcesState)Battery power sources state received. abstract UnithrNotificationReceived(String identifier, PolarHrData.PolarHrSample data)HR notification data received from device. abstract UnithtsNotificationReceived(String identifier, PolarHealthThermometerData data)Health Thermometer Service. -
-
Method Detail
-
blePowerStateChanged
abstract Unit blePowerStateChanged(Boolean powered)
Bluetooth power state of the device where this SDK is running
- Parameters:
powered- true = Bluetooth power on, false = Bluetooth power off
-
deviceConnected
abstract Unit deviceConnected(PolarDeviceInfo polarDeviceInfo)
Device is now connected
- Parameters:
polarDeviceInfo- Polar device information
-
deviceConnecting
abstract Unit deviceConnecting(PolarDeviceInfo polarDeviceInfo)
Connecting to device
- Parameters:
polarDeviceInfo- Polar device information
-
deviceDisconnected
@Deprecated(message = "Use deviceDisconnected(polarDeviceInfo, info) for typed disconnect diagnostics") abstract Unit deviceDisconnected(PolarDeviceInfo polarDeviceInfo)
Device is now disconnected. Prefer the overload that receives PolarBleDisconnectInfo for recovery-specific handling.
- Parameters:
polarDeviceInfo- Polar device information
-
deviceDisconnected
Unit deviceDisconnected(PolarDeviceInfo polarDeviceInfo, PolarBleDisconnectInfo info)
Device is disconnected with a reason and recovery recommendation.
For PolarBleRecoveryAction.RETRY_OPERATION, wait for the next deviceConnected callback before retrying the failed idempotent SDK operation. The SDK does not replay arbitrary application operations; do not blindly repeat a non-idempotent write.
For PolarBleRecoveryAction.RETRY_CONNECTION, keep the device nearby and powered on while the SDK reconnects and rebuilds the GATT session. Retry the interrupted operation only after deviceConnected. A timeout alone does not prove that pairing information was removed.
For PolarBleRecoveryAction.REMOVE_PAIRING_AND_PAIR_AGAIN, stop automatic retries, remove/forget the pairing in Android Bluetooth settings and from the device when required, put the device into pairing mode, and connect again.
For PolarBleRecoveryAction.RETRY_PAIRING, Android started or retried security negotiation but the peripheral did not complete it. Put the device into its explicit pairing mode, keep it disconnected from other phones, and connect again. This does not prove that an existing Android bond was removed.
For PolarBleRecoveryAction.NONE, use normal disconnected-device handling. An explicit PolarBleApi.disconnectFromDevice call is intentional and is reported with PolarBleDisconnectReason.CONNECTION_LOST and PolarBleRecoveryAction.NONE; applications should not present pairing recovery instructions for that case.
- Parameters:
polarDeviceInfo- Polar device informationinfo- typed disconnect reason and recovery recommendation
-
bleSdkFeatureReady
abstract Unit bleSdkFeatureReady(String identifier, PolarBleApi.PolarBleSdkFeature feature)
The feature is available in this device and it is ready. Called only for the features which are specified in PolarBleApi construction.
- Parameters:
identifier- Polar device idfeature- feature is ready
-
bleSdkFeaturesReadiness
abstract Unit bleSdkFeaturesReadiness(String identifier, List<PolarBleApi.PolarBleSdkFeature> ready, List<PolarBleApi.PolarBleSdkFeature> unavailable)
Called once all requested features have been evaluated after a device connection. This is the simplest way to wait for the device to become fully ready for further operations.
Constructing PolarBleApi with an empty feature set causes the SDK to evaluate all SDK features by default. SDK calls this method after a device is connected.
The ready list contains features that are confirmed ready for use. The unavailable list contains features that are not supported by this device. Features absent from both lists timed out before their readiness could be established; they can still become ready later and will be reported via bleSdkFeatureReady.
- Parameters:
identifier- Polar device idready- features that are confirmed ready for use on this deviceunavailable- features that are not supported by this device
-
disInformationReceived
abstract Unit disInformationReceived(String identifier, UUID uuid, String value)
DIS information received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_DEVICE_INFO
- Parameters:
identifier- Polar device id or bt addressuuid- uuid of dis valuevalue- dis value for uuid
-
disInformationReceived
abstract Unit )>disInformationReceived(String identifier, <Error class: unknown class> disInfo)
DIS information received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_DEVICE_INFO
- Parameters:
identifier- Polar device id or bt addressdisInfo- DisInfo key-value pair
-
batteryLevelReceived
abstract Unit batteryLevelReceived(String identifier, Integer level)
Battery level received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_BATTERY_INFO
- Parameters:
identifier- Polar device id or bt addresslevel- battery level (value between 0-100%)
-
batteryChargingStatusReceived
abstract Unit )>batteryChargingStatusReceived(String identifier, <Error class: unknown class> chargingStatus)
Battery charging status received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_BATTERY_INFO
- Parameters:
identifier- Polar device id or bt addresschargingStatus- Charging status ChargeState
-
powerSourcesStateReceived
abstract Unit )>powerSourcesStateReceived(String identifier, <Error class: unknown class> powerSourcesState)
Battery power sources state received. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_BATTERY_INFO
- Parameters:
identifier- Polar device id or bt addresspowerSourcesState- PowerSourcesState
-
hrNotificationReceived
abstract Unit hrNotificationReceived(String identifier, PolarHrData.PolarHrSample data)
HR notification data received from device. Notice when using OH1 and PPI measurement is started hr received from this callback is 0.
- Parameters:
identifier- Polar device id or bt addressdata- @see polar.com.sdk.api.model.PolarHrData.
-
htsNotificationReceived
abstract Unit htsNotificationReceived(String identifier, PolarHealthThermometerData data)
Health Thermometer Service. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_HTS
- Parameters:
identifier- Polar device id or bt addressdata- @see polar.com.sdk.api.model.PolarHealthThermometerData.
-
-
-
-