readAsync

fun readAsync(characteristic: String, callback: (ByteArray?) -> Unit)

Performs a read operation on a specific characteristic

Return

A nullable ByteArray, null when failed to read

Parameters

characteristic

The uuid of the target characteristic

See also

For a variation using coroutines suspended functions


fun readAsync(characteristic: String, charset: Charset, callback: (String?) -> Unit)

Performs a read operation on a specific characteristic

Return

A nullable String, null when failed to read

Parameters

characteristic

The uuid of the target characteristic

charset

The charset to decode the received bytes

See also

For a variation using coroutines suspended functions