|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Public Member Functions | |
| void | init (uint16_t slot, const char *name) |
| Initializes the code view for a specific account slot. | |
| void | onEnter (void *context) override |
| Refreshes code state when the view is entered. | |
| void | onResume () override |
| Refreshes code state when the view resumes. | |
| void | onTick (uint32_t nowMs) override |
| Updates the TOTP countdown/code once per second. | |
| void | render (bool partial) override |
| Renders account metadata, code, and validity/progress UI. | |
| ui::InputResult | onKey (char key) override |
| Handles key actions for back, edit, next (HOTP), and typing. | |
| const char * | getName () const override |
| Returns the static view identifier. | |
| const char * | getFooterHint () const override |
| Returns context-aware footer hint text. | |
| Public Member Functions inherited from cdc::ui::ViewBase | |
| virtual | ~ViewBase ()=default |
| void | onEnter (void *context) override |
| void | onExit () override |
| void | onResume () override |
| void | onPause () override |
| void | setLifecycleHooks (void(*onHide)(void *), void(*onShow)(void *), void *userData) override |
| bool | needsRender () const override |
| void | markDirty () override |
| void | clearDirty () override |
| void | setFooterHint (const char *hint) override |
| const char * | getFooterHint () const override |
| Public Member Functions inherited from cdc::ui::IView | |
| virtual | ~IView ()=default |
| virtual bool | prefersLightRefresh () const |
| virtual InputResult | onLongPress (char key) |
Additional Inherited Members | |
| Protected Member Functions inherited from cdc::ui::ViewBase | |
| void | setTitle (const char *title) |
| const char * | getTitle () const |
| Protected Attributes inherited from cdc::ui::ViewBase | |
| bool | dirty_ = true |
| const char * | title_ = nullptr |
| const char * | customFooter_ = nullptr |
| void(* | onHide_ )(void *) = nullptr |
| void(* | onShow_ )(void *) = nullptr |
| void * | lifecycleUserData_ = nullptr |
Definition at line 445 of file TwoFaModule.cpp.
|
inlineoverridevirtual |
Returns context-aware footer hint text.
Reimplemented from cdc::ui::IView.
Definition at line 628 of file TwoFaModule.cpp.
References cdc::core::getKeyboard(), and cdc::ui::tr().
|
inlineoverridevirtual |
Returns the static view identifier.
Implements cdc::ui::IView.
Definition at line 622 of file TwoFaModule.cpp.
|
inline |
Initializes the code view for a specific account slot.
| slot | Logical OATH slot. |
| name | Account display name. |
Definition at line 452 of file TwoFaModule.cpp.
References name.
|
inlineoverridevirtual |
Refreshes code state when the view is entered.
| context | Optional enter context (unused). |
Implements cdc::ui::IView.
Definition at line 465 of file TwoFaModule.cpp.
References cdc::ui::ViewBase::dirty_, cdc::ui::showToastError(), and cdc::ui::tr().
|
inlineoverridevirtual |
Handles key actions for back, edit, next (HOTP), and typing.
| key | Pressed key code. |
Implements cdc::ui::IView.
Definition at line 587 of file TwoFaModule.cpp.
References cdc::ui::CONSUMED, cdc::core::getKeyboard(), cdc::ui::IGNORED, cdc::ui::ViewBase::markDirty(), cdc::ui::REQUEST_POP, cdc::ui::showToastError(), cdc::ui::showToastSuccess(), cdc::ui::tr(), valid, and cdc::mod_2fa::wizardEdit().
|
inlineoverridevirtual |
Refreshes code state when the view resumes.
Invariant: onResume is also invoked by modal dismissal, so it must not show a modal (toast) itself. The time-invalid state is rendered inline.
Implements cdc::ui::IView.
Definition at line 481 of file TwoFaModule.cpp.
References cdc::ui::ViewBase::dirty_.
|
inlineoverridevirtual |
Updates the TOTP countdown/code once per second.
HOTP entries are not regenerated on tick: their code is counter-based and advancing it would consume counters silently.
| nowMs | Current uptime in milliseconds. |
Reimplemented from cdc::ui::IView.
Definition at line 495 of file TwoFaModule.cpp.
References cdc::ui::ViewBase::markDirty().
|
inlineoverridevirtual |
Renders account metadata, code, and validity/progress UI.
| partial | true for partial redraw, false for full redraw. |
Implements cdc::ui::IView.
Definition at line 508 of file TwoFaModule.cpp.
References cdc::ui::ViewBase::clearDirty(), cdc::hal::getDisplayInstance(), cdc::ui::render::printText(), and cdc::ui::tr().