read

abstract suspend fun read(characteristic: Characteristic): ByteArray

Reads data from characteristic.

If characteristic was created via characteristicOf then the first found characteristic with Read property matching the service UUID and characteristic UUID in the GATT profile will be used. If multiple characteristics with the same UUID and Read characteristic property exist in the GATT profile, then a discovered characteristic from services should be used instead.

Throws

if invoked without an established connection.


abstract suspend fun read(descriptor: Descriptor): ByteArray

Reads data from descriptor.

If descriptor was created via descriptorOf then the first found descriptor (matching the service UUID, characteristic UUID and descriptor UUID) in the GATT profile will be used. If multiple descriptors with the same UUID exist in the GATT profile, then a discovered descriptor from services should be used instead.

Throws

if invoked without an established connection.