Skip to content

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

Merged
chrvadala merged 1 commit into
chrvadala:mainfrom
altaircunhajr:main
Oct 28, 2022
Merged

Adding new method for listing all available (powered) adapters#45
chrvadala merged 1 commit into
chrvadala:mainfrom
altaircunhajr:main

Conversation

@altaircunhajr

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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.

3 participants