63 const int rc = ove_nvs_read(key, buf, len, &out);
75[[nodiscard]]
inline Result<void> write(
const char *key,
const void *data,
size_t len)
noexcept
77 return from_rc(ove_nvs_write(key, data, len));
88 return from_rc(ove_nvs_erase(key));
Strong ove::Error type, Result<T> alias, and std::error_code interop for the oveRTOS C++ binding.
Thin C++ wrappers around the oveRTOS non-volatile storage API.
Definition nvs.hpp:23
void deinit()
Deinitialises the NVS subsystem and frees associated resources.
Definition nvs.hpp:46
Result< void > init() noexcept
Initialises the NVS subsystem.
Definition nvs.hpp:38
Result< void > erase(const char *key) noexcept
Erases the value associated with a key from NVS.
Definition nvs.hpp:86
Result< size_t > read(const char *key, void *buf, size_t len) noexcept
Reads the value associated with a key from NVS.
Definition nvs.hpp:60
Result< void > write(const char *key, const void *data, size_t len) noexcept
Writes a value associated with a key to NVS.
Definition nvs.hpp:75
Result< void > from_rc(int rc) noexcept
Lifts a substrate rc-code into a Result<void>.
Definition error.hpp:254
std::expected< T, Error > Result
std::expected-based result alias.
Definition error.hpp:139
Common type definitions and concepts for the C++ wrapper layer.