My Project
 All Classes Functions Variables Pages
Public Member Functions | List of all members
NVS Class Reference

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)
 

Detailed Description

Provide Non Volatile Storage access.

Constructor & Destructor Documentation

NVS::NVS ( std::string  name,
nvs_open_mode  openMode = NVS_READWRITE 
)

Constructor.

Parameters
[in]nameThe namespace to open for access.
[in]openModeThe open mode. One of NVS_READWRITE (default) or NVS_READONLY.

Member Function Documentation

void NVS::erase ( std::string  key)

Erase a specific key in the namespace.

Parameters
[in]keyThe 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.

Parameters
[in]keyThe key to read from the namespace.
[out]resultThe 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.

Parameters
[in]keyThe key to set from the namespace.
[in]dataThe value to set for the key.

The documentation for this class was generated from the following files: