Extremely low timeout for bluetooth pairing on win11 #1528
Labels
3rd party issue
The issue is with the Bluetooth stack, the BLE device, or other 3rd party code not with Bleak itself
Backend: WinRT
Issues or PRs relating to the WinRT backend
Description
When trying to pair with a bluetooth device the timeout to accept the connection using the system dialog is extremely short (<2 seconds). When the dialog is not confirmed basically instantly I get various errors.
This problem is not present on windows 10 or at least much less pronounced.
What I Did
Execute this script, the bluetooth pairing request notification appears after 2 seconds.
When waiting for 2 seconds before accepting it,
unpair and disconnect
is printed and the errorCould not pair with device: 15
is raised. Sometimes the error code isCould not pair with device: 19
instead. According to the microsoft doc these correspond to15 = OperationAlreadyInProgress
,19 = Failed
.Here is the first error with enabled logging:
Here is the error which also occurs sometimes:
When accepting the dialog very quickly the script behaves as expected, but the timeout of <2 seconds is unreasonably short.
Is this error caused by improper usage of the library, or is this an issue with the backend on windows 11?
I already tried adding a timeout value of 30 when creating the bleak.BleakClient, but that did not make any difference.
The text was updated successfully, but these errors were encountered: