-
Notifications
You must be signed in to change notification settings - Fork 334
Description
Hi!
To avoid stale connections, I thought (and I think I have seen an example like this) that it is a good idea to always call disconnect() on a BleakClient to avoid stale connection before connecting again. I did so in my code
https://github.com/patman15/aiobmsble/blob/7c0ea3e3220745a3d98ef10c532602fee2726099/aiobmsble/basebms.py#L331-L343
I didn't find any hints in the user manual whether this is allowed or not, so I checked the bluezdbus implementation which is safe. Unfortunately, I now found out that the WinRT implementation has an assert that raises in case the client is not connected.
Thus, my question(s): should the behavior be identical, if so, which way? If not, should it be documented, that the application needs to check the connection state? (Honestly, I considered the way that I always can call disconnect() very handy!)
Thanks,
Patrick