111 explicit EspNvs(
const char* namespace_name)
noexcept;
167 size_t* actual_size =
nullptr) noexcept override;
187 size_t* actual_size =
nullptr) noexcept override;
Abstract base class for Non-Volatile Storage implementations in the HardFOC system.
hf_nvs_err_t
Definition BaseNvs.h:76
ESP32 NVS type definitions for hardware abstraction.
uint32_t hf_u32_t
Platform-agnostic 32-bit unsigned integer type.
Definition HardwareTypes.h:52
Abstract base class for non-volatile storage operations.
Definition BaseNvs.h:147
Production-ready MCU-integrated non-volatile storage implementation.
Definition EspNvs.h:105
hf_nvs_err_t SetBlob(const char *key, const void *data, size_t data_size) noexcept override
Store binary data (blob).
hf_nvs_err_t SetU32(const char *key, hf_u32_t value) noexcept override
Store a 32-bit unsigned integer value.
hf_nvs_err_t Initialize() noexcept override
Initialize the NVS system and open the namespace.
hf_nvs_diagnostics_t diagnostics_
Diagnostic information.
Definition EspNvs.h:293
hf_nvs_err_t Commit() noexcept override
Commit any pending writes to non-volatile storage.
hf_nvs_err_t GetSize(const char *key, size_t &size) noexcept override
Get the size of a stored value.
EspNvs(const char *namespace_name) noexcept
Constructor with namespace specification.
bool IsValidKey(const char *key) const noexcept
Validate key name according to ESP32 NVS constraints.
hf_nvs_statistics_t statistics_
Operation statistics.
Definition EspNvs.h:292
PlatformMutex mutex_
Mutex for thread-safe operations.
Definition EspNvs.h:296
void * nvs_handle_
Platform-specific NVS handle (nvs_handle_t on ESP32)
Definition EspNvs.h:288
hf_nvs_err_t Deinitialize() noexcept override
Deinitialize the NVS system and close the namespace.
bool KeyExists(const char *key) noexcept override
Check if a key exists in storage.
hf_nvs_err_t GetDiagnostics(hf_nvs_diagnostics_t &diagnostics) const noexcept override
Get NVS diagnostic information.
hf_nvs_err_t GetU32(const char *key, hf_u32_t &value) noexcept override
Retrieve a 32-bit unsigned integer value.
~EspNvs() noexcept override
Destructor - ensures proper cleanup.
void UpdateStatistics(bool error_occurred) noexcept
Update operation statistics and performance counters.
hf_nvs_err_t SetString(const char *key, const char *value) noexcept override
Store a string value.
hf_nvs_err_t EraseKey(const char *key) noexcept override
Remove a key from storage.
hf_nvs_err_t GetStatistics(hf_nvs_statistics_t &statistics) const noexcept override
Get NVS operation statistics.
size_t GetMaxValueSize() const noexcept override
Get maximum value size supported.
int last_error_code_
Last MCU-specific error code for debugging.
Definition EspNvs.h:289
hf_nvs_err_t GetBlob(const char *key, void *buffer, size_t buffer_size, size_t *actual_size=nullptr) noexcept override
Retrieve binary data (blob).
hf_nvs_err_t GetString(const char *key, char *buffer, size_t buffer_size, size_t *actual_size=nullptr) noexcept override
Retrieve a string value.
const char * GetDescription() const noexcept override
Get description of this NVS implementation.
size_t GetMaxKeyLength() const noexcept override
Get maximum key length supported.
hf_nvs_err_t ConvertMcuError(int mcu_error) const noexcept
Convert MCU-specific error code to HardFOC NVS error.
NVS diagnostic information.
Definition BaseNvs.h:120
NVS operation statistics.
Definition BaseNvs.h:102