RemoteCharacteristic
A GATT characteristic of a service on a remote connected peripheral device.
The API allows to access the value of the characteristic.
Depending on the properties of the characteristic, it may be possible to read, write, subscribe for value changes, etc.
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Enables notifications or indications, depending on the characteristic's properties.
Link copied to clipboard
abstract fun subscribe(onSubscription: suspend RemoteCharacteristic.() -> Unit = {}): Flow<ByteArray>
Subscribes for notifications or indications of the characteristic.
Link copied to clipboard
abstract suspend fun waitForValueChange(rawDataFilter: (ByteArray) -> Boolean = { true }, merge: suspend (accumulator: ByteArray, received: ByteArray, index: Int) -> MergeResult = { _, rec, _ -> MergeResult.Completed(rec) }, filter: (ByteArray) -> Boolean = { true }, trigger: suspend RemoteCharacteristic.() -> Unit = {}): ByteArray
Waits for the value of the characteristic to change.