Skip to content

fix: device rediscovery issue when name changes #9

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EemilAhonen
Copy link

Summary: Addressing Device Rediscovery Bug

This merge request resolves a bug that prevents devices from being processed correctly when they are rediscovered with their correct names. Previously, when a device was found with an incorrect name, the system would not handle it properly during subsequent rediscovery attempts.

Issue Details

In approximately 50% of cases, the deviceInquiryDeviceFound function is called with the device name being a MAC address: "Found peer <CBClassicPeer: 0xXXXXXXXXX XXXXXXXXXXXXXXXX, XX:XX:XX:XX:XX:XX" instead of the expected: "Found peer <CBClassicPeer: 0xXXXXXXXXX XXXXXXXXXXXXXXXX, Nintendo RVL-CNT-01".

When the sync continues and the correct name for the device is found, the deviceInquiryDeviceFound doesn't get retriggered because the device is in the found devices list. You have to restart the app for it to work again.

Proposed Solution

I suggest clearing the list of found devices after the device is skipped. With a build with this fix I can connect to the wiimote 100% of the times instead of the previous 50%.

Fixes a bug where devices found with a different name were not processed when rediscovered with the correct name. The list of found devices is now cleared after each discovery, allowing for proper rediscovery.
@EemilAhonen
Copy link
Author

@OatmealDome Feel free to contact me at keisarimail(at)gmail.com.
I'm working on some other fixes for this project as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant