* @brief Definition of a structures and public functions provided for NVS bootloader operations.
*/
/**
* @brief Placeholders for buffer pointer and length of string type
*/
typedefstruct{
char*buff_ptr;/**< Pointer to the buffer where string and terminating zero character will be read */
size_tbuff_len;/**< Buffer length in bytes */
}nvs_bootloader_str_value_placeholder_t;
/**
* @brief Union of value placeholders for all nvs_type_t supported by bootloader code
*/
typedefunion{
uint8_tu8_val;/**< Placeholder for unsigned 8 bit integer variable */
int8_ti8_val;/**< Placeholder for signed 8 bit integer variable */
uint16_tu16_val;/**< Placeholder for unsigned 16 bit integer variable */
int16_ti16_val;/**< Placeholder for signed 16 bit integer variable */
uint32_tu32_val;/**< Placeholder for unsigned 32 bit integer variable */
int32_ti32_val;/**< Placeholder for signed 32 bit integer variable */
uint64_tu64_val;/**< Placeholder for unsigned 64 bit integer variable */
int64_ti64_val;/**< Placeholder for signed 64 bit integer variable */
nvs_bootloader_str_value_placeholder_tstr_val;/**< Placeholder for string buffer information */
}nvs_bootloader_value_placeholder_t;
/**
* @brief Structure representing one NVS bootloader entry.
*
* This structure serves as read operation input parameters and result value and status placeholder.
* Before calling the `nvs_bootloader_read` function, populate the namespace_name, key_name and value_type members.
* If string value has to be read, provide also buffer and its length in the `value.str_val` member.
*
* The result_code member will be populated by the function with the result of the read operation.
* There are 2 possible situations and interpretations of the result_code:
* If the return value of the `nvs_bootloader_read` was ESP_OK, the result_code will be one of the following:
* - `ESP_OK`: Entry found, value member contains the data. This is the only case when the value member is populated.
* - `ESP_ERR_NVS_TYPE_MISMATCH`: Entry was found, but requested datatype doesn't match datatype found in NVS
* - `ESP_ERR_NVS_NOT_FOUND`: Data was not found.
* - `ESP_ERR_INVALID_SIZE`: the value found for string is longer than the space provided in placeholder (str_val.buff_len)
* If the return value of the function was ESP_ERR_INVALID_ARG, the result_code will be one of the following:
* - `ESP_ERR_NVS_NOT_FOUND`: Check of this parameters was successful.
* - `ESP_ERR_NVS_INVALID_NAME`: namespace_name is NULL or too long
* - `ESP_ERR_NVS_KEY_TOO_LONG`: key_name NULL or too long
* - `ESP_ERR_INVALID_SIZE`: the size of the buffer provided for NVS_TYPE_STR in placeholder (str_val.buff_len) is zero or exceeds maximum value NVS_CONST_STR_LEN_MAX_SIZE