notify

suspend fun notify(device: ConnectedDevice, value: ByteArray): Boolean

Notifies a com.splendo.kaluga.bluetooth.ConnectedDevice that that the data changed to value

Return

true if the notification was successful, false otherwise

Parameters

device

the com.splendo.kaluga.bluetooth.ConnectedDevice that should be notified

value

the new data


suspend fun <Notification> notify(device: ConnectedDevice, notification: Notification, toByteArray: Notification.() -> ByteArray): Boolean

Notifies a com.splendo.kaluga.bluetooth.ConnectedDevice that that the data changed to notification

Return

true if the notification was successful, false otherwise

Parameters

device

the com.splendo.kaluga.bluetooth.ConnectedDevice that should be notified

notification

the new data

toByteArray

method to convert the Notification to a ByteArray

Type Parameters

Notification

the type of the data to notify


suspend fun <Notification> notify(device: ConnectedDevice, notification: Notification, serializationStrategy: SerializationStrategy<Notification>, bluetoothFormat: BluetoothFormat = BluetoothFormat): Boolean

Notifies a com.splendo.kaluga.bluetooth.ConnectedDevice that that the data changed to notification

Return

true if the notification was successful, false otherwise

Parameters

device

the com.splendo.kaluga.bluetooth.ConnectedDevice that should be notified

notification

the new data

serializationStrategy

the SerializationStrategy to use to encode the Notification to a ByteArray

bluetoothFormat

the BluetoothFormat to use to encode the Notification to a ByteArray

Type Parameters

Notification

the type of the data to notify


inline suspend fun <Notification> notify(device: ConnectedDevice, notification: Notification, bluetoothFormat: BluetoothFormat = BluetoothFormat): Boolean

Notifies a com.splendo.kaluga.bluetooth.ConnectedDevice that that the data changed to notification

Return

true if the notification was successful, false otherwise

Parameters

device

the com.splendo.kaluga.bluetooth.ConnectedDevice that should be notified

notification

the new data

bluetoothFormat

the BluetoothFormat to use to encode the Notification to a ByteArray

Type Parameters

Notification

the type of the data to notify