|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Classes | |
| class | NvsEditModule |
Functions | |
| static IView * | getNvsEditorView () |
| Returns the NVS editor entry view callback target. | |
| static void | rebuildKeyListView () |
| Rebuilds key list labels into s_keyLabels and refreshes the key list view. | |
| static bool | deleteEnabled () |
| Indicates whether destructive delete actions are enabled. | |
| static void | showDeleteDisabled () |
| Shows a toast describing that delete actions are disabled. | |
| static const char * | nvsTypeToString (nvs_type_t type) |
| Converts NVS value type enum to a short display string. | |
| static void | loadNamespaces () |
| Loads unique namespace names from the default NVS partition. | |
| static void | loadKeys (const char *ns) |
| Loads keys and types for one namespace. | |
| static bool | deleteKey (const char *ns, const char *key) |
| Deletes a single key from a namespace. | |
| static bool | deleteNamespace (const char *ns) |
| Deletes all keys in a namespace. | |
| static void | formatValue (const char *ns, const char *key, nvs_type_t type, char *buf, size_t bufLen) |
| Formats one NVS value into a readable preview string. | |
| static void | onDeleteNamespace () |
| Deletes the currently selected namespace via context menu action. | |
| static void | onDeleteKey () |
| Deletes the currently selected key via context menu action. | |
| static void | showKeyListView (const char *ns) |
| Shows key list view for the selected namespace. | |
| static void | showValueView (const char *ns, const char *key, nvs_type_t type) |
| Shows detailed value view for a selected key. | |
| static void | onNamespaceSelect (uint16_t index, void *userData) |
| Handles namespace list selection. | |
| static void | onNamespaceMenu (uint16_t index, void *userData) |
| Opens namespace context menu for selected item. | |
| static void | showNamespaceListView () |
| Creates and shows the namespace list view. | |
| static void | onKeySelect (uint16_t index, void *userData) |
| Handles key selection and opens detailed value view. | |
| static void | onKeyMenu (uint16_t index, void *userData) |
| Opens key context menu for the selected key. | |
| static void | onNvsEditorConfirm (void *userData) |
| Confirm callback that opens namespace browser after warning dialog. | |
Variables | |
| static constexpr uint8_t | MAX_NAMESPACES = 32 |
| Upper bounds for list sizes and value preview buffers. | |
| static constexpr uint8_t | MAX_KEYS = 48 |
| static constexpr size_t | MAX_VALUE_DISPLAY = 256 |
| static char | s_namespaces [MAX_NAMESPACES][16] = {} |
| Runtime state for namespace/key browsing context. | |
| static uint8_t | s_namespaceCount = 0 |
| static char | s_selectedNamespace [16] = {} |
| static char | s_keys [MAX_KEYS][16] = {} |
| static nvs_type_t | s_keyTypes [MAX_KEYS] = {} |
| static uint8_t | s_keyCount = 0 |
| static char | s_selectedKey [16] = {} |
| static ListView * | s_namespaceListView = nullptr |
| Lazily created views and backing list item arrays. | |
| static ListView * | s_keyListView = nullptr |
| static InfoView * | s_valueView = nullptr |
| static ListItem | s_namespaceItems [MAX_NAMESPACES] |
| static ListItem | s_keyItems [MAX_KEYS] |
| static ContextMenuItem | s_nsContextItems [] |
| static ContextMenuItem | s_keyContextItems [] |
| static char | s_keyLabels [MAX_KEYS][24] |
| Persistent key label storage used by list items. | |
| static char | s_valueBuffer [MAX_VALUE_DISPLAY] |
| static char | s_valueTitle [32] |
| static NvsEditModule | s_module |
| Static module instance used by registration callback. | |
|
static |
Indicates whether destructive delete actions are enabled.
Definition at line 63 of file NvsEditModule.cpp.
References FEATURE_NVS_EDIT.
Referenced by cdc::mod_nvsedit::NvsEditModule::getMenuItems(), getNvsEditorView(), onDeleteKey(), onDeleteNamespace(), onKeyMenu(), onNamespaceMenu(), and onNvsEditorConfirm().
|
static |
Deletes a single key from a namespace.
| ns | Namespace name. |
| key | Key name. |
Definition at line 158 of file NvsEditModule.cpp.
Referenced by onDeleteKey().
|
static |
Deletes all keys in a namespace.
| ns | Namespace name. |
Definition at line 179 of file NvsEditModule.cpp.
Referenced by onDeleteNamespace().
|
static |
Formats one NVS value into a readable preview string.
| ns | Namespace name. |
| key | Key name. |
| type | Stored NVS type. |
| buf | Destination text buffer. |
| bufLen | Size of buf in bytes. |
Definition at line 203 of file NvsEditModule.cpp.
Referenced by showValueView().
|
static |
Returns the NVS editor entry view callback target.
Opens privileged confirmation dialog before entering NVS editor view.
Definition at line 519 of file NvsEditModule.cpp.
References deleteEnabled(), onNvsEditorConfirm(), cdc::ui::showConfirm(), and cdc::ui::ConfirmView::WARNING.
Referenced by cdc::mod_nvsedit::NvsEditModule::getMenuItems().
|
static |
Loads keys and types for one namespace.
| ns | Namespace name. |
Definition at line 129 of file NvsEditModule.cpp.
References LOG_I, MAX_KEYS, s_keyCount, s_keys, s_keyTypes, and TAG.
Referenced by onDeleteKey(), and showKeyListView().
|
static |
Loads unique namespace names from the default NVS partition.
Definition at line 98 of file NvsEditModule.cpp.
References LOG_I, MAX_NAMESPACES, s_namespaceCount, s_namespaces, and TAG.
Referenced by onDeleteNamespace(), and showNamespaceListView().
|
static |
Converts NVS value type enum to a short display string.
| type | NVS entry type. |
Definition at line 79 of file NvsEditModule.cpp.
Referenced by rebuildKeyListView(), and showValueView().
|
static |
Deletes the currently selected key via context menu action.
Definition at line 332 of file NvsEditModule.cpp.
References deleteEnabled(), deleteKey(), cdc::ui::hideContextMenu(), cdc::ui::ViewStack::instance(), loadKeys(), cdc::ui::ViewStack::pop(), rebuildKeyListView(), s_keyCount, s_selectedKey, s_selectedNamespace, showDeleteDisabled(), cdc::ui::showToastError(), and cdc::ui::showToastInfo().
|
static |
Deletes the currently selected namespace via context menu action.
Definition at line 305 of file NvsEditModule.cpp.
References deleteEnabled(), deleteNamespace(), cdc::ui::hideContextMenu(), loadNamespaces(), s_namespaceCount, s_namespaceItems, s_namespaceListView, s_namespaces, s_selectedNamespace, showDeleteDisabled(), cdc::ui::showToastError(), and cdc::ui::showToastInfo().
|
static |
Opens key context menu for the selected key.
| index | Selected key index. |
| userData | Optional callback user data. |
Definition at line 438 of file NvsEditModule.cpp.
References deleteEnabled(), s_keyContextItems, s_keyCount, s_keys, s_selectedKey, cdc::ui::showContextMenu(), and showDeleteDisabled().
Referenced by showKeyListView().
|
static |
Handles key selection and opens detailed value view.
| index | Selected key index. |
| userData | Optional callback user data. |
Definition at line 425 of file NvsEditModule.cpp.
References s_keyCount, s_keys, s_keyTypes, s_selectedKey, s_selectedNamespace, and showValueView().
Referenced by showKeyListView().
|
static |
Opens namespace context menu for selected item.
| index | Selected namespace index. |
| userData | Optional callback user data. |
Definition at line 385 of file NvsEditModule.cpp.
References deleteEnabled(), s_namespaceCount, s_namespaces, s_nsContextItems, s_selectedNamespace, cdc::ui::showContextMenu(), and showDeleteDisabled().
Referenced by showNamespaceListView().
|
static |
Handles namespace list selection.
| index | Selected namespace index. |
| userData | Optional callback user data. |
Definition at line 372 of file NvsEditModule.cpp.
References s_namespaceCount, s_namespaces, s_selectedNamespace, and showKeyListView().
Referenced by showNamespaceListView().
|
static |
Confirm callback that opens namespace browser after warning dialog.
| userData | Optional callback user data. |
Definition at line 507 of file NvsEditModule.cpp.
References deleteEnabled(), showNamespaceListView(), and cdc::ui::showToastInfo().
Referenced by getNvsEditorView().
|
static |
Rebuilds key list labels into s_keyLabels and refreshes the key list view.
Rebuilds key list labels and refreshes the key list view.
Definition at line 453 of file NvsEditModule.cpp.
References nvsTypeToString(), s_keyCount, s_keyItems, s_keyLabels, s_keyListView, s_keys, s_keyTypes, and s_selectedNamespace.
Referenced by onDeleteKey(), and showKeyListView().
|
static |
Shows a toast describing that delete actions are disabled.
Definition at line 70 of file NvsEditModule.cpp.
References cdc::ui::showToastError().
Referenced by onDeleteKey(), onDeleteNamespace(), onKeyMenu(), and onNamespaceMenu().
|
static |
Shows key list view for the selected namespace.
Creates and shows key list view for a namespace.
| ns | Namespace name. |
Definition at line 468 of file NvsEditModule.cpp.
References cdc::ui::ViewStack::instance(), loadKeys(), onKeyMenu(), onKeySelect(), cdc::ui::ViewStack::push(), rebuildKeyListView(), and s_keyListView.
Referenced by onNamespaceSelect().
|
static |
Creates and shows the namespace list view.
Definition at line 400 of file NvsEditModule.cpp.
References cdc::ui::ViewStack::instance(), loadNamespaces(), onNamespaceMenu(), onNamespaceSelect(), cdc::ui::ViewStack::push(), s_namespaceCount, s_namespaceItems, s_namespaceListView, and s_namespaces.
Referenced by onNvsEditorConfirm().
|
static |
Shows detailed value view for a selected key.
Shows formatted value preview for one namespace key.
| ns | Namespace name. |
| key | Key name. |
| type | NVS value type. |
Definition at line 490 of file NvsEditModule.cpp.
References formatValue(), cdc::ui::ViewStack::instance(), nvsTypeToString(), cdc::ui::ViewStack::push(), s_valueBuffer, s_valueTitle, and s_valueView.
Referenced by onKeySelect().
|
staticconstexpr |
Definition at line 38 of file NvsEditModule.cpp.
Referenced by loadKeys().
|
staticconstexpr |
Upper bounds for list sizes and value preview buffers.
Definition at line 37 of file NvsEditModule.cpp.
Referenced by loadNamespaces().
|
staticconstexpr |
Definition at line 39 of file NvsEditModule.cpp.
|
static |
Definition at line 358 of file NvsEditModule.cpp.
Referenced by onKeyMenu().
|
static |
Definition at line 49 of file NvsEditModule.cpp.
Referenced by loadKeys(), onDeleteKey(), onKeyMenu(), onKeySelect(), and rebuildKeyListView().
Definition at line 57 of file NvsEditModule.cpp.
Referenced by rebuildKeyListView().
|
static |
Persistent key label storage used by list items.
Definition at line 418 of file NvsEditModule.cpp.
Referenced by rebuildKeyListView().
|
static |
Definition at line 54 of file NvsEditModule.cpp.
Referenced by rebuildKeyListView(), and showKeyListView().
|
static |
Definition at line 47 of file NvsEditModule.cpp.
Referenced by loadKeys(), onKeyMenu(), onKeySelect(), and rebuildKeyListView().
|
static |
Definition at line 48 of file NvsEditModule.cpp.
Referenced by loadKeys(), onKeySelect(), and rebuildKeyListView().
|
static |
Static module instance used by registration callback.
Definition at line 558 of file NvsEditModule.cpp.
|
static |
Definition at line 44 of file NvsEditModule.cpp.
Referenced by loadNamespaces(), onDeleteNamespace(), onNamespaceMenu(), onNamespaceSelect(), and showNamespaceListView().
|
static |
Definition at line 56 of file NvsEditModule.cpp.
Referenced by onDeleteNamespace(), and showNamespaceListView().
|
static |
Lazily created views and backing list item arrays.
Definition at line 53 of file NvsEditModule.cpp.
Referenced by onDeleteNamespace(), and showNamespaceListView().
|
static |
Runtime state for namespace/key browsing context.
Definition at line 43 of file NvsEditModule.cpp.
Referenced by loadNamespaces(), onDeleteNamespace(), onNamespaceMenu(), onNamespaceSelect(), and showNamespaceListView().
|
static |
Definition at line 354 of file NvsEditModule.cpp.
Referenced by onNamespaceMenu().
|
static |
Definition at line 50 of file NvsEditModule.cpp.
Referenced by onDeleteKey(), onKeyMenu(), and onKeySelect().
|
static |
Definition at line 45 of file NvsEditModule.cpp.
Referenced by onDeleteKey(), onDeleteNamespace(), onKeySelect(), onNamespaceMenu(), onNamespaceSelect(), and rebuildKeyListView().
|
static |
Definition at line 481 of file NvsEditModule.cpp.
Referenced by showValueView().
|
static |
Definition at line 482 of file NvsEditModule.cpp.
Referenced by showValueView().
|
static |
Definition at line 55 of file NvsEditModule.cpp.
Referenced by showValueView().