In development. It changes without notice.
Topic
Settings Screen & Service
The settings screen, its overlays and wizards, and the service that reads and applies an option.
The service is the half of the option model (Settings Model) that touches the device: it applies a value, steps it, runs an action and words a value for the screen. The portal reaches the same service through an adapter here.
Files | |
| file | src/ |
BLE bond-manager collaborator for SettingsController. | |
| file | src/ |
Change-PIN wizard collaborator for SettingsController. | |
| file | src/ |
| Headless finite-state machine for the change-PIN wizard. | |
| file | src/ |
CharWheel text-editor collaborator for SettingsController. | |
| file | src/ |
| "Sync time from GPS" progress overlay (HAS_GPS boards). | |
| file | src/ |
| What the settings tree's info overlay does with a tick's keys, and the captions its bar shows. Pure, host-testable. | |
| file | src/ |
NTP-server manager collaborator for SettingsController. | |
| file | src/ |
| "Sync via Wi-Fi" progress overlay for the keyboard boards. | |
| file | src/ |
| What the settings overlays show while and after a one-shot NTP sync. | |
| file | src/ |
| The keys and captions of a single-select picker on button boards. | |
| file | src/ |
| The "PIN dial style" row's flow: pick a style, practice it, save it. | |
| file | src/ |
| The admin portal's view of the running application, over the live context. | |
| file | src/ |
"Re-encrypt vault" wizard collaborator for SettingsController. | |
| file | src/ |
| Headless step machine for the on-device "Re-encrypt vault" flow. | |
| file | src/ |
| The "Set clock" overlay and its commit core. | |
| file | src/ |
| Shared destructive / power settings actions (both renderers). | |
| file | src/ |
| Implementation of the value-addressed settings read/apply seam. | |
| file | src/ |
| Value-addressed read/apply for every settings option (all surfaces). | |
| file | src/ |
Settings-subsystem collaborator for HomeStateHandler. | |
| file | src/ |
The settings tree's select dispatcher: what activating each option does (part of SettingsController). | |
| file | src/ |
| Headless two-level cursor over the capability-driven settings model. | |
| file | src/ |
Settings leaf-overlay collaborator for SettingsController. | |
| file | src/ |
The single-select dropdown picker of SettingsOverlaysController: language, HID layout and relock policy. | |
| file | src/ |
The read-only info screens of SettingsOverlaysController: battery, device, About and the rest, paged where they run long. | |
| file | src/ |
The helpers the overlay families of SettingsOverlaysController share across its sources. | |
| file | src/ |
The numeric stepper editor of SettingsOverlaysController: brightness, auto-off, auto-lock, deep sleep, the PIN-arc sweep and shake sensitivity. | |
| file | src/ |
The timezone picker of SettingsOverlaysController: a single-select list over the zone table, with each zone's offset where the panel is wide enough. | |
| file | src/ |
| Shared numeric-stepper spec + commit for settings (both renderers). | |
| file | src/ |
| Shared live-value formatter for settings option rows (both renderers). | |
| file | src/ |
Shared host seam for the text editors extracted from SettingsController, plus the editor content-area geometry. | |
| file | src/ |
| On-screen keyboard text editor for the boards that draw their own touch controls. | |
| file | src/ |
Saved-WiFi-network manager collaborator for SettingsController. | |
Classes | |
| class | kleidos:: |
| Callbacks the bond manager invokes on the parent handler. More about kleidos:: | |
| class | kleidos:: |
| Owns the BLE bond manager: state, drawing, input, delete-confirm, debug. More about kleidos:: | |
| class | kleidos:: |
| Callbacks the change-PIN wizard invokes on the parent handler. More about kleidos:: | |
| class | kleidos:: |
| Owns the change-PIN wizard: state, drawing, auth loop, re-encrypt. More about kleidos:: | |
| class | kleidos:: |
| Headless change-PIN router; owns the candidate/ | |
| class | kleidos:: |
| Owns the CharWheel text editor: state, drawing, input, animation, debug. More about kleidos:: | |
| class | kleidos:: |
| Owns the GPS-sync overlay: engine lifecycle, drawing, and input. More about kleidos:: | |
| struct | kleidos:: |
| One tick's keys, read in the board's shape. More about kleidos:: | |
| struct | kleidos:: |
| What one tick's keys do to the overlay. More about kleidos:: | |
| class | kleidos:: |
| Owns the NTP-server manager: state, drawing, input, sync progress. More about kleidos:: | |
| class | kleidos:: |
| Owns the keyboard-board NTP sync overlay: engine start, drawing and input. More about kleidos:: | |
| class | kleidos:: |
| The PIN dial style picker, its practice and the saved screen. More about kleidos:: | |
| class | kleidos:: |
| AdminAppHost over a live AppContext. More about kleidos:: | |
| class | kleidos:: |
| Owns the re-encryption wizard: secret entry, progress screen, retirement. More about kleidos:: | |
| class | kleidos:: |
| Headless router for the re-encryption flow. Owns no secret and no key. More about kleidos:: | |
| struct | kleidos:: |
A compile-date triple parsed from the preprocessor __DATE__ literal. More about kleidos:: | |
| class | kleidos:: |
| Owns the field-by-field Set-clock overlay: state, drawing, and input. More about kleidos:: | |
| class | kleidos:: |
| Callbacks the settings subsystem invokes on the parent handler. More about kleidos:: | |
| class | kleidos:: |
| Owns the settings tree, its overlays, and the settings-launched sub-controllers (change-PIN, bond manager, text editors). More about kleidos:: | |
| class | kleidos:: |
| Headless settings-tree cursor over the capability-driven model. More about kleidos:: | |
| class | kleidos:: |
| Callbacks the settings leaf overlays invoke on SettingsController. More about kleidos:: | |
| class | kleidos:: |
| Owns the settings leaf overlays: stepper editor, dropdown picker, and info screens (state + drawing + per-tick input). More about kleidos:: | |
| struct | kleidos:: |
| The numeric stepper overlay's bands, derived once for the draw and the pointer: the header, the control centered in the body, and the footer that carries the Save hint. More about kleidos:: | |
| struct | kleidos:: |
| A row's trailing accessory + (for value rows) its current value text. The value string points either at a pooled i18n literal (stable) or at the caller-supplied scratch buffer (copy it before the buffer is reused). More about kleidos:: | |
| class | kleidos:: |
| Callbacks the text editors invoke on the parent handler. More about kleidos:: | |
| class | kleidos:: |
| Owns the on-screen keyboard text editor: value, keyboard state, drawing and input. More about kleidos:: | |
| class | kleidos:: |
| Owns the saved-WiFi-network manager: state, drawing, input, forget-confirm. More about kleidos:: | |
Functions | |
| constexpr i18n:: | kleidos:: |
The title of the change wizard's step on surface. | |
| InfoKeys | kleidos:: |
| The dial's keys as the overlay reads them. | |
| InfoStep | kleidos:: |
What keys do to a panel showing page. | |
| bool | kleidos:: |
| Whether the panel's bar offers the reveal. | |
| bool | kleidos:: |
| Mask the Privacy key panel's key once its time is up; call on every tick. | |
| kleidos:: | kleidos:: |
| The captions under an info panel. | |
| void | kleidos:: |
| Toast why the engine refused to start a sync. | |
| void | kleidos:: |
| Toast how a sync ended. | |
| void | kleidos:: |
| Paint the syncing screen's body: the caption, the progress bar and the server being asked. | |
| PickKeys | kleidos:: |
| Read one frame of a picker's keys and move the focus (wrapping). | |
| ui:: | kleidos:: |
| The captions under a picker for this board's keys. | |
| uint8_t | kleidos:: |
| Read the persisted timezone index, clamped into table range. | |
| constexpr SetClockBuildDate | kleidos:: |
Parse a _ literal ("Mmm dd yyyy") into a date triple. | |
| constexpr uint32_t | kleidos:: |
| Map an edited local date/time model to a UTC Unix epoch. | |
| constexpr uint32_t | kleidos:: |
| Map an edited local date/time model to a UTC Unix epoch (DST honored). | |
| constexpr bool | kleidos:: |
| Defensive lower-bound guard on a to-be-committed UTC epoch. | |
| bool | kleidos:: |
| Commit an edited local date/time to the RTC (UTC) and persist its zone. | |
| void | kleidos:: |
| Empty the vault, keeping its secret: the vault-only wipe. | |
| void | kleidos:: |
| Replace the Bluetooth privacy key (IRK), forgetting every host. | |
| void | kleidos:: |
| The destructive half of confirmWipeVault, on its own. | |
| void | kleidos:: |
| Restore every device preference to its default, keeping the vault. | |
| void | kleidos:: |
| Erase everything: the factory reset. | |
| constexpr bool | kleidos:: |
| Whether the toggle moved the device's live state. | |
| ToggleOutcome | kleidos:: |
| Flip or step an option in place, and persist it. | |
| ToggleOutcome | kleidos:: |
| Set an in-place toggle option to an absolute state. | |
| bool | kleidos:: |
| What an on-device toggle tells the owner once 2FA codes are on, on a board without an RTC chip. | |
| void | kleidos:: |
| Confirm, then enter deep sleep now. | |
| uint8_t | kleidos:: |
| Number of choices a picker offers, for index validation. | |
| const char * | kleidos:: |
| The option's own display title, translated. | |
| const char * | kleidos:: |
| Label for one choice of a picker-backed option. | |
| int32_t | kleidos:: |
| Read an option's current value from live state. | |
| DependencyReader | kleidos:: |
| The reader a settings list hides a dependent row with. | |
| constexpr int32_t | kleidos:: |
The OptionId:: value that selects mode. | |
| constexpr int32_t | kleidos:: |
The OptionId:: value (picker index) that selects a mode. | |
| int32_t | kleidos:: |
| Clamp a proposed value to the option's own spec, touching nothing. | |
| bool | kleidos:: |
| Apply and persist an absolute value through the production commit path. | |
| void | kleidos:: |
| Load the stored keyboard layout and show its letters on the on-screen keyboards. | |
| ApplyOutcome | kleidos:: |
| Ask the UI core to apply an option value, and wait for it. | |
| void | kleidos:: |
| Drain pending apply requests. Call from the loop task only. | |
| constexpr bool | kleidos:: |
| Whether the button renderer can launch or edit this option. | |
| bool | kleidos:: |
| ui:: | kleidos:: |
| ui::Rect | kleidos:: |
| ui:: | kleidos:: |
| void | kleidos:: |
| uint8_t | kleidos:: |
| StepperBands | kleidos:: |
| StepperSpec | kleidos:: |
Resolve the stepper descriptor (range/opt. | |
| void | kleidos:: |
Format a stepper value in its unit into out. | |
| bool | kleidos:: |
Apply and persist a committed stepper value for opt. | |
| void | kleidos:: |
| Show an uncommitted stepper value where its effect can be seen. | |
| void | kleidos:: |
| Undo previewStepperValue, putting back what the stored value shows. | |
| void | kleidos:: |
| Push the keyboard light the owner set down to the board's keyboard. | |
| const char * | kleidos:: |
| The admin access-point identity policy (a Wi-Fi Admin Portal module, aliased for brevity). | |
| RowContent | kleidos:: |
| Resolve the live trailing accessory + value for an option row. | |
| const LabelTiers & | kleidos:: |
The label an option row shows now: its own, or the one that names the secret ("Change password" on a keyboard board or over a passphrase, secret_). | |
| ui::Rect | kleidos:: |
| Content rectangle (between the header and the action bar) both 2-button text editors fill. | |
Variables | |
| constexpr uint32_t | kleidos:: |
| How long an NTP sync toast stays on screen, in milliseconds. | |
Enumeration Type Documentation
ChangePinResult #
Outcome codes returned by each transition step of the change-PIN wizard.
ChangePinStep #
GpsSyncUiResult #
Outcome of one GpsSyncController::
InfoShape #
NtpSyncUiResult #
Outcome of one NtpSyncController::
PickKeys #
ReencryptOutcome #
What the screen has to report after the transition it just made.
ReencryptStep #
Screens of the on-device re-encryption flow.
SetClockKbPhase #
Two-step phase of the keyboard-board Set-clock flow.
The keyboard boards type the timestamp instead of nudging it one field at a time: DateTime collects the twelve YYYYMMDDHHMM digits, then Zone picks the timezone from a dropdown before committing.
SetClockResult #
Outcome of one SetClockController::
SettingsLevel #
SettingsSelectResult #
Outcome of activating the row under the cursor (SettingsNavLogic::
The Back row shares the activation gesture with every other row, so a select can also move the cursor up the tree — or out of it. The caller acts on the returned transition instead of re-deriving it from level deltas.
ToggleOutcome #
What flipping an in-place toggle established.
A toggle applies live before it persists, so "it did not work" is two different facts and a surface answers them differently. NotAToggle means the row was never a toggle and nothing on the device moved — there is nothing to report and nothing to redraw. NotStored means the device is already running the new state and only the next boot will disagree: the row MUST be redrawn (it moved) and the owner MUST be told (it will revert). Collapsing the two into one false is what let a Stick invert its whole theme, keep rendering the old row, and say nothing at all.
Function Documentation
applyOptionValue() #
Apply and persist an absolute value through the production commit path.
Clamps, then routes: steppers to commitStepperValue (which also enforces the deep-sleep ceiling and re-derives the dim time), toggles to setToggleOption, pickers to their own setters. Must be called from the UI core — see requestOptionApply for the httpd-task path.
- Parameters
-
Name Direction Meaning ctx in, out Live application context. id in Option to write. value in Desired value in the option's unit.
- Return values
-
Value Meaning true idis a value-bearing option, was applied, and the write that makes it survive a reboot landed.false idcarries no value, or the live value moved and the store did not take it — the surface reads back the new value from RAM and the device comes up with the old one.
changeStepTitle() #
The title of the change wizard's step on surface.
The current secret is named by the vault's kind, the new one by the kind it is typed as (states::): over a PIN vault a dial asks "Current PIN" and, for a passphrase typed as the new secret, "New
password"; a keyboard names either a password.
- Parameters
-
Name Direction Meaning step in The wizard's step. surface in The board's entry surface. current in The kind of secret the vault records. next in The kind the new secret is typed as.
- Returns
- The step's title.
choiceCountOf() #
Number of choices a picker offers, for index validation.
- Parameters
-
Name Direction Meaning id in A picker-backed option.
- Returns
- The choice count, or 0 when
idis not a picker.
choiceLabel() #
Label for one choice of a picker-backed option.
The choice list was written out four times — the button-nav dropdown, the keyboard panel, the admin portal and the serial console each had their own — so a language or layout could be named differently depending on where it was being changed. This is the one source.
- Parameters
-
Name Direction Meaning id in A picker-backed option. index in Choice index, < choiceCountOf.
- Returns
- The label (i18n-resolved where the option has translated choices), or
"?"whenindexis out of range.
clampOptionValue() #
Clamp a proposed value to the option's own spec, touching nothing.
Steppers clamp to stepperSpecFor's inclusive range and snap to its step; booleans collapse to 0/1; picker indices clamp to the choice count. This is range validation only: the cross-row idle-timer repair happens in the commit path, because it can move a neighboring option.
- Parameters
-
Name Direction Meaning ctx in Live application context (source of the live range). id in Option being edited. value in Proposed value.
- Returns
- The nearest value the option will accept.
commitStepperValue() #
Apply and persist a committed stepper value for opt.
Writes the option's NVS key and live subsystem state. For the three idle timers it enforces the deep-sleep ceiling (neither screen-off nor auto-lock exceeds deep sleep) via clampIdleTimers, repairing and persisting all three, and re-derives the dim time. Brightness applies to the backlight; the keyboard light to the keyboard driver; shake sensitivity to the detector; PIN sweep to the auth UI.
- Parameters
-
Name Direction Meaning ctx in, out Application context (live state to update). opt in The stepper option that was committed. value in The committed value (in the option's unit).
- Return values
-
Value Meaning true The live state moved and every NVS write landed. false optis not stepper-backed (nothing was written), or a write did not land: the row redraws with the new value and the device boots with the old one, so a surface must not report it saved.
confirmFactoryReset() #
Erase everything: the factory reset.
Asks twice for confirmation, as the most destructive action: runs kleidos::
- Parameters
-
Name Direction Meaning ctx in, out Application context.
confirmNewPrivacyKey() #
Replace the Bluetooth privacy key (IRK), forgetting every host.
Bonded hosts recognize the device behind its rotating private addresses by this key, so a new one means no host recognizes it: every bond goes with it. One sustained-press confirm, then the bonds are erased with the radio off and the next Bluetooth start creates the new key. Returns without effect if the confirm is declined, dismissed or times out.
- Parameters
-
Name Direction Meaning ctx in, out Application context (buttons for the confirm).
confirmResetSettings() #
Restore every device preference to its default, keeping the vault.
A single hold-to-confirm, as it is less destructive than a wipe. Restores the preference NVS keys, zeroizes the live session and restarts so every subsystem re-reads its default; the next boot asks for the same vault's secret. Returns without effect if the confirm is declined.
- Parameters
-
Name Direction Meaning ctx in, out Application context.
confirmSleepNow() #
Confirm, then enter deep sleep now.
Single confirm; on confirmation calls ctx.goToSleep(). Returns without effect if declined.
- Parameters
-
Name Direction Meaning ctx in, out Application context.
confirmWipeVault() #
Empty the vault, keeping its secret: the vault-only wipe.
Asks twice for confirmation, then asks for the current secret on the vault's own entry (sized to its shape, gated before it counts, the lockout read) and runs kleidos::
- Parameters
-
Name Direction Meaning ctx in, out Application context (buttons, audio, sleep).
dependencyReaderFor() #
The reader a settings list hides a dependent row with.
Answers from readOptionValue, so a row whose parent toggle reads 0 (the keyboard light's level while the light is off, the shake sensitivity while shake-to-lock is off) is not listed, on every renderer alike.
- Parameters
-
Name Direction Meaning ctx in Live application context; it must outlive the reader.
- Returns
- The reader, bound to
ctx.
dialInfoKeys() #
The dial's keys as the overlay reads them.
- Parameters
-
Name Direction Meaning key in The dial key this tick (kleidos:: states:: dial:: pollDialKeys). back in A back gesture already read this tick.
- Returns
- ▼ as "next", ▲ as "previous", an OK tap or hold as back.
drainOptionApplyQueue() #
Drain pending apply requests. Call from the loop task only.
Applies every queued request in order and releases the waiting callers. A no-op when the queue is empty, so it costs one queue peek per tick.
- Parameters
-
Name Direction Meaning ctx in, out Live application context.
drawPickerBar() #
Draws the picker's bar where the popover leaves it on screen, and records it in drawn so a gauge step repaints only what moved.
- Parameters
-
Name Meaning canvas The canvas to draw on. layout The active display layout. drawn Receives what was drawn.
drawSyncBody() #
Paint the syncing screen's body: the caption, the progress bar and the server being asked.
The caller paints the header above it and the cancel affordance below it. The server address is a public NTP server, never a secret.
- Parameters
-
Name Direction Meaning canvas in, out Canvas of the open frame. layout in Responsive layout of the active display. status in Engine snapshot to show. cancelButtonBelow in True when a Cancel button takes the action row; the server address then sits closer under the bar.
endStepperPreview() #
Undo previewStepperValue, putting back what the stored value shows.
Called when an edit is cancelled, so the backlight — the panel's or the keyboard's — returns to the stored level.
- Parameters
-
Name Direction Meaning ctx in Application context (the stored level is read from it). opt in The option that was being edited.
expireKeyReveal() #
Mask the Privacy key panel's key once its time is up; call on every tick.
- Parameters
-
Name Direction Meaning kind in The panel showing. reveal in, out Its key's reveal. nowMs in Monotonic milliseconds.
- Returns
trueexactly when this call masked the key: the panel draws again from its first row.
finishVaultWipe() #
The destructive half of confirmWipeVault, on its own.
One sustained-press confirm (never a tap), then the current secret and kleidos::sd_ names the backup it just wrote, which is the whole reason anyone would say yes. Together the two prompts are the same double confirm every wipe asks for.
Returns without effect if the confirm is declined, dismissed or times out. Does not return at all when the wipe runs: it zeroizes the live session and restarts the device.
- Parameters
-
Name Direction Meaning ctx in, out Application context (buttons, audio, sleep).
formatSecondsValue() #
The admin access-point identity policy (a Wi-Fi Admin Portal module, aliased for brevity).
Format an idle timeout: under a minute as "Ns", whole minutes as "Nm", otherwise as "Nm Ss".
- Parameters
-
Name Direction Meaning ms in Duration in milliseconds. buf out Caller scratch storage the formatted text is written into.
- Returns
- Pointer to
buf'sC string.
formatStepperValue() #
Format a stepper value in its unit into out.
- Parameters
-
Name Direction Meaning unit in The value's display unit. value in The value (in the unit's native scale). out out Destination buffer. cap in Capacity of outin bytes.
infoBarProps() #
The captions under an info panel.
Two buttons: B goes back on a hold; on a paged panel A / B taps turn the pages. Three (the Core zones): B goes back, and the next page is on C. The dial: ▲▼ turn the pages of a paged panel and OK closes it. On a masked Privacy key the "next" control (A, C, ▼) is named for the reveal.
- Parameters
-
Name Direction Meaning twoButtons in The board reads two face buttons and no third. page in The page the last draw showed. offerReveal in The panel is the Privacy key's, with its key masked. holdPctB in How far the B hold has filled (0..100).
- Returns
- The bar's props.
infoStep() #
What keys do to a panel showing page.
Back wins over everything. On a masked Privacy key (offerReveal) "next" reveals the key and draws the panel from its first row, in place of a page turn. Otherwise, on a table longer than a page, "next" turns to the next page (past the last, the first on the buttons and the dial) and "previous" to the one before (before the first, the last on the dial only); a turn to the page already drawn does nothing. On a one-page panel the buttons and the dial ignore both, and the Core zones take either as back.
- Parameters
-
Name Direction Meaning shape in The board shape the keys were read on. page in The page the last draw showed. current in The first row the panel draws from now. offerReveal in The panel is the Privacy key's, with its key masked. keys in This tick's keys.
- Returns
- The step to take.
isSettingImplemented() #
Whether the button renderer can launch or edit this option.
An option is listed only when its launch or edit path exists, so a settings row never does nothing. Adding a handler means adding its id here.
- Parameters
-
Name Direction Meaning id in The option to test.
- Return values
-
Value Meaning true The option is listed and works on this build. false The option is not offered by this renderer.
loadKeyboardLayout() #
Load the stored keyboard layout and show its letters on the on-screen keyboards.
The boot half of the OptionId:: picker: the BLE layer reads the stored byte into the layout the device types with, and the touch keyboards take that layout's letters, exactly as an applied change does. Called once, at boot.
offersKeyReveal() #
Whether the panel's bar offers the reveal.
- Parameters
-
Name Direction Meaning kind in The panel showing. reveal in Its key's reveal.
- Returns
trueon the Privacy key panel while its key is masked.
optionContent() #
Resolve the live trailing accessory + value for an option row.
Reads the option's live backing (a preference, a subsystem state, or a drill-in) and returns the accessory the renderer should draw. buf is caller storage for any formatted value; copy the returned value out before buf is reused for the next row (the formatters share one scratch buffer).
- Parameters
-
Name Direction Meaning opt in The option whose value to resolve. ctx in Live application context (subsystem state). buf out Caller scratch storage for a formatted value.
- Returns
- The row's trailing accessory and (for value rows) its value text.
optionLabel() #
The label an option row shows now: its own, or the one that names the secret ("Change password" on a keyboard board or over a passphrase, secret_).
- Parameters
-
Name Direction Meaning opt in The option. ctx in Live application context (the vault's secret kind).
- Returns
- The label tiers to draw.
optionTitle() #
The option's own display title, translated.
- Parameters
-
Name Direction Meaning id in Any option in the model.
- Returns
- The full-tier label, or
"?"whenidis not in the table.
overlayHeader() #
The header every full-screen overlay draws: its title beside the brand mark, and on the touch-control boards the back chip in the mark's place.
- Parameters
-
Name Meaning layout The active display layout. title The overlay's title, or null for none.
- Returns
- The header props to draw.
pickerBarProps() #
The captions under a picker for this board's keys.
- Parameters
-
Name Direction Meaning layout in Responsive context (its button count picks the binding). holdPctA in Fill of the A hold rule (two buttons). holdPctB in Fill of the B hold rule (two buttons).
- Returns
- The action-bar cells to draw under the popover.
pickerBox() #
The popover rect both single-select pickers (language / layout, timezone) are drawn in, sized to the options it lists. One definition, read by the draws, by the scroll windowing and by the pointer.
- Parameters
-
Name Meaning layout The active display layout. count How many options the picker lists. title The picker's title.
- Returns
- The popover rect.
pickerShape() #
The shape of a picker's popover as far as geometry goes: its title and whether it carries the back chip. The draw adds the options to it.
- Parameters
-
Name Meaning layout The active display layout. title The picker's title.
- Returns
- The props with the title and the back chip set, and no options.
pickerVisibleRows() #
Rows a picker's body fits, from the body the popover draws (dropdownBodyRect, which knows the title band's real height), so the scroll window the buttons move and the rows on the glass are one computation.
- Parameters
-
Name Meaning layout The active display layout. count How many options the picker lists. title The picker's title.
- Returns
- The number of rows the body shows at once.
pollPickerKeys() #
Read one frame of a picker's keys and move the focus (wrapping).
- Parameters
-
Name Direction Meaning ctx in, out Context holding the buttons; their edges are consumed. count in Number of options (0 reads nothing). focus in, out Focused option index, moved on a step.
- Returns
- What the keys asked for this frame.
previewStepperValue() #
Show an uncommitted stepper value where its effect can be seen.
Brightness drives the backlight to value while the owner adjusts it, and the keyboard light drives the keyboard's own; nothing is stored and the level every wake restores to is unchanged. Every other option has no visible effect and is left alone.
- Parameters
-
Name Direction Meaning ctx in Application context (read only). opt in The option being edited. value in The value on screen (in the option's unit).
pushKeyboardLight() #
Push the keyboard light the owner set down to the board's keyboard.
The level while the light is on, dark while it is off (kb_). The one way the stored switch and level reach the driver: the boot push, the switch, the level's commit and the end of a level preview all go through it. A board with no keyboard light is left alone.
- Parameters
-
Name Direction Meaning ctx in Application context (the switch and the level are read from it).
readOptionValue() #
Read an option's current value from live state.
Reads the same source the on-device renderer displays, so the portal can never disagree with the device about what is stored.
- Parameters
-
Name Direction Meaning ctx in Live application context. id in Option to read.
- Returns
- The value in the option's own unit; 0 for a valueless row.
refreshOptionValue() #
The OptionId:: value (picker index) that selects a mode.
The index choiceLabel names each e-paper refresh mode by, so a surface that names a mode (the serial console's refresh command) writes the same index the picker does.
- Parameters
-
Name Direction Meaning full in True for a full-panel refresh on every update, false for the partial damage-diff.
- Returns
- 1 for Full, 0 for Partial.
requestOptionApply() #
Ask the UI core to apply an option value, and wait for it.
Safe to call from the admin portal's httpd task: the apply itself runs in drainOptionApplyQueue on the loop task, so nothing touches the panel, the backlight or the detectors from Core 0. The caller blocks until the loop has finished, which bounds the response to one UI tick.
- Parameters
-
Name Direction Meaning id in Option to write. value in Desired value in the option's unit. timeoutMs in How long to wait for the loop to pick the request up.
- Returns
- Whether the value was applied, and whether it will survive a reboot. Read the stored result back with readOptionValue; the echoed value comes from the in-RAM context the apply updates first, so it cannot tell kleidos::
settings:: ApplyOutcome:: Stored from kleidos:: settings:: ApplyOutcome:: NotStored.
setClockCommit() #
Commit an edited local date/time to the RTC (UTC) and persist its zone.
Computes the UTC epoch via setClockToUtcEpoch (honoring the user's DST option from the timezone facade) and rejects it (no RTC write, returns false) when setClockEpochValid fails. Otherwise splits the epoch back into UTC calendar fields (calendar::) and writes both through the atomic rtc:: facade write — one combined backend apply, so the instant can never be observed half-written and the backend cost (NVS floor write / I2C burst) is paid once. Finally the selected zone index is persisted through timex:: (NVS + libc TZ export) so the next open pre-selects it and every display path switches with it.
- Parameters
-
Name Direction Meaning model in The edited local date/time (fields + selected zone index).
- Return values
-
Value Meaning true The epoch passed the guard, was written to the RTC, and the zone index was stored. false The epoch failed the guard (the RTC was left untouched), or the zone index did not persist — the wall clock the owner set is read through that zone, so the next boot would show a different time than the one they confirmed.
setClockEpochValid() #
Defensive lower-bound guard on a to-be-committed UTC epoch.
True only for epochs at/after calendar:: (2001-09-09), matching the admin portal's set-time request check (epoch >= 1e9). The widget's year floor of 2024 can never actually produce a sub-1e9 epoch, so this is a pure defensive check (also unit-testable in isolation).
- Parameters
-
Name Direction Meaning epoch in The candidate UTC Unix epoch.
- Return values
-
Value Meaning true The epoch is at/after the minimum valid seed. false The epoch is below the minimum valid seed (reject).
setClockParseBuildDate() #
Parse a _ literal ("Mmm dd yyyy") into a date triple.
Handles the space-padded single-digit day ("Jul 9 2026"). Pure and constexpr so the parser itself is pinned by the static_
- Parameters
-
Name Direction Meaning s in An 11-character __DATE__literal ("Mmm dd yyyy").
- Returns
- The parsed (year, month, day); an unrecognized month parses as 1.
setClockStoredZoneIdx() #
Read the persisted timezone index, clamped into table range.
Thin delegation to the user-timezone facade (timex::), which owns the NVS namespace/key pair and the out-of-range fallback. Kept as a named seam so the Set-clock editor's pre-fill and the settings list's current-local-time trailing value read the zone through one function.
- Returns
- The stored zone index, or 0 (UTC) when unset or out of range.
setClockToUtcEpoch() [1/2] #
Map an edited local date/time model to a UTC Unix epoch (DST honored).
- Parameters
-
Name Direction Meaning model in The edited local date/time (fields + selected zone index).
- Returns
- The corresponding UTC Unix epoch (seconds since 1970-01-01).
setClockToUtcEpoch() [2/2] #
Map an edited local date/time model to a UTC Unix epoch.
Reads the model's fields as a local instant in kZones[model.zoneIdx] (defensively falling back to UTC, index 0, for an out-of-range index) and converts to UTC via kleidos::. dstEnabled is the user's DST option: when off, the zone acts as its fixed standard offset. The seconds field is always zero (the widget edits to minute resolution).
- Parameters
-
Name Direction Meaning model in The edited local date/time (fields + selected zone index). dstEnabled in Honor the zone's DST rule (false ⇒ fixed offset).
- Returns
- The corresponding UTC Unix epoch (seconds since 1970-01-01).
setToggleOption() #
Set an in-place toggle option to an absolute state.
The value-addressed form toggleOption is built on, and the writer applyOptionValue routes every kleidos::
- Parameters
-
Name Direction Meaning ctx in, out Application context (audio / shake detector). id in The toggle option to set. on in Desired state.
- Returns
- Whether
idis a toggle, and whetheronwill survive a reboot.
stepperBands() #
The stepper overlay's bands.
- Parameters
-
Name Meaning layout The active display layout.
- Returns
- The header, control, footer, Save and back rects.
stepperSpecFor() #
Resolve the stepper descriptor (range/opt.
The value is clamped into [min, max], so an editor never opens outside its range (a QA build parks the idle timers at the never-fires sentinel).
- Parameters
-
Name Direction Meaning opt in A stepper-backed option id. ctx in Live application context (source of the current value).
- Returns
- The stepper spec; PIN sweep for any non-stepper id (defensive default).
textEditorContentArea() #
Content rectangle (between the header and the action bar) both 2-button text editors fill.
Shared by the draw pass and the focus-box / ring tween geometry so the animated and snapped positions are computed from one source of truth. Layout-only: it reads no member state.
- Parameters
-
Name Direction Meaning layout in Active-display responsive layout context.
- Returns
- The content safe-area rectangle.
themeOptionValue() #
The OptionId:: value that selects mode.
The seam's statement of the toggle's polarity: readOptionValue reports the live mode through it, setToggleOption maps a written value back to a mode through it, and a surface that names a mode rather than a value (the serial console's theme command) asks it which value to write. The settings tree's row does not: its formatter (optionContent) draws the switch from the mode itself, ON for ui::
- Parameters
-
Name Direction Meaning mode in A theme mode.
- Returns
- 1 for ui::
ThemeMode:: Light, 0 for ui:: ThemeMode:: Dark.
toastSyncOutcome() #
Toast how a sync ended.
Done shows a success toast and Failed a warning. Cancelled is the user's own abort and shows nothing, as does a phase that is not terminal.
A sync that failed because no access point would have it says so, and names the network and the channel the last attempt died on: that channel is the one thing an owner can act on, by moving the access point, and on the two boards that cannot transmit below a channel of their own it is the only remedy there is. Every other failure keeps the plain "sync failed" message, because a channel says nothing about a server that did not answer.
- Parameters
-
Name Direction Meaning status in The engine's terminal snapshot: its phase, its reason, and the network and channel of the last join attempt.
toastSyncRefused() #
Toast why the engine refused to start a sync.
No saved network gets its own message; every other refusal reads as a failed sync.
- Parameters
-
Name Direction Meaning reason in The refusal, read from kleidos:: net:: ntp:: status after kleidos:: net:: ntp:: begin returned false.
toastTotpCodesHeadsUp() #
What an on-device toggle tells the owner once 2FA codes are on, on a board without an RTC chip.
There a code needs a precise time sync since the board last slept, which the row alone does not say. The settings tree and the keyboard panel call this after a ToggleOutcome:: toggle and show their own confirmation only when it returns false. The seam (setToggleOption) stays silent: it is also the portal's and the console's commit path, and neither owns the glass. The portal says the same in the row's help text.
- Parameters
-
Name Direction Meaning id in The option the toggle just stored.
- Return values
-
Value Meaning true It raised the heads-up toast. false Nothing to say: another option, codes now off, or a board whose RTC chip keeps the time.
toggleMovedLiveState() #
Whether the toggle moved the device's live state.
- Parameters
-
Name Direction Meaning outcome in Outcome of a finished toggle.
- Return values
-
Value Meaning true The live state changed, so any row rendering it is stale.
toggleOption() #
Flip or step an option in place, and persist it.
Reads the option's value through readOptionValue and writes the next one through the settings seam. A toggle (a kleidos::
- Parameters
-
Name Direction Meaning ctx in, out Application context (audio / shake detector / display). id in The toggle or picker option to move.
- Returns
- Whether it moved, and whether the move will survive a reboot.
twoButton() #
Whether the board reads two face buttons and no third (the Sticks): taps move, an A hold does the thing and a B hold goes back.
- Parameters
-
Name Meaning ctx The board context whose inputs are read.
- Returns
- True on a board with no third face button.