|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <BlePairingPromptView.h>
Public Member Functions | |
| void | prepare (uint16_t connHandle, uint32_t passkey, uint32_t timeoutMs=30000) |
| void | render (bool partial) override |
| InputResult | onKey (char key) override |
| void | onTick (uint32_t nowMs) override |
| void | onEnter (void *context) override |
| const char * | getName () const override |
| const char * | getFooterHint () const override |
| 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 |
BLE pairing numeric-comparison prompt view.
Shown when a remote peer requests Numeric Comparison pairing. Displays the 6-digit code that the host shows and waits for the user to accept (Y) or reject (N). On timeout, the prompt rejects automatically.
Keys: Y = Accept pairing (sends respondToNumericComparison(handle, true)) N = Reject pairing
Definition at line 19 of file BlePairingPromptView.h.
|
inlineoverridevirtual |
Get footer hint text (e.g., "[Y] OK [N] Back") Return nullptr for no footer
Reimplemented from cdc::ui::IView.
Definition at line 35 of file BlePairingPromptView.h.
|
inlineoverridevirtual |
Get view name for debugging
Implements cdc::ui::IView.
Definition at line 34 of file BlePairingPromptView.h.
|
overridevirtual |
Called when view becomes active (pushed or becomes top)
| context | Optional context data from parent |
Implements cdc::ui::IView.
Definition at line 31 of file BlePairingPromptView.cpp.
References cdc::ui::ViewBase::dirty_.
|
overridevirtual |
Handle key press
| key | Key character ('0'-'9', 'Y', 'N', etc.) |
Implements cdc::ui::IView.
Definition at line 48 of file BlePairingPromptView.cpp.
References cdc::ui::CONSUMED, cdc::ui::IGNORED, cdc::ui::KEY_NO, and cdc::ui::KEY_YES.
|
overridevirtual |
Called periodically for animations/timers
| nowMs | Current time in milliseconds |
Reimplemented from cdc::ui::IView.
Definition at line 36 of file BlePairingPromptView.cpp.
References LOG_W, and cdc::ui::TAG.
| void cdc::ui::BlePairingPromptView::prepare | ( | uint16_t | connHandle, |
| uint32_t | passkey, | ||
| uint32_t | timeoutMs = 30000 ) |
Configure the prompt and reset timeout.
| connHandle | BLE connection handle being paired. |
| passkey | Six-digit confirmation code shown by the remote host. |
| timeoutMs | Timeout in milliseconds before automatic rejection. |
Definition at line 21 of file BlePairingPromptView.cpp.
References cdc::ui::ViewBase::dirty_.
|
overridevirtual |
Render view content to display buffer
| partial | True for partial update, false for full refresh |
Implements cdc::ui::IView.
Definition at line 72 of file BlePairingPromptView.cpp.
References cdc::ui::ViewBase::clearDirty(), cdc::ui::display, cdc::ui::render::drawDialogFrame(), and cdc::hal::getDisplayInstance().