Kleidos API Search

In development. It changes without notice.

Topic

State Context & Shared Flows

What every state handler shares: the context and its sleep path, the handler's interface, and the flows that several states run.

Those flows are the pairing prompt, the choice of a host, the page that adds a host, and the binding of the unlock entry to the vault. They take the context; what can do without it is in Shared Screen Parts or State Rules.

See also
Application States, Entry Point & State Dispatch, Shared Screen Parts, State Rules

Files

file src/states/fsm/app_context.h
Shared mutable application context passed between FSM state handlers.
file src/states/fsm/app_runtime.h
Thin seam exposing the few main.cpp-local runtime symbols that the serial console of a debug build needs.
file src/states/fsm/app_state_handler.h
Abstract interface implemented by every FSM state handler.
file src/states/fsm/ble_pair_prompt.h
The numeric-comparison prompt every pairing surface shows, and the pairing-window state they all read.
file src/states/fsm/host_select_shared.h
Shared chrome, geometry, constants, and debug fixtures for the two BLE host screens extracted from HomeStateHandler.
file src/states/fsm/pair_host_page.h
Settings' add-host page: opens the pairing window for one more host.
file src/states/fsm/pin_entry_binding.h
How a board's keys drive its secret's entry, the same on every screen that asks for it.

Classes

struct kleidos::AppContext
All shared mutable state and hardware references exchanged between FSM state handlers. Constructed once in main.cpp and passed by reference. More about kleidos::AppContext
class kleidos::AppStateHandler
Lifecycle interface for a single FSM state; subclasses own one screen flow. More about kleidos::AppStateHandler
class kleidos::PairHostPage
Settings' add-host page: owns one pairing-window session. More about kleidos::PairHostPage

Typedefs

usingkleidos::states::PairPromptResult
What the owner answered the numeric-comparison prompt (pair_window_logic.h).

Enumerations

enum class kleidos::PairHostResult : uint8_t { kleidos::PairHostResult::Stay, kleidos::PairHostResult::Paired, kleidos::PairHostResult::Cancelled, kleidos::PairHostResult::TimedOut, kleidos::PairHostResult::ListFull, kleidos::PairHostResult::RadioFailed }
What one tick of the add-host page decided. More about kleidos::PairHostResult
enum class kleidos::states::pin_entry::PinEntryBinding : uint8_t { PinEntryBinding::ArcOnSelect , PinEntryBinding::DigitStepper , PinEntryBinding::ArcOnPrimary }
Which keys drive a board's secret entry. More about kleidos::states::pin_entry::PinEntryBinding
enum class kleidos::states::pin_entry::EntryKeys : uint8_t { EntryKeys::None , EntryKeys::Back }
What pollCountedEntryKeys read from the keys around a counted entry. More about kleidos::states::pin_entry::EntryKeys

Functions

voidkleidos::wipeCredRowCache ()
Zeroize the session row cache (defined in cred_row_cache.cpp).
voidkleidos::fillCredRowCache (AppContext &ctx, kleidos::vault::seg::UnitTick tick)
Refill the session row cache from the open vault's list index (defined in cred_row_cache.cpp).
voidkleidos::dropVaultSessionKeys ()
Drop the vault facade's copy of the session key material (defined in app_context.cpp).
AppContext &kleidos::app::ctx () noexcept
Reference to the file-scoped AppContext singleton (valid after setup()).
AppStateHandler *kleidos::app::getHandler (AppState state)
Resolve the FSM handler for a state, or nullptr for transient states.
voidkleidos::app::transitionTo (AppState target)
Run the exit/enter transition between FSM states: exit the current handler, swap appState, enter the new handler and take its entry step.
const char *kleidos::app::appStateName (AppState state)
Uppercase debug name of an application state.
const char *kleidos::app::bleStackStateName (kleidos::ble::StackState state)
Uppercase debug name of a BLE stack state.
PairPromptResultkleidos::states::showBlePairPrompt (ButtonInput &confirmBtn, ButtonInput *cancelBtn)
Show the numeric-comparison prompt when one is pending, and answer it.
BleLinkkleidos::states::bleLinkNow ()
What the link is doing, as every pairing surface shows it.
boolkleidos::states::blePairingInFlight ()
Whether a pairing is in flight.
boolkleidos::states::bleRadioSpent ()
Whether the radio will admit nothing more.
boolkleidos::states::stopBleRadio ()
Stop the Bluetooth stack if any part of it is still up.
ui::ListRowSizekleidos::states::hostshared::hostRowSize (const ui::LayoutContext &layout)
const char *kleidos::states::hostshared::bondListTitle (const ui::LayoutContext &layout)
The bond manager's title: "BLE hosts" where it fits, "Hosts" on the narrow Stick header.
boolkleidos::states::hostshared::hostShowsBack (const ui::LayoutContext &layout)
Whether the host screens draw the header back chip: on the boards that draw their own touch controls.
int16_tkleidos::states::hostshared::hostHeaderH (const ui::LayoutContext &layout)
Header band height for the host screens (no subtitle; the back chip raises it to the tap floor where it is drawn).
ui::Rectkleidos::states::hostshared::hostBackHit (const ui::LayoutContext &layout)
The header back chip's hit box (empty where no chip is drawn).
ui::Rectkleidos::states::hostshared::hostBodyRect (const ui::LayoutContext &layout)
Body rect between the header and the footer shelf the list draws into, ending above the first row the pointer does not own.
ui::HeaderPropskleidos::states::hostshared::hostSelectHeaderProps (const AppContext &ctx)
Header props shared by every host frame: brand mark + the picker's "Send to…" title plus the live status cluster (the bond manager swaps in bondListTitle or the host's name).
constexpr PinEntryBindingkleidos::states::pin_entry::pinEntryBindingFor (bool epaper, bool hasThirdButton, bool keyboard)
Pick the keys that drive a board's secret entry.
PinEntryBindingkleidos::states::pin_entry::boardBinding (const AppContext &ctx)
The keys that drive this board's secret entry.
ButtonInput &kleidos::states::pin_entry::arcKey (AppContext &ctx)
The key a PIN is dialed with on this board.
voidkleidos::states::pin_entry::beginPinEntry (AppContext &ctx, AuthEntryUI::VerifyCallback verify, AuthEntryUI::LockoutCallback lockout)
Start the secret's entry the way this board enters it.
ui::lockout_countdown::LockStatuskleidos::states::pin_entry::lockoutStatus ()
The brute-force lockout, as an entry that counts a wrong secret reads it: the seconds it holds and why.
voidkleidos::states::pin_entry::endPinEntry (AppContext &ctx)
Close an entry surface: wipe what it collected and release what beginPinEntry holds for it.
boolkleidos::states::pin_entry::inputActive ()
Whether someone is driving an input on this tick: a key, a button the board maps, or a finger on the glass.
boolkleidos::states::pin_entry::clearOnUpPress (AppContext &ctx, bool upPressed)
Clear the entered digits on a ▲ press, where ▲ clears (the CoreInk dial).
boolkleidos::states::pin_entry::pollArcClear (AppContext &ctx)
Read ▲ and clear the entered digits, where ▲ clears (the CoreInk dial).
EntryKeyskleidos::states::pin_entry::pollCountedEntryKeys (AppContext &ctx)
Read the keys a counted entry outside the unlock screen shares with it.

Variables

std::array< CredentialEntry, kMaxCredentials >kleidos::s_menuCredEntries
Backing store for AppContext::MenuModel::credEntries.
std::array< CredentialEntry, kMaxTotp >kleidos::s_menuTotpEntries
Backing store for AppContext::MenuModel::totpEntries.
OnboardingStateHandler *kleidos::app::s_onboardingState
Live onboarding handler (button-driven variants only).
constexpr uint8_tkleidos::states::hostshared::kHostMaxBonds
constexpr uint8_tkleidos::states::hostshared::kHostMacChars
constexpr uint8_tkleidos::states::hostshared::kHostNameChars
constexpr int16_tkleidos::states::hostshared::kHostFooterH
constexpr int16_tkleidos::states::hostshared::kNarrowTitleWidthPx

Back to the top

Enumeration Type Documentation

EntryKeys #

enum class kleidos::states::pin_entry::EntryKeys : uint8_t

What pollCountedEntryKeys read from the keys around a counted entry.

Enumerator
None 

Nothing for the caller: no key, or a clear it already applied.

Back 

Backed out (the dedicated back key, or a B hold on two buttons).

PairHostResult #

enum class kleidos::PairHostResult : uint8_t

What one tick of the add-host page decided.

Enumerator
Stay 

The page keeps the frame (and the radio).

Paired 

A new host bonded; PairHostPage::pairedSlot names it.

Cancelled 

The owner left the page.

TimedOut 

Nothing paired before the page gave up.

ListFull 

The table is full; the radio was never started.

RadioFailed 

Bluetooth would not start.

PinEntryBinding #

enum class kleidos::states::pin_entry::PinEntryBinding : uint8_t

Which keys drive a board's secret entry.

Enumerator
ArcOnSelect 

The dial held on the select key (the CoreInk's center press); ▲ clears.

DigitStepper 

Three keys: back, press, forward (the touch buttons of the keypad boards).

ArcOnPrimary 

The dial held on the primary key (the Sticks); a keyboard ignores it.

Back to the top

Function Documentation

appStateName() #

const char * kleidos::app::appStateName(AppState state)

Uppercase debug name of an application state.

Used by the serial debug log line and the debug console's state command to print the active FSM state in human-readable form. The mapping is one-to-one with the AppState enum.

Parameters
NameDirectionMeaning
stateinState to name.
Returns
Static, NUL-terminated uppercase name (e.g. "PIN_ENTRY"), or "UNKNOWN" for out-of-range values.

arcKey() #

ButtonInput & kleidos::states::pin_entry::arcKey(AppContext & ctx)
nodiscard

The key a PIN is dialed with on this board.

Parameters
NameDirectionMeaning
ctxinThe application context.
Returns
The center press on the CoreInk dial, the primary key elsewhere.

beginPinEntry() #

void kleidos::states::pin_entry::beginPinEntry(AppContext & ctx, AuthEntryUI::VerifyCallback verify, AuthEntryUI::LockoutCallback lockout)

Start the secret's entry the way this board enters it.

Where the entry method has a shake gesture (the dial's shake-to-clear, AuthEntryUI::readsShake) it also holds the IMU for it, powered and behind its motion gate (ShakeDetector::holdForGesture), and hands the entry the detector as its samples: the shake-to-lock gesture, which owns the sensor's power and is off by default in every debug build, would otherwise leave it suspended under a reader that cannot see that, and a read made past the detector would be one the main loop's idle rule does not know of. An entry method without the gesture (the touch keyboard, the passphrase) holds nothing. The hold is a single slot rather than a count: one AuthEntryUI exists, so at most one entry surface is live, and a flow that re-opens entry per step (change of secret, re-encryption) must not take a hold per step. endPinEntry releases it.

Parameters
NameDirectionMeaning
ctxin, outThe application context (its entry UI and keys).
verifyinCalled with the entered secret.
lockoutinReturns the remaining lockout, or null for none.
See also
endPinEntry

bleLinkNow() #

BleLink kleidos::states::bleLinkNow()

What the link is doing, as every pairing surface shows it.

Read from the stack's published state, so a surface that repaints right after the owner answered the prompt shows a host that is still pairing as pairing (BleLink::Pairing), never as the page it showed before a host came: the answer returns only once the state it leaves is published.

Returns
Connected while a host holds the link, Pairing while one is pairing, Visible otherwise.

blePairingInFlight() #

bool kleidos::states::blePairingInFlight()

Whether a pairing is in flight.

True while a numeric comparison is pending, and while a link is up that has not authenticated yet — the window between an accepted prompt and the bond. A surface that closes its pairing window on a clock must hold while this is true, or it cuts the bond it asked the owner for.

Returns
Whether a pairing is under way.

bleRadioSpent() #

bool kleidos::states::bleRadioSpent()

Whether the radio will admit nothing more.

True when the stack never came up (a failed or vetoed start) and when its advertising budget is spent, which leaves the stack initialized but silent. A pairing page with nothing linked and nothing pairing has no reason to wait past that point.

Returns
Whether nothing more can connect.

bleStackStateName() #

const char * kleidos::app::bleStackStateName(kleidos::ble::StackState state)

Uppercase debug name of a BLE stack state.

Used by the serial debug log line that fires on every BLE-state transition. The mapping is one-to-one with the kleidos::ble::StackState enum.

Parameters
NameDirectionMeaning
stateinBLE stack state to name.
Returns
Static, NUL-terminated uppercase name, or "UNKNOWN" for out-of-range values.

boardBinding() #

PinEntryBinding kleidos::states::pin_entry::boardBinding(const AppContext & ctx)
nodiscard

The keys that drive this board's secret entry.

Parameters
NameDirectionMeaning
ctxinThe application context (its third key, if any).
Returns
The binding pinEntryBindingFor picks for this board.

bondListTitle() #

const char * kleidos::states::hostshared::bondListTitle(const ui::LayoutContext & layout)

The bond manager's title: "BLE hosts" where it fits, "Hosts" on the narrow Stick header.

Parameters
NameDirectionMeaning
layoutinActive layout context.
Returns
The localized title.

clearOnUpPress() #

bool kleidos::states::pin_entry::clearOnUpPress(AppContext & ctx, bool upPressed)

Clear the entered digits on a ▲ press, where ▲ clears (the CoreInk dial).

Parameters
NameDirectionMeaning
ctxin, outThe application context.
upPressedinTrue when ▲ was pressed this frame.
Returns
True when the digits were cleared.

ctx() #

AppContext & kleidos::app::ctx()
noexcept

Reference to the file-scoped AppContext singleton (valid after setup()).

Return a reference to the file-scoped AppContext singleton (valid after setup()).

Returns
Reference to the shared application context.

dropVaultSessionKeys() #

void kleidos::dropVaultSessionKeys()

Drop the vault facade's copy of the session key material (defined in app_context.cpp).

The facade keeps the key it last unlocked with, the kleidos-enc / kleidos-mac sub-keys derived from it and the authenticated meta.bin snapshot, so a list read does not re-derive them per unit. Wiping VaultSession::vaultKey leaves that copy in RAM. Runs VaultStore::invalidateSession, which wipes it on the vault worker, after any vault call already in flight rather than under it.

Declared here rather than reached through the vault facade (vault_store.h), which is heavy: every file including this header would parse it. AppContext::wipeVaultSession calls it.

See also
VaultStore::invalidateSession

endPinEntry() #

void kleidos::states::pin_entry::endPinEntry(AppContext & ctx)

Close an entry surface: wipe what it collected and release what beginPinEntry holds for it.

The entry forgets everything entered on it (AuthEntryUI::wipeEntered), so an abandoned prompt, by whatever route the state was left, keeps neither a half-entered secret nor the last digit of a whole one. Then the IMU hold goes. Idempotent, so a state whose exit runs without an entry surface having opened costs nothing, and a surface left by an unusual path (a debug console's jump, a lock-out) cannot leak the hold or the digits. Called from the exit() of every state that can host one: the unlock screen itself, HOME (which hosts the change-PIN and re-encryption flows and the backup passphrase prompts) and first-run setup.

Parameters
NameDirectionMeaning
ctxin, outThe application context.
See also
beginPinEntry

fillCredRowCache() #

void kleidos::fillCredRowCache(AppContext & ctx, kleidos::vault::seg::UnitTick tick)

Refill the session row cache from the open vault's list index (defined in cred_row_cache.cpp).

The second half of the same inversion as wipeCredRowCache, and for the same reason: cred_row_cache.h includes THIS header, so the dependency only works in this direction. AppContext::readListsInUnits owns the refill because the cache is keyed by row POSITION and that function rewrites the positions, so the cache must be rebuilt on the vault the read already holds open rather than behind a mount of its own on the first list frame.

Parameters
NameDirectionMeaning
ctxin, outContext whose list the cache is keyed against.
tickinBetween-unit paint slot, or nullptr for none.
See also
CredRowCache::fillFromOpenVault

getHandler() #

AppStateHandler * kleidos::app::getHandler(AppState state)

Resolve the FSM handler for a state, or nullptr for transient states.

Return the FSM handler for the given application state, or nullptr.

Called by the dispatcher in loop() to translate ctx().appState into the live handler pointer. Returns nullptr for transient / terminal states (e.g. AppState::BootCheck) that have no live handler; the dispatcher treats a nullptr return as a hard error and falls into goToSleep().

Parameters
NameDirectionMeaning
stateinApplication state to resolve.
Returns
Pointer to the active handler, or nullptr for unhandled states.
See also
appStateName(), currentDebugScreenName()

hostBackHit() #

ui::Rect kleidos::states::hostshared::hostBackHit(const ui::LayoutContext & layout)
inline

The header back chip's hit box (empty where no chip is drawn).

Parameters
NameDirectionMeaning
layoutinActive layout context.
Returns
The rect a tap on the chip answers in.

hostBodyRect() #

ui::Rect kleidos::states::hostshared::hostBodyRect(const ui::LayoutContext & layout)
inline

Body rect between the header and the footer shelf the list draws into, ending above the first row the pointer does not own.

Parameters
NameDirectionMeaning
layoutinActive layout context (screen geometry).
Returns
The list body rectangle between the header and footer bands.

hostHeaderH() #

int16_t kleidos::states::hostshared::hostHeaderH(const ui::LayoutContext & layout)
inline

Header band height for the host screens (no subtitle; the back chip raises it to the tap floor where it is drawn).

Parameters
NameDirectionMeaning
layoutinActive layout context (screen geometry).
Returns
Header band height in pixels.

hostRowSize() #

ui::ListRowSize kleidos::states::hostshared::hostRowSize(const ui::LayoutContext & layout)
inline

Host row density: label + MAC sub-line. On a 1-bit panel the list's own row (the name at body size, like every other list there), and on the short keyboard panel the compact row so two hosts show at once; elsewhere the roomy density, fewer per screen.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The row size host lists draw with.

hostSelectHeaderProps() #

ui::HeaderProps kleidos::states::hostshared::hostSelectHeaderProps(const AppContext & ctx)

Header props shared by every host frame: brand mark + the picker's "Send to…" title plus the live status cluster (the bond manager swaps in bondListTitle or the host's name).

Parameters
NameDirectionMeaning
ctxinApplication context (battery / BLE status for the cluster).
Returns
Populated header props for a host screen frame.

hostShowsBack() #

bool kleidos::states::hostshared::hostShowsBack(const ui::LayoutContext & layout)
inline

Whether the host screens draw the header back chip: on the boards that draw their own touch controls.

Parameters
NameDirectionMeaning
layoutinActive layout context.
Returns
true where the chip is drawn.

inputActive() #

bool kleidos::states::pin_entry::inputActive()
nodiscard

Whether someone is driving an input on this tick: a key, a button the board maps, or a finger on the glass.

For a prompt that has to tell someone who is typing from someone who walked away (entry_idle_logic.h). Read through each input's own accessor without consuming anything: a button keeps its edges for the entry, and the levels are the hand's, the wake gate aside.

Return values
ValueMeaning
trueA key waits to be read, a button is down or the glass is touched.
falseNo input.

lockoutStatus() #

ui::lockout_countdown::LockStatus kleidos::states::pin_entry::lockoutStatus()

The brute-force lockout, as an entry that counts a wrong secret reads it: the seconds it holds and why.

Every counted entry (the unlock screen, Change PIN's current secret, Re-encrypt's proof, the vault-only wipe's confirm) passes this as its lockout callback, so a lockout in force refuses input and counts down on every one of them. While a lock holds because the build binds the vault to a device key this chip does not hold, the cause is named instead of a countdown that never runs (lockout_countdown.h); the key is only looked at while a lock holds.

A surface asks on every tick, and the guard is not read on every one of them: on a build that binds the attempt counter to the device a read drives the hardware SHA/AES engines, and a sound that is playing gives way to each use of them. The read is made when a surface opens, when the guard's record has changed (a counted wrong secret, a reset, a lock cleared) and twice a second while a lock holds; the last read answers in between (lockout_read_logic.h). Called by the UI task only.

Returns
The lockout read; 0 seconds when no lockout is active.

pinEntryBindingFor() #

PinEntryBinding kleidos::states::pin_entry::pinEntryBindingFor(bool epaper, bool hasThirdButton, bool keyboard)
constexpr

Pick the keys that drive a board's secret entry.

Parameters
NameDirectionMeaning
epaperinTrue on the e-paper dial board.
hasThirdButtoninTrue when the board wires a third navigation key.
keyboardinTrue on a keyboard board.
Returns
The board's binding.

pollArcClear() #

bool kleidos::states::pin_entry::pollArcClear(AppContext & ctx)

Read ▲ and clear the entered digits, where ▲ clears (the CoreInk dial).

Reads ▲ only on that board, so the key stays untouched elsewhere.

Parameters
NameDirectionMeaning
ctxin, outThe application context.
Returns
True when the digits were cleared.

pollCountedEntryKeys() #

EntryKeys kleidos::states::pin_entry::pollCountedEntryKeys(AppContext & ctx)

Read the keys a counted entry outside the unlock screen shares with it.

Change PIN's current-secret step and the vault wipe's prompt answer the same keys the unlock screen does, so a mis-dialed digit can be cleared instead of submitted as a counted failure:

  • the dedicated back key (AppContext::consumeBack) backs out;
  • the CoreInk dial's ▲ clears the digits (pollArcClear);
  • on two buttons, a B hold backs out and a B tap clears the digits.

Reads B only on the two-button boards, where the dial holds A; elsewhere B belongs to the entry.

Parameters
NameDirectionMeaning
ctxin, outThe application context.
Returns
EntryKeys::Back when the entry was backed out of; otherwise EntryKeys::None, with any clear already applied.

showBlePairPrompt() #

PairPromptResult kleidos::states::showBlePairPrompt(ButtonInput & confirmBtn, ButtonInput * cancelBtn)

Show the numeric-comparison prompt when one is pending, and answer it.

Blocks on the modal until the owner answers or it lapses, then resolves the request either way: an unanswered request is refused by the stack after 30 s and the host's pairing fails. The modal closes at once when the request stops pending without it (the debug console answered it, or the stack let it go): that answer stands, the prompt tells the stack nothing more, and it returns that answer, so every surface reacts to a console answer as to the same answer on the glass. The passkey is zeroized once it is drawn.

Parameters
NameDirectionMeaning
confirmBtnin, outThe caller's A slot, which accepts.
cancelBtnin, outThe caller's B slot, which refuses (may be null).
Returns
What was answered, or NotAsked when no request was pending.

stopBleRadio() #

bool kleidos::states::stopBleRadio()

Stop the Bluetooth stack if any part of it is still up.

The call a surface that owns a pairing window makes when it closes it. Blocks for up to 1.5 s inside the facade's teardown; a stack already off costs nothing.

Return values
ValueMeaning
trueSomething was running and the teardown completed.
falseNothing was running, or the teardown timed out.

transitionTo() #

void kleidos::app::transitionTo(AppState target)

Run the exit/enter transition between FSM states: exit the current handler, swap appState, enter the new handler and take its entry step.

Defined by the serial console (debug_console.cpp), which runs between the main loop's ticks, outside every frame, so it takes the entering state's entry step (AppStateHandler::takeEntryStep: the admin portal's bring-up) right after enter(), as the state's first update() would take it: a command that moved to a state and reads what its entry did (the console's LAN portal command, a power-measurement run's admin phase) reads it done.

Parameters
NameDirectionMeaning
targetinState to transition into.
Note
Updates ctx().prevState as a side effect.

wipeCredRowCache() #

void kleidos::wipeCredRowCache()

Zeroize the session row cache (defined in cred_row_cache.cpp).

Declared here rather than included: cred_row_cache.h includes THIS header, so the dependency only works in this direction. AppContext::wipeVaultSession needs it because the row cache holds decrypted origin domains that must die with the vault key, and AppContext::loadCredentialList needs it because the cache is keyed by row POSITION and a reload re-sorts the list.

See also
CredRowCache::reset

Back to the top

Variable Documentation

kHostFooterH #

int16_t kleidos::states::hostshared::kHostFooterH
inlineconstexpr

Reserved footer band for the host screens' ActionBar shelf. Matches the band the vault menu / settings reserve so the content geometry is identical.

kHostMacChars #

uint8_t kleidos::states::hostshared::kHostMacChars
inlineconstexpr

Sizes each per-row sub-line buffer. Both host screens write the same thing there — the address's last three octets, enough to tell two bonds apart on a 135 px row — or, on a narrow row, the live link's own word, which is longer than an address in some languages.

kHostMaxBonds #

uint8_t kleidos::states::hostshared::kHostMaxBonds
inlineconstexpr

Bond-table capacity (mirrors ble::Facade::kMaxBonds). Both host screens materialize at most this many bonded-host rows.

kHostNameChars #

uint8_t kleidos::states::hostshared::kHostNameChars
inlineconstexpr

Sizes each row's own copy of the host's name. A row's label points into this copy, never into the bond record it was read from, which lives only as long as the loop that read it. It holds the bond table's whole name (ble::kNameMaxBytes, checked where the rows are built).

kNarrowTitleWidthPx #

int16_t kleidos::states::hostshared::kNarrowTitleWidthPx
inlineconstexpr

Widest panel that takes the short host-list title ("Hosts"): the 135 px Stick header beside the brand mark.

s_menuCredEntries #

std::array<CredentialEntry, kMaxCredentials> kleidos::s_menuCredEntries
extern

Backing store for AppContext::MenuModel::credEntries.

The two menu arrays are the only capacity-scaled statics in AppContext, and they are the reason the storage lives out here instead of inside the struct: a section attribute applies to a whole VARIABLE, never to one member, so the only way to park them in external RAM would be to tag the enclosing AppContext — which also holds VaultSession::vaultKey and the staged plaintext VaultSession::bleCredential. MenuModel therefore holds these two objects by reference and AppContext itself stays in internal DRAM by construction.

Warning
SECURITY: this array may be PSRAM-resident (see KLEIDOS_EXT_RAM_BSS_DEFINE). It holds credential DISPLAY NAMES, ids and list ordering only — no password, no key material. Never widen CredentialEntry with secret-bearing fields, and never move VaultSession next to it.
See also
AppContext::wipeVaultSession

s_menuTotpEntries #

std::array<CredentialEntry, kMaxTotp> kleidos::s_menuTotpEntries
extern

Backing store for AppContext::MenuModel::totpEntries.

Same rationale, security boundary and lifetime as s_menuCredEntries. Note the element type is CredentialEntry (id + display name), NOT TotpEntry — the TOTP shared secret is never part of the menu model.

Back to the top