BLE operations that are "top level" (not performed on a device) are not generally queued. This can cause problems if BLE is off and two operations are called in sequence before waiting for the first to complete. It would be more stable to queue top level operations.
In addition, callbacks should be added to functions that are missing callbacks, like stopScan and also close (check if there are more).
This would make for a cleaner flow of control and make it possible to pass error messages to the functions.
Also see the TODO comment in BLE.java in function stopScan.
BLE operations that are "top level" (not performed on a device) are not generally queued. This can cause problems if BLE is off and two operations are called in sequence before waiting for the first to complete. It would be more stable to queue top level operations.
In addition, callbacks should be added to functions that are missing callbacks, like stopScan and also close (check if there are more).
This would make for a cleaner flow of control and make it possible to pass error messages to the functions.
Also see the TODO comment in BLE.java in function stopScan.