Function esp_idf_hal::sys::nvs_open_from_partition
source · pub unsafe extern "C" fn nvs_open_from_partition(
part_name: *const i8,
namespace_name: *const i8,
open_mode: u32,
out_handle: *mut u32,
) -> i32
Expand description
@brief Open non-volatile storage with a given namespace from specified partition
The behaviour is same as nvs_open() API. However this API can operate on a specified NVS partition instead of default NVS partition. Note that the specified partition must be registered with NVS using nvs_flash_init_partition() API.
@param[in] part_name Label (name) of the partition of interest for object read/write/erase @param[in] namespace_name Namespace name. Maximum length is (NVS_KEY_NAME_MAX_SIZE-1) characters. Shouldn’t be empty. @param[in] open_mode NVS_READWRITE or NVS_READONLY. If NVS_READONLY, will open a handle for reading only. All write requests will be rejected for this handle. @param[out] out_handle If successful (return code is zero), handle will be returned in this argument.
@return - ESP_OK if storage handle was opened successfully - ESP_FAIL if there is an internal error; most likely due to corrupted NVS partition (only if NVS assertion checks are disabled) - ESP_ERR_NVS_NOT_INITIALIZED if the storage driver is not initialized - ESP_ERR_NVS_PART_NOT_FOUND if the partition with specified name is not found - ESP_ERR_NVS_NOT_FOUND id namespace doesn’t exist yet and mode is NVS_READONLY - ESP_ERR_NVS_INVALID_NAME if namespace name doesn’t satisfy constraints - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different namespaces (maximum allowed different namespaces: 254) - other error codes from the underlying storage driver