Class: Toybox.BluetoothLowEnergy.BleDelegate
- Inherits:
-
Toybox.Lang.Object
Overview
Delegate Class for Bluetooth Low Energy Callbacks.
Applications must extend this Class and register an instance with the BLE Subsystem using setDelegate() to support asynchronous operations.
Instance Method Summary collapse
-
initialize()
Constructor.
-
onCharacteristicChanged(characteristic as BluetoothLowEnergy.Characteristic, value as Lang.ByteArray) as Void
After enabling notifications or indications on a characteristic by enabling the appropriate bit of the CCCD of the characteristic this function will be called after every change to the characteristic.
-
onCharacteristicRead(characteristic as BluetoothLowEnergy.Characteristic, status as BluetoothLowEnergy.Status, value as Lang.ByteArray) as Void
After requesting a read operation on a Characteristic with requestRead(), this function will be called when the operation is completed.
-
onCharacteristicWrite(characteristic as BluetoothLowEnergy.Characteristic, status as BluetoothLowEnergy.Status) as Void
After requesting a write operation on a Characteristic with requestWrite(), this function will be called when the operation is completed.
-
onConnectedStateChanged(device as BluetoothLowEnergy.Device, state as BluetoothLowEnergy.ConnectionState) as Void
After pairing a device this will be called after the connection is made.
-
onDescriptorRead(descriptor as BluetoothLowEnergy.Descriptor, status as BluetoothLowEnergy.Status, value as Lang.ByteArray) as Void
After requesting a read operation on a Descriptor with requestRead() this function will be called when the operation is completed.
-
onDescriptorWrite(descriptor as BluetoothLowEnergy.Descriptor, status as BluetoothLowEnergy.Status) as Void
After requesting a write operation on a Descriptor with requestWrite() this function will be called when the operation is completed.
-
onEncryptionStatus(device as BluetoothLowEnergy.Device, status as BluetoothLowEnergy.Status) as Void
After requesting a new bond or reconnecting to a device with a previously established bond, this function will be called with the current encryption status.
-
onProfileRegister(uuid as BluetoothLowEnergy.Uuid, status as BluetoothLowEnergy.Status) as Void
After Registering a UUID this callback will notify of the result of the registration request.
-
onScanResults(scanResults as BluetoothLowEnergy.Iterator) as Void
If a scan is running this will be called when new ScanResults are received.
-
onScanStateChange(scanState as BluetoothLowEnergy.ScanState, status as BluetoothLowEnergy.Status) as Void
When the state of scanning is modified the system will call this function with the new state and a status indicating the result of the last call to setScanState().
Instance Method Details
initialize()
Constructor
onCharacteristicChanged(characteristic as BluetoothLowEnergy.Characteristic, value as Lang.ByteArray) as Void
After enabling notifications or indications on a characteristic by enabling the appropriate bit of the CCCD of the characteristic this function will be called after every change to the characteristic.
onCharacteristicRead(characteristic as BluetoothLowEnergy.Characteristic, status as BluetoothLowEnergy.Status, value as Lang.ByteArray) as Void
After requesting a read operation on a Characteristic with requestRead(), this function will be called when the operation is completed.
onCharacteristicWrite(characteristic as BluetoothLowEnergy.Characteristic, status as BluetoothLowEnergy.Status) as Void
After requesting a write operation on a Characteristic with requestWrite(), this function will be called when the operation is completed.
onConnectedStateChanged(device as BluetoothLowEnergy.Device, state as BluetoothLowEnergy.ConnectionState) as Void
After pairing a device this will be called after the connection is made
onDescriptorRead(descriptor as BluetoothLowEnergy.Descriptor, status as BluetoothLowEnergy.Status, value as Lang.ByteArray) as Void
After requesting a read operation on a Descriptor with requestRead() this function will be called when the operation is completed.
onDescriptorWrite(descriptor as BluetoothLowEnergy.Descriptor, status as BluetoothLowEnergy.Status) as Void
After requesting a write operation on a Descriptor with requestWrite() this function will be called when the operation is completed.
onEncryptionStatus(device as BluetoothLowEnergy.Device, status as BluetoothLowEnergy.Status) as Void
After requesting a new bond or reconnecting to a device with a previously established bond, this function will be called with the current encryption status.
onProfileRegister(uuid as BluetoothLowEnergy.Uuid, status as BluetoothLowEnergy.Status) as Void
After Registering a UUID this callback will notify of the result of the registration request
onScanResults(scanResults as BluetoothLowEnergy.Iterator) as Void
If a scan is running this will be called when new ScanResults are received
onScanStateChange(scanState as BluetoothLowEnergy.ScanState, status as BluetoothLowEnergy.Status) as Void
When the state of scanning is modified the system will call this function with the new state and a status indicating the result of the last call to setScanState().