Skip to content

Commit ded2c49

Browse files
r2r0fabiobaltieri
authored andcommitted
fs: nvs: Note about nvs_write with len equal to 0.
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]>
1 parent a0db528 commit ded2c49

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/zephyr/fs/nvs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ int nvs_clear(struct nvs_fs *fs);
9494
/**
9595
* @brief Write an entry to the file system.
9696
*
97+
* @note When @p len parameter is equal to @p 0 then entry is effectively removed (it is
98+
* equivalent to calling of nvs_delete). Any calls to nvs_read for entries with data of length
99+
* @p 0 will return error.@n It is not possible to distinguish between deleted entry and entry
100+
* with data of length 0.
101+
*
97102
* @param fs Pointer to file system
98103
* @param id Id of the entry to be written
99104
* @param data Pointer to the data to be written

0 commit comments

Comments
 (0)