Package com.polar.sdk.api
Interface PolarSleepApi
-
- All Implemented Interfaces:
public interface PolarSleepApiPolar sleep API. Requires feature FEATURE_POLAR_SLEEP_DATA
-
-
Method Summary
Modifier and Type Method Description abstract BooleangetSleepRecordingState(String identifier)Get sleep recording state. abstract Flow<BooleanArray>observeSleepRecordingState(String identifier)Observe sleep recording state. abstract UnitstopSleepRecording(String identifier)Stop sleep recording. abstract List<PolarSleepData>getSleep(String identifier, LocalDate fromDate, LocalDate toDate)Get sleep stages and duration for a given period. -
-
Method Detail
-
getSleepRecordingState
abstract Boolean getSleepRecordingState(String identifier)
Get sleep recording state. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_SLEEP_DATA
- Parameters:
identifier- The Polar device ID or BT address- Returns:
boolean value indicating if sleep recording is ongoing
-
observeSleepRecordingState
abstract Flow<BooleanArray> observeSleepRecordingState(String identifier)
Observe sleep recording state. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_SLEEP_DATA
- Parameters:
identifier- The Polar device ID or BT address- Returns:
Flow of boolean values indicating if sleep recording is ongoing
-
stopSleepRecording
abstract Unit stopSleepRecording(String identifier)
Stop sleep recording. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_SLEEP_DATA
- Parameters:
identifier- The Polar device ID or BT address
-
getSleep
abstract List<PolarSleepData> getSleep(String identifier, LocalDate fromDate, LocalDate toDate)
Get sleep stages and duration for a given period. Requires feature PolarBleApi.PolarBleSdkFeature.FEATURE_POLAR_SLEEP_DATA
- Parameters:
identifier- The Polar device ID or BT address.fromDate- The starting date of the period to retrieve sleep data from.toDate- The ending date of the period to retrieve sleep data from.- Returns:
list of PolarSleepData representing the sleep data for the specified period.
-
-
-
-