-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid len argument type in NVS C++ API? (IDFGH-4275) #6123
Comments
github-actions
bot
changed the title
Invalid len argument type in NVS C++ API?
Invalid len argument type in NVS C++ API? (IDFGH-4275)
Nov 17, 2020
@hg |
@hg A fix has been merged into our internal CI system. It should be pushed to the github master during the next few weeks. |
projectgus
pushed a commit
that referenced
this issue
Jun 30, 2021
* Move nvs flash README to common doc directory * correct markup of functions and types in text from old README * Better comment of nvs_get_used_entry_count() * Mention C++ example in API reference * Used target instead of hard code ESP32 * Note that strings can only span one page * Reflect that item types have been moved * Some clarification about nvs_commit() * Improved reference to the ESP Partition API * fixed little mistake in documenting-code.rst * Change of nvs_open_from_part() to nvs_open_from_partition() reflected in docs * Corrected documentation of NVSHandle::get_string(), NVSHandle::get_blob() and NVSHandle::get_item_size(). * Closes DOC-165 * Closes IDF-1563 * Closes IDF-859 * Closes #6123
espressif-bot
pushed a commit
that referenced
this issue
Jul 18, 2021
* Better comment of nvs_get_used_entry_count() * Mention C++ example in API reference * WIP: Used target instead of hard code ESP32 * Note that strings can only span one page * Reflect that item types have been moved * Some clarification about nvs_commit() * Improved reference to the ESP Partition API * fixed little mistake in documenting-code.rst * Change of nvs_open_from_part() to nvs_open_from_partition() reflected in docs * Corrected documentation of NVSHandle::get_string(), NVSHandle::get_blob() and NVSHandle::get_item_size(). * Closes IDF-1563 * Closes IDF-859 * Closes #6123
espressif-bot
pushed a commit
that referenced
this issue
Dec 26, 2021
* Better comment of nvs_get_used_entry_count() * Mention C++ example in API reference * WIP: Used target instead of hard code ESP32 * Note that strings can only span one page * Reflect that item types have been moved * Some clarification about nvs_commit() * Improved reference to the ESP Partition API * fixed little mistake in documenting-code.rst * Change of nvs_open_from_part() to nvs_open_from_partition() reflected in docs * Corrected documentation of NVSHandle::get_string(), NVSHandle::get_blob() and NVSHandle::get_item_size(). * Closes IDF-1563 * Closes IDF-859 * Closes #6123
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Problem Description
Hi,
I omitted most of the template as it doesn't really apply to this issue.
I think the
NVSHandle::get_string
method uses the wrong type for argumentlen
:esp-idf/components/nvs_flash/include/nvs_handle.hpp
Line 152 in 5aa2158
If we look at the docs, it is described as the pointer to the variable which receives the length of the string actually read from flash memory:
esp-idf/components/nvs_flash/include/nvs_handle.hpp
Lines 142 to 144 in 5aa2158
And if we look at the C API, the corresponding function does receive a pointer:
esp-idf/components/nvs_flash/include/nvs.h
Line 346 in 5aa2158
It can be worked around by using
NVSHandle::get_item_size
and then passing its result toNVSHandle::get_string
, but I guess docs forNVSHandle::get_string
could be improved if it's too late to change its signature.Thank you!
The text was updated successfully, but these errors were encountered: