Add clear queue api (#171)

* Add clear queue api

* Minor improvement

* Update changelog

---------

Co-authored-by: Foti Dim <foti@navideck.com>
This commit is contained in:
Rohit Sangwan
2025-07-16 16:06:39 +05:30
committed by GitHub
parent 0f4bae71e1
commit 71e19988a9
4 changed files with 25 additions and 0 deletions
+8
View File
@@ -420,6 +420,14 @@ UniversalBle.onQueueUpdate = (String id, int remainingItems) {
};
```
To clear the queue:
```dart
/// 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.
UniversalBle.clearQueue(BleCommandQueue.globalQueueId);
```
## Timeout
By default, all commands have a global timeout of 10 seconds.