oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
Loading...
Searching...
No Matches
Functions
ove::nvs Namespace Reference

Thin C++ wrappers around the oveRTOS non-volatile storage API. More...

Functions

int init ()
 Initialises the NVS subsystem.
 
void deinit ()
 Deinitialises the NVS subsystem and frees associated resources.
 
int read (const char *key, void *buf, size_t len, size_t *out)
 Reads the value associated with a key from NVS.
 
int write (const char *key, const void *data, size_t len)
 Writes a value associated with a key to NVS.
 
int erase (const char *key)
 Erases the value associated with a key from NVS.
 

Detailed Description

Thin C++ wrappers around the oveRTOS non-volatile storage API.

Available when CONFIG_OVE_NVS is enabled. Keys are null-terminated strings; values are arbitrary byte buffers.

Function Documentation

◆ init()

int ove::nvs::init ( )
inline

Initialises the NVS subsystem.

Returns
OVE_OK on success, or a negative error code.

◆ read()

int ove::nvs::read ( const char *  key,
void *  buf,
size_t  len,
size_t *  out 
)
inline

Reads the value associated with a key from NVS.

Parameters
[in]keyThe null-terminated key string.
[out]bufBuffer to receive the stored value.
[in]lenSize of buf in bytes.
[out]outReceives the number of bytes actually read.
Returns
OVE_OK on success, or a negative error code.

◆ write()

int ove::nvs::write ( const char *  key,
const void *  data,
size_t  len 
)
inline

Writes a value associated with a key to NVS.

Parameters
[in]keyThe null-terminated key string.
[in]dataPointer to the data to store.
[in]lenNumber of bytes to write.
Returns
OVE_OK on success, or a negative error code.

◆ erase()

int ove::nvs::erase ( const char *  key)
inline

Erases the value associated with a key from NVS.

Parameters
[in]keyThe null-terminated key string.
Returns
OVE_OK on success, or a negative error code.