|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Persistent key/value storage scoped to the calling plugin. More...
Functions | |
| int | host_nvs_get_blob (const char *key, uint8_t *buf, size_t *len) |
| Read a binary blob from NVS. | |
| int | host_nvs_set_blob (const char *key, const uint8_t *buf, size_t len) |
| Write a binary blob to NVS. | |
| int | host_nvs_get_u32 (const char *key, uint32_t *out) |
| Read a uint32 value. | |
| int | host_nvs_set_u32 (const char *key, uint32_t value) |
| Write a uint32 value. | |
| int | host_nvs_get_str (const char *key, char *buf, size_t buf_size) |
| Read a NUL-terminated string. | |
| int | host_nvs_set_str (const char *key, const char *value) |
| Write a NUL-terminated string. | |
| int | host_nvs_erase (const char *key) |
| Delete a single key. | |
| int | host_nvs_erase_all (void) |
| Erase every key in the plugin's namespace. | |
| int | host_nvs_list_keys (char *out, size_t *out_len) |
| Enumerate the keys in the plugin's namespace. | |
Persistent key/value storage scoped to the calling plugin.
Keys live in an NVS namespace derived from the plugin id, so different plugins cannot collide. Erasing the plugin wipes its namespace.
| int host_nvs_erase | ( | const char * | key | ) |
Delete a single key.
Definition at line 132 of file host_api_nvs.cpp.
References HOST_ERR_INVALID_ARG, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_erase().
| int host_nvs_erase_all | ( | void | ) |
Erase every key in the plugin's namespace.
Definition at line 141 of file host_api_nvs.cpp.
References HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_erase_all().
| int host_nvs_get_blob | ( | const char * | key, |
| uint8_t * | buf, | ||
| size_t * | len ) |
Read a binary blob from NVS.
| len | In: capacity of buf; out: bytes actually read. |
Definition at line 77 of file host_api_nvs.cpp.
References HOST_ERR_INVALID_ARG, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_get_blob().
| int host_nvs_get_str | ( | const char * | key, |
| char * | buf, | ||
| size_t | buf_size ) |
Read a NUL-terminated string.
Definition at line 113 of file host_api_nvs.cpp.
References HOST_ERR_INVALID_ARG, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_get_str().
| int host_nvs_get_u32 | ( | const char * | key, |
| uint32_t * | out ) |
Read a uint32 value.
Definition at line 95 of file host_api_nvs.cpp.
References HOST_ERR_INVALID_ARG, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_get_u32().
| int host_nvs_list_keys | ( | char * | out, |
| size_t * | out_len ) |
Enumerate the keys in the plugin's namespace.
| out_len | In: capacity of out; out: bytes written (NUL-separated list). |
Definition at line 149 of file host_api_nvs.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NO_CAPABILITY, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_list_keys().
| int host_nvs_set_blob | ( | const char * | key, |
| const uint8_t * | buf, | ||
| size_t | len ) |
Write a binary blob to NVS.
Definition at line 86 of file host_api_nvs.cpp.
References HOST_ERR_INVALID_ARG, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_set_blob().
| int host_nvs_set_str | ( | const char * | key, |
| const char * | value ) |
Write a NUL-terminated string.
Definition at line 123 of file host_api_nvs.cpp.
References HOST_ERR_INVALID_ARG, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_set_str().
| int host_nvs_set_u32 | ( | const char * | key, |
| uint32_t | value ) |
Write a uint32 value.
Definition at line 104 of file host_api_nvs.cpp.
References HOST_ERR_INVALID_ARG, and HOST_OK.
Referenced by cdc::plugin_manager::w_host_nvs_set_u32().