Provide Non Volatile Storage access. More...
#include <CPPNVS.h>
Public Member Functions | |
NVS (std::string name, nvs_open_mode openMode=NVS_READWRITE) | |
Constructor. More... | |
virtual | ~NVS () |
Desctructor. | |
void | commit () |
Commit any work performed in the namespace. | |
void | erase () |
Erase ALL the keys in the namespace. | |
void | erase (std::string key) |
Erase a specific key in the namespace. More... | |
int | get (std::string key, std::string *result, bool isBlob=false) |
Retrieve a string/blob value by key. More... | |
int | get (std::string key, uint8_t *result, size_t &length) |
int | get (std::string key, uint32_t &value) |
void | set (std::string key, std::string data, bool isBlob=false) |
Set the string/blob value by key. More... | |
void | set (std::string key, uint32_t value) |
void | set (std::string key, uint8_t *data, size_t length) |
Provide Non Volatile Storage access.
NVS::NVS | ( | std::string | name, |
nvs_open_mode | openMode = NVS_READWRITE |
||
) |
Constructor.
[in] | name | The namespace to open for access. |
[in] | openMode | The open mode. One of NVS_READWRITE (default) or NVS_READONLY. |
void NVS::erase | ( | std::string | key | ) |
Erase a specific key in the namespace.
[in] | key | The key to erase from the namespace. |
int NVS::get | ( | std::string | key, |
std::string * | result, | ||
bool | isBlob = false |
||
) |
Retrieve a string/blob value by key.
[in] | key | The key to read from the namespace. |
[out] | result | The string read from the NVS storage. |
void NVS::set | ( | std::string | key, |
std::string | data, | ||
bool | isBlob = false |
||
) |
Set the string/blob value by key.
[in] | key | The key to set from the namespace. |
[in] | data | The value to set for the key. |