readOrNull

suspend fun <T> readOrNull(deserializationStrategy: DeserializationStrategy<T>, bluetoothFormat: BluetoothFormat = BluetoothFormat): T?

Requests a read of the a value of T of the attribute from the device and suspends until the value is received.

Return

the value of type T received from the device, or null if the request failed

Parameters

deserializationStrategy

the DeserializationStrategy to use to deserialize the value

bluetoothFormat

the BluetoothFormat to use to deserialize the value

Type Parameters

T

the type of the data object to read


inline suspend fun <T> readOrNull(bluetoothFormat: BluetoothFormat = BluetoothFormat): T?

Requests a read of the a value of T of the attribute from the device and suspends until the value is received.

Return

the value of type T received from the device, or null if the request failed

Parameters

bluetoothFormat

the BluetoothFormat to use to deserialize the value

Type Parameters

T

the type of the data object to read