Support two peripherals on F4 hubs#446
Closed
laurensvalk wants to merge 5 commits intobtstack-scan-connect-bondfrom
Closed
Support two peripherals on F4 hubs#446laurensvalk wants to merge 5 commits intobtstack-scan-connect-bondfrom
laurensvalk wants to merge 5 commits intobtstack-scan-connect-bondfrom
Conversation
The Virtual Hub as an actual Bluetooth implementation now, and we can use the USB mock for stdio, so we can drop this one.
694c352 to
034a5e1
Compare
Start getting rid of the singleton instance so we can eventually support more than one.
This completes the recent overhaul to clean up references to peripheral singletons. We keep supporting only one on Move Hub, City Hub, and Technic Hub due to hardware limitations with their Bluetooth chips.
034a5e1 to
076ca37
Compare
Member
Author
|
Merged into 076ca37 without changes, but GitHub won't register it due to the different base branch. |
Member
Author
|
There are a few things here that are still using singletons and should be moved into the peripheral instances:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This the follow up to #445 to enable more peripherals. This is only done for BTstack.
I think we can keep Technic/City/Move hub at one peripheral given their limitations.
The first commits are basically just replacing the
peripheral_singletonwith a pointer to an instance. The logic to make this possible was already done in #445.Perhaps the more interesting part for reviewing in this PR is this:
We are deleting the bonds every time so it's probably not necessary to have the lookup entries, but this isn't too expensive.
Bumping the HCI connections and GATT clients does need a fair bit of RAM, so this also does this:
14K works fine too. I picked 12K because we have that on Essential Hub too and it should still be far more than necessary. This should give us some room for static memory in future developments. (We could also reduce heap instead. We did increase it recently after all to have some heap left even if all slots are full.)