|
Internal Interface Wrap
API reference
|
Hash-map NVS namespace for host builds and deterministic tests. More...
#include <HostNvs.h>
Public Member Functions | |
| HostNvs (const char *name) | |
| ~HostNvs () override=default | |
Public Member Functions inherited from BaseNvs | |
| virtual | ~BaseNvs () noexcept=default |
| Virtual destructor to ensure proper cleanup. | |
| BaseNvs (const BaseNvs &)=delete | |
| BaseNvs & | operator= (const BaseNvs &)=delete |
| bool | EnsureInitialized () |
| Ensures that the NVS storage is initialized (lazy initialization). | |
| bool | EnsureDeinitialized () |
| Ensures that the NVS storage is deinitialized. | |
| bool | IsInitialized () const noexcept |
| Check if storage is initialized. | |
| const char * | GetNamespace () const noexcept |
| Get the namespace name. | |
| virtual hf_nvs_err_t | ResetStatistics () noexcept |
| Reset NVS operation statistics. | |
| virtual hf_nvs_err_t | ResetDiagnostics () noexcept |
| Reset NVS diagnostic information. | |
| virtual hf_nvs_err_t | GetStatistics (hf_nvs_statistics_t &statistics) const noexcept |
| Get NVS operation statistics. | |
| virtual hf_nvs_err_t | GetDiagnostics (hf_nvs_diagnostics_t &diagnostics) const noexcept |
| Get NVS diagnostic information. | |
Protected Member Functions | |
| hf_nvs_err_t | Initialize () noexcept override |
| Initialize the storage system and open the namespace. | |
| hf_nvs_err_t | Deinitialize () noexcept override |
| Deinitialize the storage system and close the namespace. | |
| 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 | GetU32 (const char *key, hf_u32_t &value) noexcept override |
| Retrieve a 32-bit unsigned integer value. | |
| hf_nvs_err_t | SetString (const char *key, const char *value) noexcept override |
| Store a string value. | |
| hf_nvs_err_t | GetString (const char *key, char *buffer, size_t buffer_size, size_t *actual_size) noexcept override |
| Retrieve a string value. | |
| 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 | GetBlob (const char *key, void *buffer, size_t buffer_size, size_t *actual_size) noexcept override |
| Retrieve binary data (blob). | |
| hf_nvs_err_t | EraseKey (const char *key) noexcept override |
| Remove a key from storage. | |
| hf_nvs_err_t | Commit () noexcept override |
| Commit any pending writes to non-volatile storage. | |
| bool | KeyExists (const char *key) noexcept override |
| Check if a key exists in storage. | |
| hf_nvs_err_t | GetSize (const char *key, size_t &size) noexcept override |
| Get the size of a stored value. | |
| const char * | GetDescription () const noexcept override |
| Get description of this storage implementation. | |
| size_t | GetMaxKeyLength () const noexcept override |
| Get maximum key length supported. | |
| size_t | GetMaxValueSize () const noexcept override |
| Get maximum value size supported. | |
Protected Member Functions inherited from BaseNvs | |
| BaseNvs (const char *namespace_name) noexcept | |
| Protected constructor with namespace specification. | |
| void | SetInitialized (bool initialized) noexcept |
| Set the initialized state. | |
Private Attributes | |
| const char * | name_ |
| std::unordered_map< std::string, std::vector< uint8_t > > | blobs_ |
| std::unordered_map< std::string, hf_u32_t > | u32s_ |
| std::unordered_map< std::string, std::string > | strings_ |
Additional Inherited Members | |
Protected Attributes inherited from BaseNvs | |
| const char * | namespace_name_ |
| Namespace name. | |
| bool | initialized_ |
| Initialization status. | |
| hf_nvs_statistics_t | statistics_ |
| NVS operation statistics. | |
| hf_nvs_diagnostics_t | diagnostics_ |
| NVS diagnostic information. | |
Hash-map NVS namespace for host builds and deterministic tests.
|
overridedefault |
|
overrideprotectedvirtualnoexcept |
Commit any pending writes to non-volatile storage.
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Deinitialize the storage system and close the namespace.
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Remove a key from storage.
| key | Storage key to remove |
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Retrieve binary data (blob).
| key | Storage key (null-terminated string) |
| buffer | Buffer to store the retrieved data |
| buffer_size | Size of the buffer in bytes |
| actual_size | Actual size of the data (optional) |
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
|
overrideprotectedvirtualnoexcept |
|
overrideprotectedvirtualnoexcept |
Get the size of a stored value.
| key | Storage key |
| size | Reference to store the size |
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Retrieve a string value.
| key | Storage key (null-terminated string) |
| buffer | Buffer to store the retrieved string |
| buffer_size | Size of the buffer in bytes |
| actual_size | Actual size of the string (optional) |
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Retrieve a 32-bit unsigned integer value.
| key | Storage key (null-terminated string) |
| value | Reference to store the retrieved value |
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Initialize the storage system and open the namespace.
Implements BaseNvs.
Check if a key exists in storage.
| key | Storage key to check |
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Store binary data (blob).
| key | Storage key (null-terminated string) |
| data | Pointer to data to store |
| data_size | Size of data in bytes |
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Store a string value.
| key | Storage key (null-terminated string) |
| value | String value to store |
Implements BaseNvs.
|
overrideprotectedvirtualnoexcept |
Store a 32-bit unsigned integer value.
| key | Storage key (null-terminated string) |
| value | Value to store |
Implements BaseNvs.
|
private |
|
private |
|
private |