settings: add delete key-value pair API
So far to deleting av existing key-value pair it was required to storing NULL value using setting_save_one(). This patch introduce more intuitive API which takes only the name key string. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
parent
55024fe5f0
commit
cb92c95aab
2 changed files with 17 additions and 0 deletions
|
@ -139,6 +139,18 @@ int settings_save(void);
|
|||
*/
|
||||
int settings_save_one(const char *name, void *value, size_t val_len);
|
||||
|
||||
/**
|
||||
* Delete a single serialized in persisted storage.
|
||||
*
|
||||
* Deleting an existing key-value pair in the settings mean
|
||||
* to set its value to NULL.
|
||||
*
|
||||
* @param name Name/key of the settings item.
|
||||
*
|
||||
* @return 0 on success, non-zero on failure.
|
||||
*/
|
||||
int settings_delete(const char *name);
|
||||
|
||||
/**
|
||||
* Set settings item identified by @p name to be value @p value.
|
||||
* This finds the settings handler for this subtree and calls it's
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue