Set how commands will be executed. By default, all commands are executed in a global queue (QueueType.global),
with each command waiting for the previous one to finish.
Clear a queue.
Use BleCommandQueue.globalQueueId to clear the global queue.
To clear the queue of a specific device, use deviceId as id.
If no id is provided, all queues will be cleared.
Connect to a device.
It is advised to stop scanning before connecting.
It throws error if device connection fails.
Default connection timeout is 60 sec.
Can throw ConnectionException or PlatformException.
Returns connection state of the device.
All platforms will return Connected/Disconnected states.
Android and Apple can also return Connecting/Disconnecting states.
Get connected devices to the system (connected by any app).
Use withServices to filter devices by services.
On Apple, withServices is required to get any connected devices. If not passed, several 18XX generic services will be set by default.
On Android, Linux and Windows, if withServices is used, then internally all services will be discovered for each device first (either by connecting or by using cached services).
Not supported on Web.
receivesAdvertisements returns true on web if the browser supports receiving advertisements from a certain deviceId.
The rest of the platforms will always return true.
If true, then you will be getting scanResult updates for this device.
Request MTU value.
It will attempt to set the MTU (Maximum Transmission Unit) but it is not guaranteed to succeed due to platform limitations.
It will always return the current MTU.
Start scan.
Scan results will arrive in onScanResult listener.
It might throw errors if Bluetooth is not available.
webRequestOptions is supported on Web only.