read

suspend fun read(characteristic: String): ByteArray?

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 variant that returns a String value

For a variation using callbacks


suspend fun read(characteristic: String, charset: Charset = Charsets.UTF_8): String?

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 variant that returns a ByteArray value

For a variation using callbacks