Skip to content

Commit

Permalink
fs: nvs: Note about nvs_write with len equal to 0.
Browse files Browse the repository at this point in the history
Add a note to explain what happens when entry with 0 data length is
written to NVS storage.

Signed-off-by: Artur Lipowski <[email protected]>
  • Loading branch information
r2r0 authored and fabiobaltieri committed Oct 13, 2023
1 parent a0db528 commit ded2c49
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/zephyr/fs/nvs.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ int nvs_clear(struct nvs_fs *fs);
/**
* @brief Write an entry to the file system.
*
* @note When @p len parameter is equal to @p 0 then entry is effectively removed (it is
* equivalent to calling of nvs_delete). Any calls to nvs_read for entries with data of length
* @p 0 will return error.@n It is not possible to distinguish between deleted entry and entry
* with data of length 0.
*
* @param fs Pointer to file system
* @param id Id of the entry to be written
* @param data Pointer to the data to be written
Expand Down

0 comments on commit ded2c49

Please sign in to comment.