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
PolarErrorsfor possible errors invoked
-
Find out if the HR service is available in the device. Use this API method in a case where the device does not support Polar Measurement Data service. In such a case using ‘getAvailableOnlineStreamDataTypes’ will return error; use this method instead.
Declaration
Swift
func getAvailableHRServiceDataTypes(identifier: String) -> Single<Set<PolarDeviceDataType>>Return Value
Single stream
- success: onSuccess the set with HR service, if available
- onError: see
PolarErrorsfor 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
polarSensorStreamingfeature.Declaration
Swift
func requestStreamSettings(_ identifier: String, feature: PolarDeviceDataType) -> Single<PolarSensorSetting>Return Value
Single stream
- success: once after settings received from device
- onError: see
PolarErrorsfor 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
polarSensorStreamingfeature. This request is supported only by Polar Verity Sense firmware 1.1.5Declaration
Swift
func requestFullStreamSettings(_ identifier: String, feature: PolarDeviceDataType) -> Single<PolarSensorSetting>Parameters
identifierpolar device id
featureselected feature from
PolarDeviceDataTypeReturn Value
Single stream
- success: once after full settings received from device
- onError: see
PolarErrorsfor 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
identifierPolar device id or device address
Return Value
Observable stream
- onNext: for every air packet received. see
PolarHrData - onError: see
PolarErrorsfor possible errors invoked
- onNext: for every air packet received. see
-
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
identifierPolar device id or device address
settingsselected settings to start the stream
Return Value
Observable stream
- onNext: for every air packet received. see
PolarEcgData - onError: see
PolarErrorsfor possible errors invoked
- onNext: for every air packet received. see
-
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
- onNext: for every air packet received. see
PolarAccData - onError: see
PolarErrorsfor possible errors invoked
- onNext: for every air packet received. see
-
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
identifierPolar device id or device address
settingsselected 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
identifierPolar device id or device address
settingsselected 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
identifierPolar device id or device address
settingsselected settings to start the stream
Return Value
Observable stream
- onNext: for every air packet received. see
PolarOhrData - onError: see
PolarErrorsfor possible errors invoked
- onNext: for every air packet received. see
-
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
identifierPolar device id or device address
Return Value
Observable stream
- onNext: for every air packet received. see
PolarPpiData - onError: see
PolarErrorsfor possible errors invoked
- onNext: for every air packet received. see
-
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
identifierPolar device id or device address
settingsselected settings to start the stream
Return Value
Observable stream
- onNext: for every air packet received. see
PolarTemperatureData - onError: see
PolarErrorsfor possible errors invoked
- onNext: for every air packet received. see
-
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
identifierPolar device id or device address
settingsselected settings to start the stream
Return Value
Observable stream
- onNext: for every air packet received. see
PolarPressureData - onError: see
PolarErrorsfor possible errors invoked
- onNext: for every air packet received. see
-
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
identifierPolar device id or device address
settingsselected settings to start the stream
Return Value
Observable stream
- onNext: for every air packet received. see
PolarTemperatureData - onError: see
PolarErrorsfor possible errors invoked
- onNext: for every air packet received. see