BluetoothDelegate

class BluetoothDelegate(val callback: (DeviceEvent, BluetoothPeripheral, Any?) -> Unit) : BlueFalconDelegate

A delegate implementation for handling Bluetooth events using the BlueFalcon library.

Constructors

Link copied to clipboard
constructor(callback: (DeviceEvent, BluetoothPeripheral, Any?) -> Unit)

Properties

Link copied to clipboard
val callback: (DeviceEvent, BluetoothPeripheral, Any?) -> Unit

A function to receive Bluetooth DeviceEvents with the associated BluetoothPeripheral and optional data.

Functions

Link copied to clipboard
open override fun didCharacteristcValueChanged(bluetoothPeripheral: BluetoothPeripheral, bluetoothCharacteristic: BluetoothCharacteristic)

Called when the value of a Bluetooth characteristic changes.

Link copied to clipboard
open override fun didConnect(bluetoothPeripheral: BluetoothPeripheral)

Called when a connection to a Bluetooth peripheral is established.

Link copied to clipboard
open override fun didDisconnect(bluetoothPeripheral: BluetoothPeripheral)

Called when a Bluetooth peripheral is disconnected.

Link copied to clipboard
open override fun didDiscoverCharacteristics(bluetoothPeripheral: BluetoothPeripheral)

Called when characteristics are discovered on the peripheral.

Link copied to clipboard
open override fun didDiscoverServices(bluetoothPeripheral: BluetoothPeripheral)

Called when services are discovered on the peripheral.

Link copied to clipboard
open override fun didReadDescriptor(bluetoothPeripheral: BluetoothPeripheral, bluetoothCharacteristicDescriptor: BluetoothCharacteristicDescriptor)

Called when a Bluetooth descriptor is read.

Link copied to clipboard
open override fun didRssiUpdate(bluetoothPeripheral: BluetoothPeripheral)

Called when the RSSI value is updated. This implementation ignores it.

Link copied to clipboard
open override fun didUpdateMTU(bluetoothPeripheral: BluetoothPeripheral)

Called when the MTU (Maximum Transmission Unit) is updated.

Link copied to clipboard
open override fun didWriteCharacteristic(bluetoothPeripheral: BluetoothPeripheral, bluetoothCharacteristic: BluetoothCharacteristic, success: Boolean)

Called when a characteristic is written.

Link copied to clipboard
open override fun didWriteDescriptor(bluetoothPeripheral: BluetoothPeripheral, bluetoothCharacteristicDescriptor: BluetoothCharacteristicDescriptor)

Called when a descriptor is written.