|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Discoverable/pairing-mode screen. More...
#include <BlePairingView.h>
Public Member Functions | |
| void | onEnter (void *context) override |
| void | onExit () override |
| void | onTick (uint32_t nowMs) override |
| void | render (bool partial) override |
| InputResult | onKey (char key) override |
| const char * | getName () 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 |
Discoverable/pairing-mode screen.
Makes the badge discoverable so a host can initiate BLE bonding. While shown it puts the keyboard provider into its discoverable state (advertising the HID profile), holds a sleep inhibitor, and keeps the inactivity timer reset so the central numeric-comparison prompt is shown instead of being rejected on lock.
Keys: N = Leave pairing mode
Definition at line 19 of file BlePairingView.h.
|
inlineoverridevirtual |
Get view name for debugging
Implements cdc::ui::IView.
Definition at line 26 of file BlePairingView.h.
|
overridevirtual |
Called when view becomes active (pushed or becomes top)
| context | Optional context data from parent |
Implements cdc::ui::IView.
Definition at line 22 of file BlePairingView.cpp.
References cdc::ui::SleepManager::addSleepInhibitor(), cdc::ui::ViewBase::dirty_, cdc::hal::getBluetoothControllerInstance(), cdc::core::getKeyboard(), cdc::ui::SleepManager::instance(), and kSleepInhibitor.
|
overridevirtual |
Called when view is being removed from stack
Implements cdc::ui::IView.
Definition at line 33 of file BlePairingView.cpp.
References cdc::core::getKeyboard(), cdc::ui::SleepManager::instance(), kSleepInhibitor, and cdc::ui::SleepManager::removeSleepInhibitor().
|
overridevirtual |
Handle key press
| key | Key character ('0'-'9', 'Y', 'N', etc.) |
Implements cdc::ui::IView.
Definition at line 54 of file BlePairingView.cpp.
References cdc::ui::IGNORED, cdc::ui::KEY_NO, and cdc::ui::REQUEST_POP.
|
overridevirtual |
Called periodically for animations/timers
| nowMs | Current time in milliseconds |
Reimplemented from cdc::ui::IView.
Definition at line 38 of file BlePairingView.cpp.
References cdc::hal::getBluetoothControllerInstance(), cdc::ui::ViewStack::instance(), cdc::ui::ViewBase::markDirty(), and cdc::ui::ViewStack::resetInactivityTimer().
|
overridevirtual |
Render view content to display buffer
| partial | True for partial update, false for full refresh |
Implements cdc::ui::IView.
Definition at line 59 of file BlePairingView.cpp.
References cdc::ui::ViewBase::clearDirty(), cdc::ui::display, cdc::ui::render::drawFooterBar(), cdc::ui::render::drawHeaderCentered(), cdc::hal::getBluetoothControllerInstance(), cdc::hal::getDisplayInstance(), name, cdc::ui::render::printText(), cdc::ui::render::printTruncated(), and cdc::ui::tr().