PolarTrainingSessionApi
public protocol PolarTrainingSessionApi
Protocol defining methods to access training session data.
-
Get training session references for a given period.
Declaration
Swift
func getTrainingSessionReferences( identifier: String, fromDate: Date?, toDate: Date? ) -> Observable<PolarTrainingSessionReference>Parameters
identifierThe Polar device ID or BT address.
fromDateThe starting date of the period to retrieve training session references from. Optional.
toDateThe ending date of the period to retrieve training session references from. Optional.
Return Value
An Observable emitting
PolarTrainingSessionReferenceobjects for the specified period. -
Get a specific training session using a reference.
Declaration
Swift
func getTrainingSession( identifier: String, trainingSessionReference: PolarTrainingSessionReference ) -> Single<PolarTrainingSession>Parameters
identifierThe Polar device ID or BT address.
trainingSessionReferenceThe reference to the training session to retrieve.
Return Value
A Single emitting a
PolarTrainingSessioncontaining the session data. -
Get a specific training session using a reference with progress updates.
Declaration
Swift
func getTrainingSessionWithProgress( identifier: String, trainingSessionReference: PolarTrainingSessionReference ) -> Observable<PolarTrainingSessionFetchResult>Parameters
identifierThe Polar device ID or BT address.
trainingSessionReferenceThe reference to the training session to retrieve.
Return Value
An Observable emitting
PolarTrainingSessionFetchResultcontaining either progress updates or the complete session data. -
Start an exercise session on the device.
Declaration
Swift
func startExercise(identifier: String, profile: PolarExerciseSession.SportProfile) -> CompletableParameters
identifierThe Polar device ID or BT address.
profileThe sport profile to use for the exercise session.
Return Value
A
Completablethat completes when the command has been delivered to the device. -
Pause an ongoing exercise session.
Declaration
Swift
func pauseExercise(identifier: String) -> CompletableParameters
identifierThe Polar device ID or BT address.
Return Value
A
Completablethat completes when the command has been delivered to the device. -
Resume a paused exercise session.
Declaration
Swift
func resumeExercise(identifier: String) -> CompletableParameters
identifierThe Polar device ID or BT address.
Return Value
A
Completablethat completes when the command has been delivered to the device. -
Stop the current exercise session.
By default, the session is saved on the device.
Declaration
Swift
func stopExercise(identifier: String) -> CompletableParameters
identifierThe Polar device ID or BT address.
Return Value
A
Completablethat completes when the command has been delivered to the device. -
Get the current exercise session status from the device.
Declaration
Swift
func getExerciseStatus(identifier: String) -> Single<PolarExerciseSession.ExerciseInfo>Parameters
identifierThe Polar device ID or BT address.
Return Value
A
Singleemitting the currentPolarExerciseSession.ExerciseInfofor the device.