Skip to content

settings subsystem enhancements #7413

Open
@jhedberg

Description

@jhedberg

It'd be nice to have the following improvements to the settings API:

  • 1. Remove SETTINGS_EXPORT_SHOW and the tgt 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 under bt/mesh/ could then be accomplished with something like settings_clear("bt/mesh/"), and settings_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 calling settings_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 currently SETTINGS_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 the settings_save_one() calls like I would in the export callback, however doing these through the export callback (invoked through a new settings_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.

Metadata

Metadata

Assignees

Labels

EnhancementChanges/Updates/Additions to existing featuresIn progressFor PRs: is work in progress and should not be merged yet. For issues: Is being worked onMetaA collection of features, enhancements or bugsNeeds reviewThis PR needs attention from Zephyr's maintainersarea: SettingsSettings subsystem

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions