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

Fixing the missing devices when discovering for the first time. Fixes #151 #157

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

Conversation

ncdm-stldr
Copy link

The first time one call startDiscovery(), some results are lost and not sent through the stream returned by startDiscovery.
After investigation, it appeared to me this happens because the plugin calls _methodChannel.invokeMethod('startDiscovery'); before listening to the EventChannel _discoveryChannel.
Therefore I switched the two code blocks. I also added something to prevent the following situation:

  • We listen to the _discoveryChannel EventChannel.
  • An past discovery finishes now which triggers the onDone method of the subsciption we just created
  • We start a discovery.
  • We return a closed empty stream which will never receive the result of the new discovery

@ncdm-stldr
Copy link
Author

Note that to reproduce the issue, one can simply run the example application of the plugin, then explore the scanned devices: the first time we click on the button, we do not see all the devices. We can however see some devices in the logs which are not displayed because startDiscovery doesn't return them.

@ncdm-stldr
Copy link
Author

ncdm-stldr commented Oct 5, 2022

@DanielLimaFN
Hi,
Thank you the review.
Is this repository still maintained?
It seems that there are a lots of people that would be interested to contribute to the project. For example there are at least 5 forks (including yours) that support android 12.
Is there already another repository that replaced the one from edufolly?

@edufolly edufolly added the good first issue Good for newcomers label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants