settings: doc: Update the backend documentation
This commit updates the settings backend documentation to clearly state that it cannot provide old entities before the final one. Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
This commit is contained in:
parent
687a02a02d
commit
bb9c453777
2 changed files with 12 additions and 3 deletions
|
@ -94,13 +94,16 @@ Loading data from persisted storage
|
||||||
|
|
||||||
A call to ``settings_load()`` uses an ``h_set`` implementation
|
A call to ``settings_load()`` uses an ``h_set`` implementation
|
||||||
to load settings data from storage to volatile memory.
|
to load settings data from storage to volatile memory.
|
||||||
For both FCB and filesystem back-end the most
|
|
||||||
recent key values are guaranteed by traversing all stored content
|
|
||||||
and (potentially) overwriting older key values with newer ones.
|
|
||||||
After all data is loaded, the ``h_commit`` handler is issued,
|
After all data is loaded, the ``h_commit`` handler is issued,
|
||||||
signalling the application that the settings were successfully
|
signalling the application that the settings were successfully
|
||||||
retrieved.
|
retrieved.
|
||||||
|
|
||||||
|
Technically FCB and filesystem backends may store some history of the entities.
|
||||||
|
This means that the newest data entity is stored after any
|
||||||
|
older existing data entities.
|
||||||
|
Starting with Zephyr 2.1, the back-end must filter out all old entities and
|
||||||
|
call the callback with only the newest entity.
|
||||||
|
|
||||||
Storing data to persistent storage
|
Storing data to persistent storage
|
||||||
**********************************
|
**********************************
|
||||||
|
|
||||||
|
|
|
@ -390,6 +390,12 @@ struct settings_store_itf {
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* - cs - Corresponding backend handler node,
|
* - cs - Corresponding backend handler node,
|
||||||
* - arg - Structure that holds additional data for data loading.
|
* - arg - Structure that holds additional data for data loading.
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* Backend is expected not to provide duplicates of the entities.
|
||||||
|
* It means that if the backend does not contain any functionality to
|
||||||
|
* really delete old keys, it has to filter out old entities and call
|
||||||
|
* load callback only on the final entity.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int (*csi_save_start)(struct settings_store *cs);
|
int (*csi_save_start)(struct settings_store *cs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue