Class NVS¶
Defined in File Storage.h
Class Documentation¶
-
class
storage
::
NVS
¶ Representation of a NVS namespace.
Public Functions
-
NVS
()¶ Construct a new Namespace.
-
~NVS
()¶ Close the Namespace.
-
esp_err_t
open
(const char *name, nvs_open_mode open_mode)¶ Open namespace.
- Attention
1. If a namespace is already opened it’s going to be closed.
- Return
ESP_OK: succeed
(others): failed
- Parameters
name
: namespace nameopen_mode
: opening mode
-
void
close
()¶ Close the namespace.
-
esp_err_t
set_bool
(const char *key, bool value)¶ Set a boolean.
- Return
ESP_OK: succeed
(others): failed
- Parameters
key
: key in the namespacevalue
: boolean value
-
esp_err_t
get_bool
(const char *key, bool &value)¶ Get a boolean.
- Return
ESP_OK: succeed
(others): failed
- Parameters
key
: key in the namespace[out] value
: boolean return value
-
esp_err_t
getIsConfigured
(bool &is_configured)¶ Checks whether the Turpial device is configured or not.
- Return
ESP_OK: succeed
(others): failed
- Parameters
is_configured
: return value
-
esp_err_t
setString
(std::string key, std::string data)¶ Set the String object.
- Return
esp_err_t
- Parameters
key
:username
:
-
esp_err_t
getString
(std::string key, char *buffer, size_t *length)¶ Get the String object.
- Return
esp_err_t
- Parameters
key
:data
:
-
esp_err_t
commit
()¶ Commit changes to flash.
- Return
ESP_OK: succeed
(others): failed
-