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

Link copied to clipboard
Link copied to clipboard
abstract val instanceId: Int
Link copied to clipboard
abstract val isNotifying: Boolean

Returns whether the characteristic is notifying or indicating.

Link copied to clipboard
open override val owner: Peripheral<*, *>?
Link copied to clipboard
Link copied to clipboard
abstract override val service: AnyRemoteService
Link copied to clipboard
abstract val uuid: Uuid

Functions

Link copied to clipboard
abstract suspend fun read(): ByteArray

Reads the value of the characteristic.

Link copied to clipboard
abstract suspend fun setNotifying(enabled: Boolean)

Sets notifications or indications state, depending on the characteristic's properties.

Link copied to clipboard
abstract suspend fun subscribe(): Flow<ByteArray>

Subscribes for notifications or indications of the characteristic.

Link copied to clipboard
abstract suspend fun waitForValueChange(): ByteArray

Waits for the value of the characteristic to change.

Link copied to clipboard
abstract suspend fun write(data: ByteArray, writeType: WriteType)

Writes the value of the characteristic.