dataFlow

fun Flow<ConnectableDevice?>.dataFlow(serviceUUID: String, characteristicUUID: String): Flow<ByteArray>

Provides access to device data flow by service and characteristic string uuids. Only emits after services have been discovered.

Return

the Flow of the ByteArray value of the RemoteCharacteristic associated with serviceUUID and characteristicUUID. Flow throws NoSuchElementException if the characteristic cannot be found after discovery.

Parameters

serviceUUID

string service uuid representation

characteristicUUID

string characteristic uuid representation

Throws


inline fun <T> Flow<ConnectableDevice?>.dataFlow(serviceUUID: String, characteristicUUID: String, deserializationStrategy: DeserializationStrategy<T>, bluetoothFormat: BluetoothFormat = BluetoothFormat): Flow<T>

Provides access to device data flow T by service and characteristic string uuids. Only emits after services have been discovered.

Return

the Flow of the T value of the RemoteCharacteristic associated with serviceUUID and characteristicUUID. Flow throws NoSuchElementException if the characteristic cannot be found after discovery.

Parameters

serviceUUID

string service uuid representation

characteristicUUID

string characteristic uuid representation

deserializationStrategy

the DeserializationStrategy to use to deserialize the ByteArray to T

bluetoothFormat

the BluetoothFormat to use to deserialize the ByteArray to T

Type Parameters

T

the type of the data to receive

Throws