CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::ui::BlePairingView Class Reference

Discoverable/pairing-mode screen. More...

#include <BlePairingView.h>

Inheritance diagram for cdc::ui::BlePairingView:
cdc::ui::ViewBase cdc::ui::IView

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

Detailed Description

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.

Member Function Documentation

◆ getName()

const char * cdc::ui::BlePairingView::getName ( ) const
inlineoverridevirtual

Get view name for debugging

Implements cdc::ui::IView.

Definition at line 26 of file BlePairingView.h.

◆ onEnter()

void cdc::ui::BlePairingView::onEnter ( void * context)
overridevirtual

Called when view becomes active (pushed or becomes top)

Parameters
contextOptional 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.

◆ onExit()

void cdc::ui::BlePairingView::onExit ( )
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().

◆ onKey()

InputResult cdc::ui::BlePairingView::onKey ( char key)
overridevirtual

Handle key press

Parameters
keyKey character ('0'-'9', 'Y', 'N', etc.)
Returns
Input result

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.

◆ onTick()

void cdc::ui::BlePairingView::onTick ( uint32_t nowMs)
overridevirtual

Called periodically for animations/timers

Parameters
nowMsCurrent 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().

◆ render()

void cdc::ui::BlePairingView::render ( bool partial)
overridevirtual

The documentation for this class was generated from the following files: