|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Functions | |
| void | init (hal::IDisplay *display, hal::ISleepController *sleep, LockScreenView *lockScreen) |
| Initializes shared dependencies used by the settings handlers. | |
| void | processPendingBadgeText () |
| Processes the next pending badge-text wizard step. | |
| void | onBrightnessSave (uint16_t value) |
| Persists and applies selected backlight value. | |
| void | onBrightnessChange (uint16_t value) |
| Applies backlight preview without persisting. | |
| uint16_t | brightnessStepCallback (uint16_t current, bool increasing) |
| Returns adaptive brightness step size. | |
| void | onSleepIntervalSave (uint16_t value) |
| Saves lock-screen sleep interval in minutes. | |
| void | onTimezoneSave (uint16_t value) |
| Saves timezone offset and refreshes lock-screen clock. | |
| void | onDateConfirm (uint8_t day, uint8_t month, uint16_t year) |
| Applies confirmed date to system time. | |
| void | onTimeConfirm (uint8_t hour, uint8_t minute) |
| Applies confirmed time to system clock. | |
| void | onPinChangeComplete (bool success) |
| Handles completion of PIN-change flow. | |
| void | startBadgeTextEdit () |
| Starts badge-text editing wizard. | |
| void | saveDisplayField (const char *key, const char *value) |
| Saves one display text field to NVS. | |
| bool | loadDisplayField (const char *key, char *out, size_t outSize) |
| Reads one display text field from NVS into the caller buffer. | |
| static void | showBadgeTextStep (uint8_t step) |
| Forward declarations for internal helper callbacks. | |
| static void | onBadgeNameSave (const char *text) |
| Handles save callback for badge display name. | |
| static void | onBadgeInfoSave (const char *text) |
| Handles save callback for badge info line 1. | |
| static void | onBadgeInfo2Save (const char *text) |
| Handles save callback for badge info line 2. | |
Variables | |
| static hal::IDisplay * | s_display = nullptr |
| External dependencies injected by AppUi. | |
| static hal::ISleepController * | s_sleep = nullptr |
| static LockScreenView * | s_lockScreen = nullptr |
| static constexpr uint8_t | BADGE_STEP_NONE = 0 |
| Badge text editing workflow state. | |
| static constexpr uint8_t | BADGE_STEP_NAME = 1 |
| static constexpr uint8_t | BADGE_STEP_INFO = 2 |
| static constexpr uint8_t | BADGE_STEP_INFO2 = 3 |
| static uint8_t | s_badgeTextPendingStep = BADGE_STEP_NONE |
| uint16_t cdc::ui::settings::brightnessStepCallback | ( | uint16_t | current, |
| bool | increasing ) |
Returns adaptive brightness step size.
| current | Current slider value. |
| increasing | Direction flag. |
Definition at line 92 of file SettingsHandlers.cpp.
Referenced by cdc::ui::ui_init().
| void cdc::ui::settings::init | ( | hal::IDisplay * | display, |
| hal::ISleepController * | sleep, | ||
| LockScreenView * | lockScreen ) |
Initializes shared dependencies used by the settings handlers.
| display | Display service used for brightness and rendering-related settings. |
| sleep | Sleep controller used for auto-sleep configuration. |
| lockScreen | Lock screen view used to reflect updated badge text. |
Definition at line 46 of file SettingsHandlers.cpp.
References cdc::ui::display, s_display, s_lockScreen, and s_sleep.
Referenced by cdc::ui::ui_init().
| bool cdc::ui::settings::loadDisplayField | ( | const char * | key, |
| char * | out, | ||
| size_t | outSize ) |
Reads one display text field from NVS into the caller buffer.
| key | NVS key for the field. |
| out | Destination buffer. |
| outSize | Capacity of out in bytes. |
Definition at line 289 of file SettingsHandlers.cpp.
Referenced by cdc::os_ui::SystemSettingsBackup::exportSystemSettings().
|
static |
Handles save callback for badge info line 2.
| text | Saved text value. |
Definition at line 260 of file SettingsHandlers.cpp.
References BADGE_STEP_NONE, s_badgeTextPendingStep, s_lockScreen, and saveDisplayField().
Referenced by showBadgeTextStep().
|
static |
Handles save callback for badge info line 1.
| text | Saved text value. |
Definition at line 249 of file SettingsHandlers.cpp.
References BADGE_STEP_INFO2, s_badgeTextPendingStep, s_lockScreen, and saveDisplayField().
Referenced by showBadgeTextStep().
|
static |
Handles save callback for badge display name.
| text | Saved text value. |
Definition at line 238 of file SettingsHandlers.cpp.
References BADGE_STEP_INFO, s_badgeTextPendingStep, s_lockScreen, and saveDisplayField().
Referenced by showBadgeTextStep().
| void cdc::ui::settings::onBrightnessChange | ( | uint16_t | value | ) |
Applies backlight preview without persisting.
| value | Slider value in 0..10 scale. |
Definition at line 80 of file SettingsHandlers.cpp.
References s_display.
Referenced by cdc::ui::ui_init().
| void cdc::ui::settings::onBrightnessSave | ( | uint16_t | value | ) |
Persists and applies selected backlight value.
| value | Slider value in 0..10 scale. |
Definition at line 68 of file SettingsHandlers.cpp.
References s_display.
Referenced by cdc::ui::ui_init().
| void cdc::ui::settings::onDateConfirm | ( | uint8_t | day, |
| uint8_t | month, | ||
| uint16_t | year ) |
Applies confirmed date to system time.
| day | Day value. |
| month | Month value. |
| year | Year value. |
Definition at line 146 of file SettingsHandlers.cpp.
Referenced by cdc::ui::ui_init().
| void cdc::ui::settings::onPinChangeComplete | ( | bool | success | ) |
Handles completion of PIN-change flow.
| success | Indicates whether PIN change succeeded. |
Definition at line 185 of file SettingsHandlers.cpp.
References cdc::ui::ViewStack::instance(), and cdc::ui::ViewStack::pop().
Referenced by cdc::ui::ui_init().
| void cdc::ui::settings::onSleepIntervalSave | ( | uint16_t | value | ) |
Saves lock-screen sleep interval in minutes.
| value | Sleep interval in minutes. |
Definition at line 108 of file SettingsHandlers.cpp.
References s_sleep.
Referenced by cdc::ui::ui_init().
| void cdc::ui::settings::onTimeConfirm | ( | uint8_t | hour, |
| uint8_t | minute ) |
Applies confirmed time to system clock.
| hour | Hour value. |
| minute | Minute value. |
Definition at line 166 of file SettingsHandlers.cpp.
Referenced by cdc::ui::ui_init().
| void cdc::ui::settings::onTimezoneSave | ( | uint16_t | value | ) |
Saves timezone offset and refreshes lock-screen clock.
| value | Slider value mapped to UTC offset. |
Definition at line 119 of file SettingsHandlers.cpp.
References cdc::hal::getRtcInstance(), and s_lockScreen.
Referenced by cdc::ui::ui_init().
| void cdc::ui::settings::processPendingBadgeText | ( | ) |
Processes the next pending badge-text wizard step.
Definition at line 56 of file SettingsHandlers.cpp.
References BADGE_STEP_NONE, s_badgeTextPendingStep, and showBadgeTextStep().
Referenced by cdc::ui::ui_process().
| void cdc::ui::settings::saveDisplayField | ( | const char * | key, |
| const char * | value ) |
Saves one display text field to NVS.
| key | NVS key for the field. |
| value | Field value to persist. |
Definition at line 272 of file SettingsHandlers.cpp.
Referenced by cdc::os_ui::SystemSettingsBackup::importSystemSettings(), onBadgeInfo2Save(), onBadgeInfoSave(), onBadgeNameSave(), and cdc::ui::ui_init().
|
static |
Forward declarations for internal helper callbacks.
Shows one step of badge-text wizard.
| step | Wizard step identifier. |
Definition at line 203 of file SettingsHandlers.cpp.
References BADGE_STEP_INFO, BADGE_STEP_INFO2, BADGE_STEP_NAME, cdc::ui::LockScreenView::MAX_TEXT_LEN, onBadgeInfo2Save(), onBadgeInfoSave(), onBadgeNameSave(), s_lockScreen, cdc::ui::showT9Input(), and cdc::ui::tr().
Referenced by processPendingBadgeText(), and startBadgeTextEdit().
| void cdc::ui::settings::startBadgeTextEdit | ( | ) |
Starts badge-text editing wizard.
Definition at line 194 of file SettingsHandlers.cpp.
References BADGE_STEP_NAME, and showBadgeTextStep().
Referenced by cdc::ui::onSettingsSelect().
|
staticconstexpr |
Definition at line 27 of file SettingsHandlers.cpp.
Referenced by onBadgeNameSave(), and showBadgeTextStep().
|
staticconstexpr |
Definition at line 28 of file SettingsHandlers.cpp.
Referenced by onBadgeInfoSave(), and showBadgeTextStep().
|
staticconstexpr |
Definition at line 26 of file SettingsHandlers.cpp.
Referenced by showBadgeTextStep(), and startBadgeTextEdit().
|
staticconstexpr |
Badge text editing workflow state.
Definition at line 25 of file SettingsHandlers.cpp.
Referenced by onBadgeInfo2Save(), and processPendingBadgeText().
|
static |
Definition at line 29 of file SettingsHandlers.cpp.
Referenced by onBadgeInfo2Save(), onBadgeInfoSave(), onBadgeNameSave(), and processPendingBadgeText().
|
static |
External dependencies injected by AppUi.
Definition at line 18 of file SettingsHandlers.cpp.
Referenced by init(), onBrightnessChange(), and onBrightnessSave().
|
static |
Definition at line 20 of file SettingsHandlers.cpp.
Referenced by init(), onBadgeInfo2Save(), onBadgeInfoSave(), onBadgeNameSave(), onTimezoneSave(), and showBadgeTextStep().
|
static |
Definition at line 19 of file SettingsHandlers.cpp.
Referenced by init(), and onSleepIntervalSave().