Class BlePMDClient
-
- All Implemented Interfaces:
public final class BlePMDClient extends BleGattBase
BLE Client for Polar Measurement Data Service (aka. PMD service)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumBlePMDClient.PmdDataFieldEncodingpublic classBlePMDClient.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static UUIDPMD_DATApublic final static UUIDPMD_CPpublic final static UUIDPMD_SERVICEprivate final LinkedBlockingQueue<Pair<ByteArray, Integer>>pmdCpResponseQueueprivate final Map<PmdMeasurementType, PmdSetting>currentSettingspublic final BleGattTxInterfacetxInterfacepublic BooleanisPrimaryServiceprivate final BooleanisEncryptionRequiredprivate final BooleanisServiceDiscoveredpublic final static BlePMDClient.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description BlePMDClient(BleGattTxInterface txInterface)
-
Method Summary
Modifier and Type Method Description final LinkedBlockingQueue<Pair<ByteArray, Integer>>getPmdCpResponseQueue()final Map<PmdMeasurementType, PmdSetting>getCurrentSettings()Unitreset()final ULonggetPreviousFrameTimeStamp(PmdMeasurementType type, PmdDataFrame.PmdDataFrameType frameType)UnitprocessServiceData(UUID characteristic, ByteArray data, Integer status, Boolean notifying)Callback for GATT service characteristic data processing UnitprocessServiceDataWritten(UUID characteristic, Integer status)StringtoString()final PmdSettingquerySettings(PmdMeasurementType type, PmdRecordingType recordingType)Query settings by type final PmdSettingqueryFullSettings(PmdMeasurementType type, PmdRecordingType recordingType)Query full settings by type final Set<PmdMeasurementType>readFeature(Boolean checkConnection)Read available PMD measurement types from device feature data. final <Error class: unknown class>startMeasurement(PmdMeasurementType type, PmdSetting setting, PmdRecordingType recordingType, PmdSecret secret)Start measurement of the given type. final Map<PmdMeasurementType, PmdActiveMeasurement>readMeasurementStatus()Read current measurement status from device. final <Error class: unknown class>waitForMeasurementInactive(PmdMeasurementType type, Long pollIntervalMs, Long timeoutMs)Poll measurement status until the given type is inactive or timeout is reached. final <Error class: unknown class>startSDKMode()Request to start SDK mode. final <Error class: unknown class>stopSDKMode()Request to stop SDK mode. final <Error class: unknown class>stopMeasurement(PmdMeasurementType type)Request to stop measurement. UnitclientReady(Boolean checkConnection)-
Methods inherited from class com.polar.androidcommunications.api.ble.model.gatt.BleGattBase
addCharacteristicNotification, authenticationCompleted, authenticationFailed, containsCharacteristic, containsCharacteristicRead, containsNotifyCharacteristic, descriptorWritten, getAvailableCharacteristics, getNotificationAtomicInteger, isAutomatic, isAutomaticRead, isEncryptionRequired, isServiceDiscovered, processCharacteristicDiscovered, processServiceDataWrittenWithResponse, removeCharacteristicNotification, serviceBelongsToClient, setMtuSize, setServiceDiscovered, waitNotificationEnabled, waitServiceDiscovered -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BlePMDClient
BlePMDClient(BleGattTxInterface txInterface)
-
-
Method Detail
-
getPmdCpResponseQueue
final LinkedBlockingQueue<Pair<ByteArray, Integer>> getPmdCpResponseQueue()
-
getCurrentSettings
final Map<PmdMeasurementType, PmdSetting> getCurrentSettings()
-
getPreviousFrameTimeStamp
final ULong getPreviousFrameTimeStamp(PmdMeasurementType type, PmdDataFrame.PmdDataFrameType frameType)
-
processServiceData
Unit processServiceData(UUID characteristic, ByteArray data, Integer status, Boolean notifying)
Callback for GATT service characteristic data processing
- Parameters:
characteristic- characteristic UUIDdata- data in byte arraystatus- status code of processed datanotifying- if true data is notification data from GATT service
-
processServiceDataWritten
Unit processServiceDataWritten(UUID characteristic, Integer status)
-
querySettings
final PmdSetting querySettings(PmdMeasurementType type, PmdRecordingType recordingType)
Query settings by type
- Returns:
PmdSetting on success, throws on error
-
queryFullSettings
final PmdSetting queryFullSettings(PmdMeasurementType type, PmdRecordingType recordingType)
Query full settings by type
- Returns:
PmdSetting on success, throws on error
-
readFeature
final Set<PmdMeasurementType> readFeature(Boolean checkConnection)
Read available PMD measurement types from device feature data.
- Returns:
Set of PmdMeasurementType on success, throws on error
-
startMeasurement
final <Error class: unknown class> startMeasurement(PmdMeasurementType type, PmdSetting setting, PmdRecordingType recordingType, PmdSecret secret)
Start measurement of the given type.
-
readMeasurementStatus
final Map<PmdMeasurementType, PmdActiveMeasurement> readMeasurementStatus()
Read current measurement status from device.
- Returns:
-
waitForMeasurementInactive
final <Error class: unknown class> waitForMeasurementInactive(PmdMeasurementType type, Long pollIntervalMs, Long timeoutMs)
Poll measurement status until the given type is inactive or timeout is reached.
-
startSDKMode
final <Error class: unknown class> startSDKMode()
Request to start SDK mode.
-
stopSDKMode
final <Error class: unknown class> stopSDKMode()
Request to stop SDK mode.
-
stopMeasurement
final <Error class: unknown class> stopMeasurement(PmdMeasurementType type)
Request to stop measurement.
- Parameters:
type- measurement to stop
-
clientReady
Unit clientReady(Boolean checkConnection)
-
-
-
-