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

Adding new method for listing all available (powered) adapters #45

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

altaircunhajr
Copy link
Contributor

Context:

In machines with multiple bluetooth adapters, the method defaultAdapter (Bluetooth.js) considers all adapters, regardless of their power status, and returns the first item of the list. This behavior is causing errors in client code when the first adapter (hci0) is offline.

To avoid breaking the current behavior of defaultAdapter, I created a new method, activeAdapters, which will return the list of usable (isPowered == true) adapters. Then the client is able to choose which adapter to use.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 95.963% when pulling 7cd09de on altaircunhajr:main into eb20e9c on chrvadala:main.

@chrvadala chrvadala merged commit 4c7f575 into chrvadala:main Oct 28, 2022
@chrvadala
Copy link
Owner

Released with 1.8.0 and added @altaircunhajr in contributors list.
Thanks for this PR

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.

None yet

3 participants