I work with multiple devices and automatically handle my own reconnects if a device is lost (swappable batteries means it could disconnect but the user would want to pick up where they left off when a new battery goes in).
In some cases I would then want to cancel connecting and forcibly disconnect the device but disconnect() does nothing if connect() is still running. If connect() could return an object that could then also be cancelled that would allow me to force it to disconnect when needed.
I am conscious that this may not be possible but a Quick Look in to the Java code suggested there was a variable for currentlyConnectingDevices.
Alternatively maybe disconnect() could check if the devices is in the currentlyConnectingDevices and subsequently cancel this.
FlutterBluePlus Version
1.30.6
Flutter Version
3.16.5
What OS?
All
OS Version
Android 13 / iOS 16
Bluetooth Module
N/A
What is your feature request?
I work with multiple devices and automatically handle my own reconnects if a device is lost (swappable batteries means it could disconnect but the user would want to pick up where they left off when a new battery goes in).
In some cases I would then want to cancel connecting and forcibly disconnect the device but disconnect() does nothing if connect() is still running. If connect() could return an object that could then also be cancelled that would allow me to force it to disconnect when needed.
I am conscious that this may not be possible but a Quick Look in to the Java code suggested there was a variable for currentlyConnectingDevices.
Alternatively maybe disconnect() could check if the devices is in the currentlyConnectingDevices and subsequently cancel this.
Logs