deviceplug / btleplug

Rust Cross-Platform Host-Side Bluetooth LE Access Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Peripheral.Connect halts on windows 11

mrhatman opened this issue · comments

Describe the bug
When attempting to connect to a BLE device on Windows 11 it stalls out forever.

Expected behavior
peripheral.connect().await should connect or return an error but on windows 11 it does not.

Additional context
The exact same codebase runs on multiple Windows 10 laptops and fails across multiple windows 11 laptops( across multiple companies too)

I have tried updating the windows crate to version 0.46.0 (latest) and I tried pull number #269 with no luck on either device.

I've encountered a deadlock on Peripheral.connect() on Windows 11 as well. It doesn't happen on initial connection, but it seems to occur if the device moves out of range and my handling logic attempts to reconnect on return.

I look a screenshot of tokio-console with the deadlock:

Screenshot 2023-10-19 002350

In particular, I already wrapped this connect call in a tokio::time::timeout, which you can see at the top of the screenshot.