Open
Description
It'd be nice to have the following improvements to the settings API:
- 1. Remove
SETTINGS_EXPORT_SHOW
and thetgt
parameter to the export callback - 2. Reduce stack consumption
- 3. Remove 256-byte value length limitation
- 4. Provide stream-style encoding and decoding to/from flash, so the the API only requires a pointer to binary data, and the settings implementation takes care of encoding/decoding to/from base64 and writing/reading to/from flash on the fly. This would eliminate the need of a separate base64 value buffer on the app-side, thereby further contributing to the stack footprint reduction.
- 5. Provide a way to clear an entire sub-path of key-value pairs, e.g. the equivalent of calling
settings_save_one(key, NULL)
for every key underbt/mesh/
could then be accomplished with something likesettings_clear("bt/mesh/")
, andsettings_clear(NULL)
would clear the entire settings storage. If we want to make this API multi-purpose, it could interpret a key ending in/
as a sub-path and one without it as a key in itself, i.e. the equivalent of callingsettings_save_one(key, NULL)
(but more intuitive looking). - 6. Consider removing
enum settings_type
and have all app-side data treated as a byte array (i.e. what's currentlySETTINGS_BYTES
) - 7. Add support for performing an export on a sub-path. E.g. I'm interested in storing all pending mesh values, i.e. those under the sub-path
bt/mesh/
. Right now I'm having to do thesettings_save_one()
calls like I would in the export callback, however doing these through the export callback (invoked through a newsettings_save_path("bt/mesh/")
call or similar) may be more efficient just like the existing export procedure is - e.g. with NFFS there's then just a single file open and a single file close, instead of multiple ones.