Replies: 1 comment 4 replies
-
|
I also have basically this exact same problem and have no idea how to solve it 😢 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a project based on GUI, that interacts with BLE device (device is not commercially avaiable). I use mainly Windows 10, but it works with Windows 11 too. I connect and disconnect with device with async functions:
It works most of the time. Problem raises when:
a) device disconnects and connects again (this happens on lower levels of software than I reach)
b) device reset itself
After those, even though low-level code does reconnecting, my functions and Bleak objects are "dead". I canot send or receive GATT service and sometimes I get
WinError -2147467260. This is a huge problem, because one of functions is reset after sending GATT service. It means, that ideally, after reset everything should get "reconnected". The device gets reconnected not openly (by Bleak or by Windows driver, I do not know). How can I get new object after this hiden reconnect?I do know, which device did reset (by MAC address), but I do not know how to invoke this hidden new Bleak (?) client. If I create client with
BleakClient(address, disconnected_callback=self._disconnect_callback)it is not the same client object, that got reconnected.I do know that in different languages and on Android you can easily get this kind of "reconnect" event or control it. I do want to know how to do this with Bleak library on Windows. And I do not want to do disconnect and connect on my own, as it takes time and is something completely different for my application than auto-reconnect. I assume there is a some kind of data container in Bleak library, where all clients reside. From this data container I could receive proper, new object. Without proper client object I cannot use my app further. But I do not know what or where is it (or how to access it).
Anyone can give my any tip?
Beta Was this translation helpful? Give feedback.
All reactions