This repository has been archived by the owner on Dec 20, 2019. It is now read-only.
Feature/enhance connection to multiple ble devices #89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As described in #81 there are issues connecting multiple devices. In fact, shortly before the first connection attempt scanning is stopped adaptors/ble.js#88. Commenting it out (as mentioend in #81) yields "noble warnings" with the sphero's BLE adapter :
noble warning: unknown peripheral xxxxxxxxxxxx
Problem
Some BLE adapters cannot connect to peripheral when in scanning mode. The following minimal noble script:
... will cause the follwoing error messages:
Error: Command disallowed
Error: Connection Rejected due to Limited Resources (0xd)
See more at noble's pull#638 or issue#35
Solution
This pull request stops scanning before an attempt to connect, and, when conencted, initiate further scanning. Tested with both physical BLE adapters (mentioned above) and works reliable.
Tested with the following minimal scripts:
minimal script 1
minimal script 2
Like the Conway's Game example.
Issue
I have only access to the two BLE devices mentioned above, no device present which may have worked anyway. Needs further testing.