PolarBleApiDeviceInfoObserver

public protocol PolarBleApiDeviceInfoObserver : AnyObject

Device info observer.

  • Battery level received from device.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_battery_info

    Declaration

    Swift

    func batteryLevelReceived(_ identifier: String, batteryLevel: UInt)

    Parameters

    identifier

    Polar device id

    batteryLevel

    battery level in precentage 0-100%

  • Battery charging status received from device.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_battery_info

    Declaration

    Swift

    func batteryChargingStatusReceived(_ identifier: String, chargingStatus: BleBasClient.ChargeState)

    Parameters

    identifier

    Polar device id

    chargingStatus

    Battery charging status

  • Battery power source status received from device

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_battery_info

    Default Implementation

    Declaration

    Swift

    func batteryPowerSourcesStateReceived(_ identifier: String, powerSourcesState: BleBasClient.PowerSourcesState)

    Parameters

    identifier

    Polar device id

    powerSourcesState

    Includes presence of battery, and power sources – wired and wireless – states

  • Received a Device Information Service (DIS) characteristic value. Called once per available DIS characteristic. Characteristics include model number, manufacturer name, firmware/hardware/software revision, serial number, system ID, etc.

    Note: for SYSTEM_ID (UUID 2a23) the value is a raw ASCII representation that may not be human-readable. Use disInformationReceivedWithKeysAsStrings to receive a properly byte-reordered hex string for System ID.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_device_info

    Declaration

    Swift

    func disInformationReceived(_ identifier: String, uuid: CBUUID, value: String)

    Parameters

    identifier

    Polar device id

    uuid

    CBUUID identifying the DIS characteristic (e.g. 2a26 = firmware revision, 2a24 = model number)

    value

    ASCII string representation of the characteristic data

  • Received a Device Information Service (DIS) characteristic value with string keys. Called once per available DIS characteristic. Similar to disInformationReceived but uses string keys instead of CBUUID. Prefer this variant over disInformationReceived when displaying or storing DIS data, as SYSTEM_ID is returned as a properly byte-reordered hex string (key "SYSTEM_ID_HEX") rather than raw ASCII bytes.

    Requires

    Requires SDK feature(s): PolarBleSdkFeature.feature_device_info

    Declaration

    Swift

    func disInformationReceivedWithKeysAsStrings(_ identifier: String, key: String, value: String)

    Parameters

    identifier

    Polar device id

    key

    UUID string of the DIS characteristic (e.g. "2A26" = firmware revision), or "SYSTEM_ID_HEX" for the system ID

    value

    ASCII string value for most characteristics; byte-reordered hex string for SYSTEM_ID_HEX