Class: Toybox.BluetoothLowEnergy.BleDelegate

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.

Since:

API Level 3.1.0

Instance Method Summary collapse

Instance Method Details

initialize()

Constructor

Since:

API Level 3.1.0

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.

Parameters:

Since:

API Level 3.1.0

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.

Parameters:

Since:

API Level 3.1.0

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.

Parameters:

Since:

API Level 3.1.0

onConnectedStateChanged(device as BluetoothLowEnergy.Device, state as BluetoothLowEnergy.ConnectionState) as Void

After pairing a device this will be called after the connection is made

Parameters:

Since:

API Level 3.1.0

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.

Parameters:

Since:

API Level 3.1.0

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.

Parameters:

Since:

API Level 3.1.0

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.

Parameters:

Supported Devices:

Since:

API Level 4.2.5

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

Parameters:

Since:

API Level 3.1.0

onScanResults(scanResults as BluetoothLowEnergy.Iterator) as Void

If a scan is running this will be called when new ScanResults are received

Parameters:

Since:

API Level 3.1.0

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().

Parameters:

Since:

API Level 3.1.0


Generated Dec 11, 2024, 8:58:42 AM