PolarOnlineStreamingApi

public protocol PolarOnlineStreamingApi

Online steaming API.

Online streaming makes it possible to stream live online data from Polar device.

Requires features PolarBleSdkFeature.feature_polar_online_streaming

  • Get the data types available in this device for online streaming

    Declaration

    Swift

    func getAvailableOnlineStreamDataTypes(_ identifier: String) -> Single<Set<PolarDeviceDataType>>

    Return Value

    Single stream

    • success: set of available online streaming data types in this device
    • onError: see PolarErrors for possible errors invoked

  • Request the stream settings available in current operation mode. This request shall be used before the stream is started to decide currently available settings. The available settings depend on the state of the device. For example, if any stream(s) or optical heart rate measurement is already enabled, then the device may limit the offer of possible settings for other stream feature. Requires polarSensorStreaming feature.

    Declaration

    Swift

    func requestStreamSettings(_ identifier: String, feature: PolarDeviceDataType) -> Single<PolarSensorSetting>

    Return Value

    Single stream

    • success: once after settings received from device
    • onError: see PolarErrors for possible errors invoked

  • Request full steam settings capabilities. The request returns the all capabilities of the requested streaming feature not limited by the current operation mode. Requires polarSensorStreaming feature. This request is supported only by Polar Verity Sense firmware 1.1.5

    Declaration

    Swift

    func requestFullStreamSettings(_ identifier: String, feature: PolarDeviceDataType) -> Single<PolarSensorSetting>

    Parameters

    identifier

    polar device id

    feature

    selected feature fromPolarDeviceDataType

    Return Value

    Single stream

    • success: once after full settings received from device
    • onError: see PolarErrors for possible errors invoked

  • Start heart rate stream. Heart rate stream is stopped if the connection is closed, error occurs or stream is disposed.

    Declaration

    Swift

    func startHrStreaming(_ identifier: String) -> Observable<PolarHrData>

    Parameters

    identifier

    Polar device id or device address

    Return Value

    Observable stream

  • Start the ECG (Electrocardiography) stream. ECG stream is stopped if the connection is closed, error occurs or stream is disposed.

    Declaration

    Swift

    func startEcgStreaming(_ identifier: String, settings: PolarSensorSetting) -> Observable<PolarEcgData>

    Parameters

    identifier

    Polar device id or device address

    settings

    selected settings to start the stream

    Return Value

    Observable stream

  • Start ACC (Accelerometer) stream. ACC stream is stopped if the connection is closed, error occurs or stream is disposed.

    Declaration

    Swift

    func startAccStreaming(_ identifier: String, settings: PolarSensorSetting) -> Observable<PolarAccData>

    Return Value

    Observable stream

  • Start Gyro stream. Gyro stream is stopped if the connection is closed, error occurs during start or stream is disposed.

    Declaration

    Swift

    func startGyroStreaming(_ identifier: String, settings: PolarSensorSetting) -> Observable<PolarGyroData>

    Parameters

    identifier

    Polar device id or device address

    settings

    selected settings to start the stream

  • Start magnetometer stream. Magnetometer stream is stopped if the connection is closed, error occurs or stream is disposed.

    Declaration

    Swift

    func startMagnetometerStreaming(_ identifier: String, settings: PolarSensorSetting) -> Observable<PolarMagnetometerData>

    Parameters

    identifier

    Polar device id or device address

    settings

    selected settings to start the stream

  • Start optical sensor PPG (Photoplethysmography) stream. PPG stream is stopped if the connection is closed, error occurs or stream is disposed.

    Declaration

    Swift

    func startPpgStreaming(_ identifier: String, settings: PolarSensorSetting) -> Observable<PolarPpgData>

    Parameters

    identifier

    Polar device id or device address

    settings

    selected settings to start the stream

    Return Value

    Observable stream

    • onNext: for every air packet received. see PolarOhrData
    • onError: see PolarErrors for possible errors invoked

  • Start PPI (Pulse to Pulse interval) stream. PPI stream is stopped if the connection is closed, error occurs or stream is disposed. Notice that there is a delay before PPI data stream starts.

    Declaration

    Swift

    func startPpiStreaming(_ identifier: String) -> Observable<PolarPpiData>

    Parameters

    identifier

    Polar device id or device address

    Return Value

    Observable stream

  • Start temperature stream. Temperature stream is stopped if the connection is closed, error occurs or stream is disposed.

    Declaration

    Swift

    func startTemperatureStreaming(_ identifier: String, settings: PolarSensorSetting) -> Observable<PolarTemperatureData>

    Parameters

    identifier

    Polar device id or device address

    settings

    selected settings to start the stream

    Return Value

    Observable stream

  • Start pressure stream. Pressure stream is stopped if the connection is closed, error occurs or stream is disposed.

    Declaration

    Swift

    func startPressureStreaming(_ identifier: String, settings: PolarSensorSetting) -> Observable<PolarPressureData>

    Parameters

    identifier

    Polar device id or device address

    settings

    selected settings to start the stream

    Return Value

    Observable stream

  • Start skin temperature stream. Skin temperature stream is stopped if the connection is closed, error occurs or stream is disposed.

    Declaration

    Swift

    func startSkinTemperatureStreaming(_ identifier: String, settings: PolarSensorSetting) -> Observable<PolarTemperatureData>

    Parameters

    identifier

    Polar device id or device address

    settings

    selected settings to start the stream

    Return Value

    Observable stream