|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
#include <idfxx_nvs/include/idfxx/nvs.hpp>
Classes | |
| struct | insecure_t |
| Tag type to indicate insecure (non-encrypted) initialization. More... | |
| struct | secure_config |
| Key for encryption and decryption. More... | |
Public Member Functions | |
| flash ()=delete | |
Static Public Member Functions | |
| static void | init () |
| Initializes the default NVS partition. | |
| static void | init (const secure_config &cfg) |
| Initialize the default NVS partition with encryption. | |
| static void | init (insecure_t) |
| Initialize the default NVS partition without encryption. | |
| static void | init (std::string_view partition_label) |
| Initialize NVS flash storage for the specified partition. | |
| static void | init (std::string_view partition_label, const secure_config &cfg) |
| Initialize NVS flash storage for the specified partition. | |
| static void | init (insecure_t, std::string_view partition_label) |
| Initialize NVS flash storage for the specified partition without encryption. | |
| static void | init (const partition &part) |
| Initialize NVS flash storage for the specified partition. | |
| static void | init (const partition &part, const secure_config &cfg) |
| Initialize NVS flash storage for the specified partition with encryption. | |
| static void | init (insecure_t, const partition &part) |
| Initialize NVS flash storage for the specified partition without encryption. | |
| static result< void > | try_init () |
| Initializes the default NVS partition. | |
| static result< void > | try_init (const secure_config &cfg) |
| Initialize the default NVS partition with encryption. | |
| static result< void > | try_init (insecure_t) |
| Initialize the default NVS partition without encryption. | |
| static result< void > | try_init (std::string_view partition_label) |
| Initialize NVS flash storage for the specified partition. | |
| static result< void > | try_init (std::string_view partition_label, const secure_config &cfg) |
| Initialize NVS flash storage for the specified partition. | |
| static result< void > | try_init (insecure_t, std::string_view partition_label) |
| Initialize NVS flash storage for the specified partition without encryption. | |
| static result< void > | try_init (const partition &part) |
| Initialize NVS flash storage for the specified partition. | |
| static result< void > | try_init (const partition &part, const secure_config &cfg) |
| Initialize NVS flash storage for the specified partition with encryption. | |
| static result< void > | try_init (insecure_t, const partition &part) |
| Initialize NVS flash storage for the specified partition without encryption. | |
| static void | deinit () |
| Deinitialize NVS storage for the default NVS partition. | |
| static void | deinit (std::string_view partition_label) |
| Deinitialize NVS storage for the specified partition. | |
| static result< void > | try_deinit () |
| Deinitialize NVS storage for the default NVS partition. | |
| static result< void > | try_deinit (std::string_view partition_label) |
| Deinitialize NVS storage for the specified partition. | |
| static void | erase () |
| Erases the default NVS partition. | |
| static void | erase (std::string_view partition_label) |
| Erase specified NVS partition. | |
| static void | erase (const partition &part) |
| Erase the specified NVS partition. | |
| static secure_config | generate_keys (const partition &key_part) |
| Generate NVS encryption keys and store them on a key partition. | |
| static secure_config | read_security_cfg (const partition &key_part) |
| Read NVS encryption keys from a key partition. | |
| static result< void > | try_erase () |
| Erases the default NVS partition. | |
| static result< void > | try_erase (std::string_view partition_label) |
| Erases the specified NVS partition. | |
| static result< void > | try_erase (const partition &part) |
| Erases the specified NVS partition. | |
| static result< secure_config > | try_generate_keys (const partition &key_part) |
| Generate NVS encryption keys and store them on a key partition. | |
| static result< secure_config > | try_read_security_cfg (const partition &key_part) |
| Read NVS encryption keys from a key partition. | |
Static Public Attributes | |
| static constexpr size_t | key_size = 32 |
| static constexpr insecure_t | insecure {} |
| Insecure (non-encrypted) initialization tag. | |
|
delete |
Deinitialize NVS storage for the default NVS partition.
| std::system_error | on failure. |
Definition at line 661 of file nvs.hpp.
References idfxx::unwrap().
Deinitialize NVS storage for the specified partition.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| std::system_error | on failure. |
Definition at line 671 of file nvs.hpp.
References idfxx::unwrap().
Erases the default NVS partition.
| std::system_error | on failure. |
Definition at line 697 of file nvs.hpp.
References idfxx::unwrap().
Erase the specified NVS partition.
| part | The partition to erase. |
| std::system_error | on failure. |
Definition at line 717 of file nvs.hpp.
References idfxx::unwrap().
Erase specified NVS partition.
| partition_label | Label of the partition which should be erased |
| std::system_error | on failure. |
Definition at line 707 of file nvs.hpp.
References idfxx::unwrap().
|
inlinestatic |
Generate NVS encryption keys and store them on a key partition.
| key_part | The NVS key partition to generate keys on. |
| std::system_error | on failure. |
Definition at line 729 of file nvs.hpp.
References idfxx::unwrap().
Initializes the default NVS partition.
This API initialises the default NVS partition. The default NVS partition is the one that is labeled "nvs" in the partition table.
When "NVS_ENCRYPTION" is enabled in the menuconfig, this API enables the NVS encryption for the default NVS partition as follows
Post initialization NVS read/write APIs remain the same irrespective of NVS encryption.
| std::system_error | on failure. |
Definition at line 425 of file nvs.hpp.
References idfxx::unwrap().
Initialize NVS flash storage for the specified partition.
| part | The partition to initialize NVS storage on. |
| std::system_error | on failure. |
Definition at line 492 of file nvs.hpp.
References idfxx::unwrap().
|
inlinestatic |
Initialize NVS flash storage for the specified partition with encryption.
| part | The partition to initialize NVS storage on. |
| cfg | Security configuration (keys) to be used for NVS encryption/decryption. |
| std::system_error | on failure. |
Definition at line 503 of file nvs.hpp.
References idfxx::unwrap().
|
inlinestatic |
Initialize the default NVS partition with encryption.
This API initialises the default NVS partition. The default NVS partition is the one that is labeled "nvs" in the partition table.
| cfg | Security configuration (keys) to be used for NVS encryption/decryption. |
| std::system_error | on failure. |
Definition at line 438 of file nvs.hpp.
References idfxx::unwrap().
|
inlinestatic |
Initialize the default NVS partition without encryption.
This API initialises the default NVS partition. The default NVS partition is the one that is labeled "nvs" in the partition table.
| std::system_error | on failure. |
Definition at line 449 of file nvs.hpp.
References idfxx::unwrap().
|
inlinestatic |
Initialize NVS flash storage for the specified partition without encryption.
| part | The partition to initialize NVS storage on. |
| std::system_error | on failure. |
Definition at line 513 of file nvs.hpp.
References idfxx::unwrap().
|
inlinestatic |
Initialize NVS flash storage for the specified partition without encryption.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| std::system_error | on failure. |
Definition at line 482 of file nvs.hpp.
References idfxx::unwrap().
Initialize NVS flash storage for the specified partition.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| std::system_error | on failure. |
Definition at line 459 of file nvs.hpp.
References idfxx::unwrap().
|
inlinestatic |
Initialize NVS flash storage for the specified partition.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| cfg | Security configuration (keys) to be used for NVS encryption/decryption |
| std::system_error | on failure. |
Definition at line 470 of file nvs.hpp.
References idfxx::unwrap().
|
inlinestatic |
Read NVS encryption keys from a key partition.
| key_part | The NVS key partition to read keys from. |
| std::system_error | on failure. |
Definition at line 743 of file nvs.hpp.
References idfxx::unwrap().
Deinitialize NVS storage for the default NVS partition.
| nvs::errc::not_initialized | if the storage was not initialized prior to this call. |
Deinitialize NVS storage for the specified partition.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| nvs::errc::not_initialized | if the storage was not initialized prior to this call. |
Erases the default NVS partition.
| nvs::errc::not_found | if there is no NVS partition labeled "nvs" in the partition table. |
Erases the specified NVS partition.
| part | The partition to erase. |
Erases the specified NVS partition.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| nvs::errc::not_found | if specified partition is not found in the partition table. |
|
static |
Generate NVS encryption keys and store them on a key partition.
| key_part | The NVS key partition to generate keys on. |
| nvs::errc::xts_cfg_failed | if key generation fails. |
Initializes the default NVS partition.
This API initialises the default NVS partition. The default NVS partition is the one that is labeled "nvs" in the partition table.
When "NVS_ENCRYPTION" is enabled in the menuconfig, this API enables the NVS encryption for the default NVS partition as follows
Post initialization NVS read/write APIs remain the same irrespective of NVS encryption.
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| nvs::errc::part_not_found | if no partition with label "nvs" is found in the partition table. |
| Other | error codes from the underlying flash storage driver. |
Initialize NVS flash storage for the specified partition.
| part | The partition to initialize NVS storage on. |
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| Other | error codes from the underlying flash storage driver. |
|
static |
Initialize NVS flash storage for the specified partition with encryption.
| part | The partition to initialize NVS storage on. |
| cfg | Security configuration (keys) to be used for NVS encryption/decryption. |
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| Other | error codes from the underlying flash storage driver. |
|
static |
Initialize the default NVS partition with encryption.
This API initialises the default NVS partition. The default NVS partition is the one that is labeled "nvs" in the partition table.
| cfg | Security configuration (keys) to be used for NVS encryption/decryption. |
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| nvs::errc::part_not_found | if no partition with label "nvs" is found in the partition table. |
| Other | error codes from the underlying flash storage driver. |
|
static |
Initialize the default NVS partition without encryption.
This API initialises the default NVS partition. The default NVS partition is the one that is labeled "nvs" in the partition table.
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| nvs::errc::part_not_found | if no partition with label "nvs" is found in the partition table. |
| Other | error codes from the underlying flash storage driver. |
Initialize NVS flash storage for the specified partition without encryption.
| part | The partition to initialize NVS storage on. |
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| Other | error codes from the underlying flash storage driver. |
|
static |
Initialize NVS flash storage for the specified partition without encryption.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| nvs::errc::not_found | if specified partition is not found in the partition table. |
| Other | error codes from the underlying flash storage driver. |
Initialize NVS flash storage for the specified partition.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| nvs::errc::not_found | if specified partition is not found in the partition table. |
| Other | error codes from the underlying flash storage driver. |
|
static |
Initialize NVS flash storage for the specified partition.
| partition_label | Label of the partition. Must be no longer than 16 characters. |
| cfg | Security configuration (keys) to be used for NVS encryption/decryption. |
| nvs::errc::no_free_pages | if the NVS storage contains no empty pages (which may happen if NVS partition was truncated). |
| nvs::errc::not_found | if specified partition is not found in the partition table. |
| Other | error codes from the underlying flash storage driver. |
|
static |
Read NVS encryption keys from a key partition.
| key_part | The NVS key partition to read keys from. |
| nvs::errc::xts_cfg_not_found | if no valid keys are found on the partition. |
| nvs::errc::corrupt_key_part | if the key partition is corrupt. |
|
staticconstexpr |