Interface PolarTrainingSessionApi
-
- All Implemented Interfaces:
public interface PolarTrainingSessionApiPolar training session API.
-
-
Method Summary
Modifier and Type Method Description abstract Flowable<PolarTrainingSessionReference>getTrainingSessionReferences(String identifier, Date fromDate, Date toDate)Get training session references for a given period. abstract CompletabledeleteTrainingSession(String identifier, PolarTrainingSessionReference reference)Api for removing single training session from a Polar device. abstract Single<PolarTrainingSession>getTrainingSession(String identifier, PolarTrainingSessionReference trainingSessionReference)Get training session. abstract Observable<PolarTrainingSessionFetchResult>getTrainingSessionWithProgress(String identifier, PolarTrainingSessionReference trainingSessionReference)Get training session with progress tracking. abstract CompletablestartExercise(String identifier, PolarExerciseSession.SportProfile profile)Start an exercise session on the device. abstract CompletablepauseExercise(String identifier)Pause an ongoing exercise session. abstract CompletableresumeExercise(String identifier)Resume a paused exercise session. abstract CompletablestopExercise(String identifier)Stop the current exercise session. abstract Single<PolarExerciseSession.ExerciseInfo>getExerciseStatus(String identifier)Get the current exercise session status from the device. abstract Flowable<PolarExerciseSession.ExerciseInfo>observeExerciseStatus(String identifier)Observe exercise session status changes from the device. -
-
Method Detail
-
getTrainingSessionReferences
abstract Flowable<PolarTrainingSessionReference> getTrainingSessionReferences(String identifier, Date fromDate, Date toDate)
Get training session references for a given period.
- Parameters:
identifier- The Polar device ID or BT address.fromDate- The starting date of the period to retrieve training session references from.toDate- The ending date of the period to retrieve training session references from.- Returns:
A Flowable emitting PolarTrainingSessionReference objects representing the training session references for the specified period.
-
deleteTrainingSession
abstract Completable deleteTrainingSession(String identifier, PolarTrainingSessionReference reference)
Api for removing single training session from a Polar device. You can get a list of training sessions with getTrainingSessionReferences API.
- Parameters:
identifier- The Polar device ID or BT address.reference- PolarTrainingSessionReference with path in device to the training session to be removed.- Returns:
Completable stream
-
getTrainingSession
abstract Single<PolarTrainingSession> getTrainingSession(String identifier, PolarTrainingSessionReference trainingSessionReference)
Get training session.
- Parameters:
identifier- The Polar device ID or BT address.trainingSessionReference- The reference to the training session to retrieve.- Returns:
A Single emitting a PolarTrainingSession object representing the training session data.
-
getTrainingSessionWithProgress
abstract Observable<PolarTrainingSessionFetchResult> getTrainingSessionWithProgress(String identifier, PolarTrainingSessionReference trainingSessionReference)
Get training session with progress tracking.
- Parameters:
identifier- The Polar device ID or BT address.trainingSessionReference- The reference to the training session to retrieve.- Returns:
An Observable emitting PolarTrainingSessionFetchResult objects with progress updates and final result.
-
startExercise
abstract Completable startExercise(String identifier, PolarExerciseSession.SportProfile profile)
Start an exercise session on the device.
- Parameters:
identifier- The Polar device ID or BT address.profile- The sport profile to use for the exercise session.- Returns:
A Completable that completes when the command has been delivered to the device.
-
pauseExercise
abstract Completable pauseExercise(String identifier)
Pause an ongoing exercise session.
- Parameters:
identifier- The Polar device ID or BT address.- Returns:
A Completable that completes when the command has been delivered to the device.
-
resumeExercise
abstract Completable resumeExercise(String identifier)
Resume a paused exercise session.
- Parameters:
identifier- The Polar device ID or BT address.- Returns:
A Completable that completes when the command has been delivered to the device.
-
stopExercise
abstract Completable stopExercise(String identifier)
Stop the current exercise session.
By default, the session is saved on the device.
- Parameters:
identifier- The Polar device ID or BT address.- Returns:
A Completable that completes when the command has been delivered to the device.
-
getExerciseStatus
abstract Single<PolarExerciseSession.ExerciseInfo> getExerciseStatus(String identifier)
Get the current exercise session status from the device.
- Parameters:
identifier- The Polar device ID or BT address.- Returns:
A Single emitting the current PolarExerciseSession.ExerciseInfo for the device.
-
observeExerciseStatus
abstract Flowable<PolarExerciseSession.ExerciseInfo> observeExerciseStatus(String identifier)
Observe exercise session status changes from the device.
- Parameters:
identifier- The Polar device ID or BT address.- Returns:
A Flowable emitting PolarExerciseSession.ExerciseInfo whenever the session status changes. - onNext: emitted when exercise status changes - onError: see PolarErrors for possible errors - onComplete: when the device disconnects or observation is disposed
-
-
-
-