Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Services not refreshed on Windows 11 #1639

Open
mplantey-io opened this issue Sep 24, 2024 · 1 comment
Open

Services not refreshed on Windows 11 #1639

mplantey-io opened this issue Sep 24, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@mplantey-io
Copy link

  • bleak version: 0.22.2
  • Python version: 3.12.6
  • Operating System: Windows 11

Description

We need to connect to a BLE device, previously scanned.
We connect successfully. Then enable the notify on SERVICE_CHANGED.
We send a secret through one characteristic automatically discovered when connected.
This secret activate a bunch of new services/characteristics.
So we need to update the local view of the services when receiving SERVICE_CHANGED event.

What I Did

On linux, we discovered that trying to open a second connection to the device forces the services discovery, even if we get an error from the python script.
On windows, we tried the same trick and we are just stuck without any error when creating the second connection to the same device.

After that, anyway, we can't disconnect. And we need a proper disconnection.
When trying to disconnect, nothing happens.

In case we don't create a new parallel connection, we cannot access to the new services and we are stuck in the usage.

I know it seems OS specific but with Windows 11 it becomes difficult to capture logs. I'm trying to use Wireshark but nothing goes right, for now.

If you have any hint on how I can solve this, I would be very grateful.

Thanks,

@dlech
Copy link
Collaborator

dlech commented Sep 24, 2024

Thanks for the report. This is the first time, if I recall correctly, we've had an actual use case for the services changed event like this.

I would be nice to find a nicer way to handle this. It would be helpful if I could get my hands on some hardware that works like this for testing.

@dlech dlech added the enhancement New feature or request label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants