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

#include <BlePairingPromptView.h>

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

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

Detailed Description

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.

Member Function Documentation

◆ getFooterHint()

const char * cdc::ui::BlePairingPromptView::getFooterHint ( ) const
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.

◆ getName()

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

Get view name for debugging

Implements cdc::ui::IView.

Definition at line 34 of file BlePairingPromptView.h.

◆ onEnter()

void cdc::ui::BlePairingPromptView::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 31 of file BlePairingPromptView.cpp.

References cdc::ui::ViewBase::dirty_.

◆ onKey()

InputResult cdc::ui::BlePairingPromptView::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 48 of file BlePairingPromptView.cpp.

References cdc::ui::CONSUMED, cdc::ui::IGNORED, cdc::ui::KEY_NO, and cdc::ui::KEY_YES.

◆ onTick()

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

Called periodically for animations/timers

Parameters
nowMsCurrent time in milliseconds

Reimplemented from cdc::ui::IView.

Definition at line 36 of file BlePairingPromptView.cpp.

References LOG_W, and cdc::ui::TAG.

◆ prepare()

void cdc::ui::BlePairingPromptView::prepare ( uint16_t connHandle,
uint32_t passkey,
uint32_t timeoutMs = 30000 )

Configure the prompt and reset timeout.

Parameters
connHandleBLE connection handle being paired.
passkeySix-digit confirmation code shown by the remote host.
timeoutMsTimeout in milliseconds before automatic rejection.

Definition at line 21 of file BlePairingPromptView.cpp.

References cdc::ui::ViewBase::dirty_.

◆ render()

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

Render view content to display buffer

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


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