Disconnect and Exiting #549
Unanswered
JBrakefield
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Don't cancel all tasks unless you actually want the program to exit. I don't think you can reconnect without scanning again in Bleak currently, so I don't think it is possible to do this in the disconnect handler. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can't get my script to exit "gracefully" despite much research on the subject. My program pairs to a BLE device and communicates between it and a serial port. I am using the recommended method from the uart example to call the main function like this:
My disconnect handle looks like this:
Why do I still get a "KeyboardInterrupt" error when I use ctrl+c? I need to call this script as a module in a GUI that I'm building, and I need multiple instances going at once (connect to more than one BLE device at a time). I am having issues with BLE disconnecting without warning, and any attempt I have made to reconnect (by putting new connection code inside the handle_disconnect) has failed. Is there an example of reconnection after unexpected disconnection? If my disconnect handle cancels all tasks, could this interrupt another BLE connection instance?
Beta Was this translation helpful? Give feedback.
All reactions