[RFC] Proposal around settings cli tool #2114
Labels
Build System
make/bash/python, github CI/CD & pals.
Enhancement
New feature or additional function.
Usability
UX, Usability and/or Design.
Milestone
Writing this idea up for comments / planning.
This is a spin out from #1477 and #1776 in a way.
Generate settings code from yaml
Proposal is to store all the available settings options in a somewhat human friendly yaml file.
So this file would loosely have entries like
So we can take the contents from this file, parse it, then generate the main content of
Settings.h
andSettings.cpp
.Thinking along the same line as translations where we just generate normal c/cpp files and add them to the build. Rather than try and manipulate anything fancy.
This could then allow us to remove settings entries that do not apply to a model by having some filters defined on the entries.
This yaml file can then also be parsed any used by other projects that interact with the settings options over BLE for example.
We could also maybe export filtered "final" settings files in the per-device release zip files potentially
Generating and parsing setting files
Once we have all the settings into a nicer to work with format, we can make a basic script that can load and save "user settings" to/from a binary file.
Since settings are just encoded as a flat in-flash array of uint16_t values we can just generate this binary blob.
For the code to generate .bin/.hex/.dfu files from this blob, I've already made python code to do a lot of this we can re-use.
For loading these files its roughly going to be the reverse.
We can provide example commands for
dfu-util
andblisp
to dump the area of flash the settings are in.I view loading settings from a device as a "bonus" feature, and not required
The text was updated successfully, but these errors were encountered: