Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dlech
Copy link
Collaborator

@dlech dlech commented May 24, 2025

This reworks pairing on WinRT backend so that hopefully we no longer need the platform-specific protection_level argument.

Instead, the highest possible level is tried by default.

Also fixes a few minor bugs noticed while testing.

dlech added 6 commits May 24, 2025 11:54
We want to deprecate this, so it shouldn't be part of the public API.
It still works thanks to kwargs.
Apparently, can_pair is False if a device is already paired, so we need
to reverse the order of the checks in order to avoid raising an exception
when trying to pair a device that is already paired.
Recent versions of Python only print the int value of IntEnum. Printing
the name is more user-friendly.
Seems to be a bug in the WinRT API where the value returned by the
pairing status result is not updated unless we request a device info
update first.
This should remove the need for the protection_level kwarg.

Not sure if the retry is actually needed since on the device used for
testing, it connects at the ENCRYPTION level on the first try.
Now that the default behavior is to try to use the highest protection
level, there should no longer be a need to manually set the protection
level.
@dlech dlech merged commit 60f483f into hbldh:develop May 24, 2025
16 checks passed
@dlech dlech deleted the winrt-pair-args branch May 24, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant