From ded2c49e8a4052cabaa91a3bcbca1af02f08df1a Mon Sep 17 00:00:00 2001 From: Artur Lipowski Date: Fri, 13 Oct 2023 14:23:30 +0200 Subject: [PATCH] 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 --- include/zephyr/fs/nvs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/zephyr/fs/nvs.h b/include/zephyr/fs/nvs.h index 30315d77b20..1d0a4e3b1d3 100644 --- a/include/zephyr/fs/nvs.h +++ b/include/zephyr/fs/nvs.h @@ -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