IRNAS / irnas-usersettings-lib

User settings library for Zephyr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Settings versioning

TjazVracko opened this issue · comments

Context

With the current implementation, after a product is released, its settings and default values are fixed. Only new settings can be added. Keys and IDs of existing settings must never be changed or removed.

We could add a version field, which will version the whole "settings package" of a device. Whenever the version changes, the lib can do one of the following:

  1. Delete all existing settings and values and store new settings with default values
  2. Perform some kind of "diff" procedure, in which unchanged settings keep their values, removed settings are deleted and new settings are added.

Required steps / Implementation details

Note that the key is used to actually store into NVS.
We would have to determine if option 2 is possible, and what it can support. Ideally:

  • unchanged settings (same key) keep their values but update their default values
  • new settings are simply added as they are now
  • changed settings (how to detect??) are deleted and added anew
  • deleted settings (how to detect??) are deleted from NVS

Definition of Done

???