settings: add API for check value size

Such API is convinient for check the persistent storage
value size or whether the value is NULL.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
Andrzej Puzdrowski 2018-11-23 17:03:44 +01:00 committed by Carles Cufí
commit e5a09ccb3e
7 changed files with 61 additions and 5 deletions

View file

@ -197,6 +197,17 @@ int settings_commit(char *name);
*/
int settings_val_read_cb(void *value_ctx, void *buf, size_t len);
/**
* This function fetch length of decode data.
* This function should be used inside set handler in order to detect the
* settings data length.
*
* @param[in] value_ctx Data contex provided by the <p>h_set</p> handler.
*
* @retval length of data.
*/
size_t settings_val_get_len_cb(void *value_ctx);
/**
* @} settings
*/