forked from espressif/esp-idf
nvs: use 'handle' argument name for consistency
This commit is contained in:
committed by
radek.tandler
parent
f2af1c5305
commit
92ff04ebea
@@ -710,7 +710,7 @@ esp_err_t nvs_entry_find(const char *part_name,
|
|||||||
* - ESP_ERR_INVALID_ARG if any of the parameters is NULL.
|
* - ESP_ERR_INVALID_ARG if any of the parameters is NULL.
|
||||||
* Note: don't release \c output_iterator in case ESP_ERR_INVALID_ARG has been returned
|
* Note: don't release \c output_iterator in case ESP_ERR_INVALID_ARG has been returned
|
||||||
*/
|
*/
|
||||||
esp_err_t nvs_entry_find_in_handle(nvs_handle_t c_handle, nvs_type_t type, nvs_iterator_t *output_iterator);
|
esp_err_t nvs_entry_find_in_handle(nvs_handle_t handle, nvs_type_t type, nvs_iterator_t *output_iterator);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Advances the iterator to next item matching the iterator criteria.
|
* @brief Advances the iterator to next item matching the iterator criteria.
|
||||||
|
@@ -786,7 +786,7 @@ extern "C" esp_err_t nvs_entry_find(const char *part_name, const char *namespace
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" esp_err_t nvs_entry_find_in_handle(nvs_handle_t c_handle, nvs_type_t type, nvs_iterator_t *output_iterator)
|
extern "C" esp_err_t nvs_entry_find_in_handle(nvs_handle_t handle, nvs_type_t type, nvs_iterator_t *output_iterator)
|
||||||
{
|
{
|
||||||
if (output_iterator == nullptr) {
|
if (output_iterator == nullptr) {
|
||||||
return ESP_ERR_INVALID_ARG;
|
return ESP_ERR_INVALID_ARG;
|
||||||
@@ -800,22 +800,22 @@ extern "C" esp_err_t nvs_entry_find_in_handle(nvs_handle_t c_handle, nvs_type_t
|
|||||||
|
|
||||||
Lock lock;
|
Lock lock;
|
||||||
nvs::Storage *pStorage;
|
nvs::Storage *pStorage;
|
||||||
NVSHandleSimple *handle;
|
NVSHandleSimple *handle_obj;
|
||||||
|
|
||||||
auto err = nvs_find_ns_handle(c_handle, &handle);
|
auto err = nvs_find_ns_handle(handle, &handle_obj);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
*output_iterator = nullptr;
|
*output_iterator = nullptr;
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
pStorage = handle->get_storage();
|
pStorage = handle_obj->get_storage();
|
||||||
nvs_iterator_t it = create_iterator(pStorage, type);
|
nvs_iterator_t it = create_iterator(pStorage, type);
|
||||||
if (it == nullptr) {
|
if (it == nullptr) {
|
||||||
*output_iterator = nullptr;
|
*output_iterator = nullptr;
|
||||||
return ESP_ERR_NO_MEM;
|
return ESP_ERR_NO_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool entryFound = handle->findEntryNs(it);
|
bool entryFound = handle_obj->findEntryNs(it);
|
||||||
if (!entryFound) {
|
if (!entryFound) {
|
||||||
free(it);
|
free(it);
|
||||||
*output_iterator = nullptr;
|
*output_iterator = nullptr;
|
||||||
|
Reference in New Issue
Block a user