Android-BLE-Library
Android-BLE-Library copied to clipboard
Add option to prioritise requests in the queue
Is there a way to get the length of the current queue and whether there is a way to jump the queue? For example, I want to improve the priority of some commands.
Hello, in the current version you may only clear the queue using https://github.com/NordicSemiconductor/Android-BLE-Library/blob/5f340654329ec1fd4878ba9ee34c8087ba910116/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java#L1980
Hello,
I'm thinking of a method to enqueue to the front of the queue. Would that help you? Modification of the order of the already enqueued packets seems dangerous.
Related: #218
I was thinking about the feature request. Adding something like enqueueFirst()
would also imply adding similar methods with await()
and suspend()
in the ktx module, but some issues may arise there. Let's say someone is using suspend()
methods, which end when the request end. If a user then calls suspendFirst()
or alike, the manager could have already taken next request. I'll need to think more about it.
This is very useful to me, is there any development plan for this feature now?
Currently not. May I ask why do you need this method? What is the use case. We may consider changing priorities.