WIP: extmod/btstack: Add support for persistant bonding. #6312
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 is less finished than #6289 but does add basic support for persistent bonding.
It's based heavily on initial work by @jimmo to bring in most of the pairing infrastructure for btstack, with additional commits to add the filesystem interface for persistent bonding.
It does not use the same json backed file storage as my nimble PR above, opting at this stage to re-use btstack's own file format with updated bindings to the micropython file system.
Most btstack bonding ports use their "tlv" based storage system. A good portion of this relies on malloc/free however, for which there isn't currently an implementation set up for btstack. If btstack gets a similar dynamic memory allocator as nimble, this config system would likely be more reliable/performant based on my initial investigating - bindings to use tlv are included in this branch.
The currently enabled bindings however are based on a simpler single-file bonding interface picked from one of the posix ports: https://github.com/bluekitchen/btstack/blob/f07720a033c9fcfa856511634253b9889fa94cd8/platform/posix/le_device_db_fs.c