Dentro de KodeOS

Esta página aún no está en español, así que se muestra en inglés.

Sheets and cards

The full-glass card kodeOS reuses for every page, the system cards and their shared frame, the keypad, the details of an app and a launch.

What it is

A sheet is a card that covers the whole glass. kodeOS builds one and writes a different page on it each time. The pages are:

  • The pages of the settings screen, in kshell's rail dress: Wi-Fi, Bluetooth, Settings and the pages Settings opens (Time, Battery and About), the Screen and Kody pages, the Self-test page and the list of auto-lock times.
  • The keypad, which a row of the Wi-Fi page opens to type a password or the name of a hidden network.
  • The details of an app, which TOP held or a finger held opens over a row of Apps or a disc of its shelf of recents, and the two cards Remove adds.
  • The system cards: the write screen and Didn't open, Stopped, Critical battery, Turn off, the Bluetooth pairing code, the two cards of the factory reset, the update card that offers a newer kodeOS, and the fault notice, kodeOS restarted.

A sheet has at most one button, such as Remove, Try again or Run again. BOT closes it, and so does a finger that goes down on the header of a card. The screen writes BOT for the bottom button. The write screen and the Removing card stay until their work ends. A list of choices and the keypad close back to the page that opened them. A settings page goes back one level with BOT or a swipe right. A system card takes no drag, except Turn off, which a swipe down closes; BOT alone closes the others, or answers no where the card asks a question. A system card that rises over a settings page closes onto that page; the card of a write closes onto the screen under it.

Some words name the marks and colours of a sheet:

  • The ring is the yellow outline that marks the selected row or button. The pad moves it.
  • The Ring, with a capital, is the circle or the line that fills while a button is held and turns while something is waited for.
  • The accent is Kody Blue, the colour of a radio that is on and of the chosen thing.
  • Level yellow is Bold Yellow, the colour of a level such as the brightness, and the ground of the one primary answer of a card.
  • Off grey is the warm charcoal (KUI_COLOR_OFF) of a switch that is off.

An answer has a role: primary, secondary or tertiary. The ink of a text is Soft Black or Light Grey, whichever reads on its ground.

How it is connected

flowchart TB
trig["a row, a hold, a write,<br/>a pairing, the system"] -- "gui_sheet_open_kind()" --> sig["GUI_SHEET_OPEN_SIG"]
subgraph gui["AO_Gui"]
  face["Gui_awake"] --> sf["Gui_sheet_face"]
  brow["Gui_browsing"] --> sh["Gui_sheet_home"]
  set["Gui_settings"] --> ss["Gui_sheet_settings"]
end
sig --> face
sig --> brow
sig --> set
sf --> card["the one sheet<br/>on lv_layer_top()"]
sh --> card
ss --> card
class sf ao
class sh ao
class ss ao
How a card gets onto the glass

One object, built once

ui_build() calls kui_sheet_create() on lv_layer_top(), the layer LVGL keeps above every screen, so one card covers the face, Apps and Settings without any of them knowing. The sheet is built at startup because a card created while a Bluetooth peer waits would spend the security manager's clock on an allocation.

  • The blocker is the transparent root, as large as the glass and clickable. It takes every touch while the card slides. It has no callback: a press that opens a card can still be down when the card appears, and the lift would arrive as a click on the blocker and close the card at once.
  • The card is the part you see. An animation moves it between y 0 and 502 (GUI_SHEET_HIDDEN_Y).
  • The sheet slides with an lv_anim and not a screen load, which keeps it off the path that can freeze the interface.
  • A system card rises on a spring instead, and the details open with the sheet's own rise.

Only one card exists at a time. When another page is wanted while a card is up, such as a pairing during a write or the keypad from a row of the Wi-Fi page, the same card is refilled (gui_sheet_fill_again_as()). You see its content change, and no second card slides in.

Three shells

QP gives a state one parent and a card can rise over three screens, so there are three short states, Gui_sheet_face, Gui_sheet_home and Gui_sheet_settings, each a child of its screen. Each calls the same gui_sheet_body(), which holds everything a sheet does: Q_SUPER(home) for what the sheet does not answer, Q_TRAN(home) for the close.

A transition from a child to its own parent runs no entry action, so the screen under the card is never reloaded.

Each shell swallows the auto-lock, the unlock, the door to Rest and the settings door, busy or not, because a door travels through the queue and could arrive after the card it was not meant to meet. Home (HOME_SIG) and the sheet's own signals are what it answers. The update card and the fault notice are the exceptions: under them the auto-lock's door and Rest's door take the card down with the glass (gui_sheet_hand_up()), the fault notice only while no report is being sent.

How a card opens

gui_sheet_open_kind() posts the kind and whichever screen is up answers with its shell. Over the face (awake or at Rest) only a system card that opens no page behind it may rise: the write screen, Didn't open, a pairing, Stopped, Critical battery, Turn off, the update card and the fault notice. gui_sheet_open_taken() refuses every other kind there, because a settings page over the lock screen would open the board from behind. The one exception is the Time page the face's yellow pill opens: it rises over the face and closes back to it. A list of choices and the keypad open only in place over their own page.

Two bodies

  • A sheet with rows shows a column of pill rows in body: the pages of Settings and the list of auto-lock times.
  • A sheet with text shows three lines, a note, a large code and one answer button, all permanent children of the card that the kit hides and C shows.
  • The keypad is neither: kgui_keyboard.c builds a field, a pill and twelve keys on the card.

me->sheet_n says which is up, and the pad's grammar follows it.

What closes a card

This is the whole list of causes. Anything else leaves the card up, so a page never vanishes while you read it. The auto-lock and Rest close no card but the update card and the fault notice.

CauseWhat happens
BOT released, or a drag down on the header of a cardgui_sheet_close(). A list of choices and the keypad go back to their page. A system card has no header drag, so only BOT closes it
An answer on a cardRemove turns the card into Removing. Try again keeps the card and turns it back into the write screen. Turn off keeps the card, since the board may not stop on a cable. Run again keeps the card under the launch scene. A pick in a list keeps the card and goes back to the page
HOME, BOT held 0.6 sOver Apps or the face the card closes (Apps stays at its root), and the face stays the face. Over Settings the screen goes back to Apps' root and the card goes with it. A busy card swallows it
The auto-lock, RestOnly the update card, and the fault notice while no report is being sent: both counts run under it and their door takes it down with the glass. The fault notice stays owed. Under any other card the counts hold
A page going backBOT released or a swipe right takes a settings page back one level
A pairing outcomeThe card closes after 1,200 ms (GUI_PAIR_HOLD_MS). A refusal by the peer closes it at once
The end of a busy writeThe write the launcher started stays until the restart. A failure turns the card into Didn't open in place
A guided factory testBTN_TEST_SIG and TOUCH_TEST_SIG prompts, LED_TEST_SIG and DISPLAY_TEST_SIG asks take the screen
The join of the keypadThe keypad goes back to the Wi-Fi page when the join works, and when Wi-Fi is turned off. The text is wiped first

A busy sheet answers no pad button and no touch: the write screen and the Removing card. The board does something a person cannot stop. They still disarm the presses they swallow, swallow HOME.

Specifications

The kinds

Every kind of card, what opens it and what it shows.

KindOpened byContentButton
WIFI, BLEThe Wi-Fi or Bluetooth circle, heldThe radio's rowsNone
MOREThe Settings circleOne flat list: Wi-Fi, Bluetooth, Battery, Time, Sleep after, Turn off after, Kody's scene, Vibration, While charging, Header 3.3 V, Header 5 V, Self-test, About (internals/gui/settings-screen)None
TIMESettings' Time row, or the face's yellow pillTime zone, Hour, Minute, Day, Month and Year, each changed where it stands. The rows follow the clock while the page is openNone
BATSettings' Battery row, or the battery circleReadingsNone
ABOUTSettings' About rowReadings, Software update and Factory resetNone
KODYNo row of the list opens it in this buildThe pack that plays, where it comes from, the progress or the reason of a failureUpdate, Retry, or none
AUTOLOCKNo row of the list opens it in this build; config key="lock" sets the timeSix times, the one that is on checkedNone
TESTSettings' Self-test row, or the end of a runThe row "Run the test", then the rows of the last runNone
KEYPADThe Wi-Fi page: a network with a password nobody saved, or Hidden networkA field, a Show password row and twelve keysThe yellow pill, Join or Next
DETAILSTOP held on an app's row, or a finger held on itThe icon, name, v<version> · <Category>, the rows Size and Built, the app's wordsRemove (danger), for an installed app and for a file that names its project
REMOVEThe Remove pill of the detailsRemove <app>?, "It leaves the Dot.", and "Its files go too." when a listed file is the app'sRemove (danger)
REMOVINGThe answer of REMOVEThe app's name while AO_AppMgr erases itNone: locked
OPENINGA launch of an app that cannot fly, or any flash writeThe percent in the middle of the edge, the name and a second lineNone: busy
FAILUREA failed write, or a run that never happenedThe name and up to three lines of whyTry again, or Close
STOPPEDThe first frame after an app that panicked, hit a watchdog or lost its supplyWhy, in one lineRun again (primary), when the app is listed
BATTERYThe charge at 10 % or under, with no cable in"Plug in the cable."None
POWEROFFThe held BOT on the face, or the Turn off circle"Turn off?" and two linesTurn off (danger), grey while a cable is in
PAIRINGA peer asking to pair (BLE_PAIR_SIG)The passkey, then the outcomeNone
RESETAbout's Factory reset row"Factory reset?", what goes and what staysReset (danger)
RESETTINGThe answer of RESETThe wait for AO_Boot, then why the reset did not happenNone: locked while it waits
UPDATEThe boot's question to the update service, when it names a newer kodeOSkodeOS, New release available, Version <x.y.z>, and why Update waits when it doesUpdate (level yellow), grey with no Wi-Fi address or a low charge
FAULTThe first free glass after KodeOS restarted from a fault of its ownkodeOS restarted, why in one line, and Kody's fault animation in a band at the footOK, or OK and Send

The geometry

The kit decides it (kui_sheet.c). Pixels on the 410 x 502 glass.

PartWhere and how big
CardAt (0, 0), 410 x 502, radius 114 (KUI_RADIUS_GLASS), the page's black. The corners land on the panel's arcs, so nothing sits near them
HandleTop centre, y 14, 36 x 5, ink at 35 %
Header discAt (32, 56), 112 px. A kit glyph is drawn 56 px, an app icon 112 px with a transparent clipped disc, a monogram in kui_font_title
Title and subtitlex 160, 218 px wide, one line cut with dots. Title y 80 with a subtitle, y 95 without; subtitle y 121
BodyAt (32, 188), 346 x 264: three rows at y 188, 280 and 372; more rows scroll
Lines 1 to 3y 188, 218 and 248 (30 px apart); the note at y 262
Passkeycode at y 226, code_l1 at y 296, code_l2 at y 324, centred
Answer buttonOne 160 x 60 button, centred, at y 395
Header, where a finger takes the cardFrom the top down to the foot of the title disc, y 168. On the keypad it ends at y 92; on the details it is the whole card; a system card has none
RowsAt most 32 (GUI_SHEET_ROWS_MAX)

The settings pages do not wear the header disc: they stand in kshell's dress (internals/gui/settings-screen), with a title bar (a centred title and a small arrow back, which a tap uses) and a flat list of rows that passes under it. Wi-Fi and Bluetooth start with a switch row that stays at the top while the rows under it scroll.

The system cards

A system card is a card the system raises, not a page a person opened. One table in kgui_ao.c, gui_syscard_of(), lists them, and every question about which kinds are system cards is asked of it: whether a kind is a system card, whether its answer is a hold, and whether it may rise over the face.

CardKind in gui_infoIts answerBOT
Write screenopeningNone: busy while a write or a run is in flightDoes nothing
Didn't openfailureTry again, a tap or TOP, or Close when nothing can be repeatedCloses it
PairingpairingNoneCloses it and refuses the passkey
StoppedstoppedRun again, a tap or TOPCloses it
Critical batterybatteryNoneCloses it. The cable going in closes it too
Turn offpoweroffTurn off, a tap or TOP releasedAnswers no. A swipe down answers no too
Factory resetresetReset, a tap or TOP releasedAnswers no
Factory reset, waitingresettingNone: locked until AO_Boot answersDoes nothing while it waits, closes the card after a refusal
UpdateupdateUpdate, a tap or TOP, which installs the release the card names. Grey, it installs nothingCloses it until the next boot
Fault noticefaultOK, or OK and Send when the build offers the report. Close and Retry after a failed sendCloses it. On the notice it answers as OK does

Every one of them but the two cards of the factory reset may rise over the face. The rule is the same for every row:

  • Raised by the system. A write, the failure of a write, a pairing, an app that stopped, a nearly empty cell, the hold of BOT on the face, a newer kodeOS or a restart after a fault raises the card. It takes no drag, and the only tap that acts is the one on its button.
  • Rise. A system card with no card under it rises from the bottom edge on a critically damped spring of 90 ms (KGUI_RISE_PERIOD_MS) and leaves in 80 ms (KGUI_RISE_FALL_MS). A veil in the card's colour lies over its content and clears over the last tenth of the way, so the text and the button are not there before the card is up.
  • A gate of 300 ms. The card ignores every input for 300 ms (KGUI_RISE_INPUT_MS) from the moment it began to rise, landed or not: the pad, the click of the button, TOP, and a held BOT. A press that began under the gate answers nothing even when its lift comes later.
  • A press already down is nobody's. A finger that is down as the card arrives, and a BOT that is down, are made to wait for their lift. The lift clicks nothing under the card, and the held button closes no card and locks nothing over it.
  • Home closes it where it can be closed, over the face as over Apps. The face stays locked. The hold of the thumb that woke the face is not a door.
  • A system card that takes over another in place (the write screen by Didn't open) does not rise again. Its gate shuts again for 300 ms.

The button of Turn off is the red one: a tap or TOP released confirms, and the card asks first, as the question of a card must.

The system frame

kgui_sysscreen.c draws the frame of every system card, adapted from the system screens of kshell. The frame is a black page with the edge along the glass: a line 24 px wide whose outer side is flush with the glass, with corners of 102 px, over a dark track. Inside the edge stand these parts, dressed for each card:

  • The protagonist is small, with its middle at y 104: an app's disc of 88 px, a glyph scaled to 96 px, a word, or the red battery of the Critical battery card.
  • A write's face: the share in kui_font_hero_160 (DM Sans Bold 160) with its top at y 172, the % under it in kui_font_display_40 at y 300, the name at y 359 and a second line at y 403, and small print at y 431.
  • A card's words: a name at y 160, a second line 46 px under it and up to three lines of detail, each 40 px under the one before. The words are centred in 350 px from x 30.
  • A pairing's code in kui_font_code_80 (DM Sans Bold 80) at y 160.
  • The pill with its top at y 370, 72 px tall and at least 173 px wide, with room for its yellow focus ring.

The edge has forms of its own: it fills with the percentage of a write, it spins while something is waited for (22 steps make a lap of 1,980 ms), it closes in 297 ms when the work is done, turns green and pops, thickening by 8 px and back, and it is cut when the work failed: it turns resting grey and a red dot of 15 px stands where it stopped. kgui_edge.c holds the curves with no LVGL, and a host test walks them.

The Ring

The Ring is one module, kgui_ring.c, for the progress and the waits of the interface. A Ring is made once and moved by number, so a pass allocates nothing. It has three shapes and several forms.

  • The circle is one LVGL arc that starts at the top and fills clockwise over a track. The launch turns one round the icon, 226 px across with a line of 10 px.
  • The screen Ring is a line that follows the edge of the glass, 12 px wide and 6 px in, over a track. It starts at the top middle. It lives on the card of the sheet and serves the write screen.
  • The edge of the system frame, above.

The forms:

FormWhat it does
ProgressShows a number a caller counts, in steps of 5 %: the percent of a write
SpinA quarter of the circle that goes round in 8 positions, 88 ms apart. It is the wait of a launch
DoneFull: the edge closed, or the write's progress is whole. It stays in this form until it is cancelled
CloseThe edge closes, turns green and pops (kgui_ring_done())

kgui_ring_pct_at() and kgui_ring_spin_at() are the model, with no LVGL in them.

The ink on a ground

A text that stands on a ground asks gui_ink_on() for its colour. Soft Black or Light Grey, whichever has the better contrast. Light Grey on Kody Blue or on Bold Yellow is the pairing the brand forbids, and a hand-written colour on a row would bring it back.

The rows that change in place

Five rows of the Settings list are settings that change where they stand, each with its value on the second line. No page opens for them:

RowValuesConsole keyTOP or a tapLeft or right
Sleep afterWith the auto-lock, 30 s, 1 min, 5 min, 10 min, Neverkody_sleepThe next timeThe time before, the next time
Turn off after20 minutes, 1 hour, 6 hours, 1 day, 7 days, Neveroff_afterThe next timeThe time before, the next time
Kody's sceneauto, or the name of a scenesceneThe next place of a ring: auto, then each scene of the packThe place before, the next place
VibrationOff, Light, Normalhaptic_uiThe next levelThe level before, the next level
While chargingStays awake, Sleepsusb_awakeFlips itNothing

A row that steps is Light Grey. A switch is Kody Blue while on and the off grey while off, and its second line says what it does, so colour is never the only sign.

The ring starts on row 0, so left and right change the brightness as soon as the page is up. A change applies at once, is stored, and is logged as <key>: <word> (stored). The same code serves the console, so a value changed there rebuilds the page too. A change clicks after it is made, so the level of haptics you chose is the one you feel; a change to Off is silent.

Turn off after. The setting is AO_LowPower's, and kgui asks for it by event, as it does for the volume: kode_config_post() reads it on every entry into the control centre and sets it on each step, and AO_LowPower applies and stores it. The words and their order come from AO_LowPower's own row (kode_config_find("off_after")); kgui_span_label() gives each word its English. The row appears only in a build with CONFIG_KODE_LOWPOWER, and an answer to the console's config key="off_after" moves it too.

The brightness. Left and right change the level by 5 % (GUI_LEVEL_STEP), never below 10 % (GUI_BRIGHT_MIN_PCT), because zero would blank the screen that shows the control. config key="bright" keeps its own range, 5 to 100. A finger on the bar sets the level at its x and a drag follows it, at most one change per 50 ms (GUI_LEVEL_DRAG_MS). Every change goes to AO_Display with display_brightness_request(pct, persist). A press and its drag samples pass persist false and the lift writes once, so a drag of twenty samples a second never writes twenty times. The row clears LV_OBJ_FLAG_SCROLL_CHAIN and sets LV_OBJ_FLAG_PRESS_LOCK, so a drag on the track never scrolls the page.

Wi-Fi

The Wi-Fi page is titled Wi-Fi. Row 0 is the switch, always, with Off, On or the network the board is on on its second line, and it stays at the top of the page while the rows under it scroll: accent when the service is on, KUI_COLOR_OFF when off, with on or off on its second line. With the service off it is the only row, over the line "Turn it on to see the networks near you". With it on, these follow:

  1. The network the board is on (accent, check glyph, Connected, -58 dBm).
  2. Kode ecosystem, while the board is linked. Its second line follows the channel's state (below).
  3. The networks the board remembers, most recently used first, minus the one it is on, with the lock glyph: Saved, or Saved, -60 dBm while the scan finds it. When AO_Radio has no room to list them, the page asks again on its next look.
  4. The networks found by the scan, minus the ones already shown and the ones that hide their name (Open, -71 dBm or Password, -71 dBm, with the lock glyph on those that need a password). Until a scan has found anything the page says Looking for networks..., or No networks found.
  5. Hidden network, the last row, with the second line Type its name.
Kode ecosystem stateSecond line
upConnected (accent, check glyph)
joiningConnecting...
waitingRetrying in <n> s, then Retrying now
refusedRefused: <why>, underscores to spaces, cut at 22 characters (GUI_CHAN_LINE_MAX)
no_identityNo identity
off, no_netNot connected

What TOP does on each row:

RowTOP released or a tapTOP held
The switchStarts or stops the serviceNothing
The connected network, the Kode ecosystem rowNothingNothing
A saved networkJoins it from the C5's vault, with an empty password and no keypadForgets it
An open scan resultJoins itNothing
A scan result with a password nobody savedOpens the keypad for the passwordNothing
Hidden networkOpens the keypad for the network's nameNothing

Rows follow WIFI_STATE_SIG, never the press. While the page is open and the service is on, it scans by itself. Until a scan has answered, and while the board is on no network, it scans on its first tick and again 60 s (GUI_WIFI_SCAN_MS) after each answer, never while one is out. While the board is on a network, a sweep takes the C5 off the channel in use, so the page scans only when it opens with an answer more than a minute old. There is no row to search again. The channel's own switch is config key="chan".

How a sweep ended decides when the page asks for the next one (kgui_wifi_scan_next()):

  • It reached its end, or a newer Wi-Fi request of somebody else cut it (a scan, a join, Wi-Fi switched): the next waits the page's 60 s. Whoever cut it has the radio, and a sweep asked at once would cut theirs in turn.
  • It was refused or failed, or the page's own join cut it: the page asks again after 10 s (GUI_WIFI_SCAN_RETRY_MS). So it does when AO_Radio's queue had no room for the question.
  • A newer wifi_scan started the listing again (WIFI_SCAN_AGAIN_SIG): the scan results are emptied, because they came from a sweep that did not reach its end. With no other network to show, the page says Looking for networks..., and it asks for no sweep of its own until that listing ends.

The keypad

The keypad types a password or a hidden network's name on twelve keys, the way a phone with no touch screen did. It opens in the place of the Wi-Fi page. The card shows, from the top down:

  • The title: the name of the network, or Hidden network until the name is in.
  • The field, a dark capsule. A password shows as dots except the last character, which stays plain while pending and for 1 s (KUI_MULTITAP_SHOW_MS). A name shows plain. An empty field asks for Password or Network name.
  • The yellow pill: Join for a password, Next for a name.
  • The Show password row with a switch, for a password only.
  • Twelve keys in four rows of three: 1 to 9, then the mode key, 0 and Delete. The mode key wears abc, ABC, 123 or #+=.

The card has no header disc. The pad moves the focus over the controls, TOP presses the control with the focus, and a tap presses the control it lands on. The focus opens on the key 5. The keys type by multitap, the rules of kui_multitap (sdk/kui): the same key pressed again within 800 ms replaces the pending character with the next one of the key. A password holds up to 63 characters and a name up to 32; at the cap a press that would add a character is refused with the hint Password is full or Name is full.

A hidden network has two stages, the name and then the password. Next with nothing typed shows Type the name; Join with nothing typed shows Type the password. While the radio scans, Join shows Scanning, try again. While the join is out, the field says Joining, the pill is dimmed and no control acts; BOT, home and the lock still leave.

The card reads WIFI_STATE_SIG as the answer:

What the radio publishesWhat the card does
GOT_IP for the network askedWipes the text, shows Joined and closes back to the Wi-Fi page
DISCONNECTEDShows Wrong password; the keypad comes back with its text
IDLEShows Could not join; the keypad comes back with its text
Nothing for 30 s (GUI_KBD_JOIN_GUARD_MS)Shows Could not join
Wi-Fi turned offWipes the text and closes back to the Wi-Fi page

DISCONNECTED covers both a wrong password and a network out of range, and Wrong password is the driver's best word for it.

The text is a secret. It lives in kgui_keyboard.c and nowhere else: in the multitap's buffer and in the 64 plain characters the field shows. It is not in the Gui struct, a log line, gui_info or any event but the join request, which carries its own copy. The module zeroes both buffers through a volatile pointer on every road away from the keypad. While the keypad is up, AO_Gui holds the log tags kaos.buttons, kaos.touch and kcli at NOTICE with kode_log_hold(), writes its own gesture lines without coordinates, and writes no haptic: line, so a log read in order would not spell the password. gui_info says keypad: <stage>, mode <word>, show on|off and nothing of the text, not even its length.

Bluetooth

The Bluetooth page is titled Bluetooth. Row 0 is the switch (Off, On, or Visible while advertising), and it stays at the top of the page as Wi-Fi's does. With the stack off it is the only row. The page lists no devices and runs no scan. With the stack on, these rows follow:

  • Visible as shows the name the board advertises, without KODE : the serial, or the name config key="ble_name" set (internals/settings). Nothing on the page changes it.
  • Console (Connected) appears while a central is subscribed to the console's output.
  • Paired shows N devices.
  • Pair new device appears when N is above 0. It opens the board to a new device for five minutes. Its second line says Visible to new devices while the time runs, and When the other leaves when a device is connected: nothing is on the air then, and the time starts when that device leaves. When AO_Radio's queue has no room for the request, nothing is asked and the hint says Busy. Try again.
  • Forget all (danger colour) appears when N is above 0. It calls ble_unpair_request(). AO_Radio refuses while a central is attached, and the row's second line says Disconnect first.

Console, Paired and Visible as are readings, and the other two are actions. The circle on the control centre pulses at 1 Hz while the radio advertises; the switch row does not.

Battery

Every row is a reading and nothing acts. Row 0 is a bar with the percentage. Then the flow (Charging, Charged or Discharging) with the current in milliamps, then the cell voltage, and, once the gauge reports a value from -20 to 80 degrees C, the temperature. Readings move in place; the page is rebuilt only when its shape changes. The temperature is asked of the gauge every 30 s.

About

The rows of the About page, with the ring starting on kodeOS. The zone is a row of the Time page.

RowShowsTOP or tap
kodeOSv<version> of the image that runsNothing
NameThe printed serial, Unknown when the identity is invalidNothing
RadioESP32-C5 · v1.2.3, or ESP32-C5 · off before the link has answered. Shown after Technical is openedNothing
microSD cardThe size in GB, No card, Mounted, or Asking...Nothing
TechnicalShow or HideShows or hides the Radio, MAC, Last start and Up for rows
MACThe board's MAC, Unknown on failure. Shown after Technical is openedNothing
Last startHow the board started. Shown after Technical is openedNothing
Up forTime since start, rewritten every 2 s. Shown after Technical is openedNothing
Software updateWhat it would act on (the table below)Installs the card's kodeos.bin or the release the update service names, then restarts. Asks the service again when the row says kodeOS is up to date or Could not check
Factory resetErase apps and settingsOpens the question of the factory reset (internals/gui/settings-screen)

Opening About asks the update service once for the newest kodeOS release, when the build has a service (CONFIG_KGUI_OS_UPDATE_URL). The boot asks the same question by itself and offers a newer release on the update card (The update card, below). A kodeos.bin on the card wins over the service. The second line of Software update says where the row stands:

Second lineWhen
kodeos.bin on the cardThe card carries kodeos.bin. The row installs it
kodeOS <version> availableThe service names a newer version than the one that runs and the board has charge. The row installs it
Charge to install kodeOS <version>A newer version waits: with no cable the charge must be 20 % or more (KGUI_OSREL_MIN_PCT)
kodeOS is up to dateThe service names nothing newer
Checking...The question is on its way
Join Wi-Fi to checkWi-Fi has no address
Could not checkThe service gave no usable answer, or the question never reached it
No image on the cardThe build has no service and the card has no image

Factory reset is the last row and Software update the one before it, on purpose: a press that rewrites the OS or erases the unit must not be one that can happen by accident. The row says why it has nothing to do instead of greying out. During the write the write screen reads Updating with the name kodeOS.

The update card

kodeOS asks the update service once per boot, the way back from an app included, when Wi-Fi gets its first address after the boot, whatever screen is up. It is About's question: the same service (CONFIG_KGUI_OS_UPDATE_URL), the same request and the same reading of the answer. When About's own question is out at that moment, its answer serves the boot too. A build with no service or no network, an answer that does not read, or a status but 200 or 404 offers nothing that boot.

A question that never reaches the service is asked again. AO_Net runs every network job on one worker, and the Kode channel joins on the same first address, so the boot's question is often refused as busy. The boot's question goes out at most 4 times (KGUI_OSREL_BOOT_ASKS), 5 s apart (KGUI_OSREL_BOOT_AGAIN_MS), while it never reaches the service. A wait that ends with no address spends no try, and the next address asks at once. A question that reached the service and got no usable answer is not asked again that boot.

When the service names a newer version, the card waits until the glass is free. That is the face awake, Apps or the settings screen, with no card up or leaving, no write, no install waiting for AO_AppMgr's word, no factory reset, no curtain, door or list in motion, no finger on the glass and no button down. It also waits while the greeting after Welcome is owed and until its notice line is through (internals/gui/face). It never rises at Rest, with the board asleep or the glass parked, during a guided test or the E5 test, or during the way back from an app.

The card is a system card on the system frame, with no edge. The word kodeOS stands as its protagonist, then New release available and Version <x.y.z>, and one pill, Update:

UpdateWhenA tap or TOP
Level yellowWi-Fi has an address, and the charge is 20 % or more or a cable is inInstalls the release the card names, as About's Software update does: the write screen, the image in the other kodeOS slot, the restart that confirms it. It never installs a card's kodeos.bin
Grey, with Join Wi-Fi to update.Wi-Fi has no addressA refusal's buzz, a log line, and the card stays
Grey, with Charge to 20 % or / plug in a cable.Wi-Fi has an address, and the charge is under 20 % (KGUI_OSREL_MIN_PCT) with no cableThe same

The card is written again when the link or the charge changes the answer. BOT or HOME closes it, and the update is offered again at the next boot while the service names a newer release. Nothing of "not now" is stored.

Rest and the auto-lock take the card down. The card rises with nobody asking, often with nobody there, so it does not hold their counts, and neither does the fault notice. Both start again when it rises, so it stands for their whole time, and a finger or a button held on it holds them as anywhere. When a count runs out its door takes the card down with the glass: Rest over the face, the face over Apps or the settings screen. With the time set to never, or usb_awake on with a cable in, the card stays until it is answered. The critical battery card takes its place in place, and so does any other system card. The offer is then gone for this boot.

The log lines, all under kgui's tag:

LineWhen
update: asking the service (boot)Every time the boot's question goes out
update: the question did not reach the service; asked again in 5 s (<n> of 4)A question that never reached the service
update: the question did not reach the service in <n> tries; no card this bootThe tries are spent
update: kodeOS <v> is available; this is <w>The service names a newer version
update: the card rises for kodeOS <v>The card rises, once per boot
update: no Wi-Fi address; Update waits, update: <n> % and no cable, under 20 %; Update waitsA press on the grey Update
update: Update on the card; updating kodeOS to <v> from the update serviceA press on the yellow Update
update: the card closed; offered again at the next bootBOT, HOME, or a door that takes the glass
update: the card gave its place to <kind>; offered again at the next bootAnother system card took its place, such as battery

gui_info logs update: offer <word>, asked <n> of 4. The word is unasked before an address, asked while the question is out, again while a try waits, due while the card waits for the glass, shown once it has risen, and none when nothing is offered this boot. The answer's reading and the offer's steps are in kgui_osrel.c, which the host tests cover.

Time

The Time page is titled Time and has six rows, each changed where it stands, with no list and no keypad: Time zone (the city, or Custom for a zone the table lacks), Hour and Minute (two figures each, 24 h whatever the face shows), Day, Month (its English name) and Year. Settings' Time row and the face's yellow pill open the same page.

  • TOP released, a tap or the pad's right is one more; the pad's left is one less. Up and down move the ring.
  • The hour, the minute, the day and the month go round; the year stops at 2026 and at 2105. A day the new month lacks becomes the month's last.
  • A step clicks once it has changed the clock. A step that changes nothing, such as a year at either end, thuds.
  • The rows follow the clock in place while the page is open: the minute rolling over, a time set, a time server's answer or a new zone rewrites them, and the ring stays where it is.
  • While the clock was never told the time, the rows show the day the running image was built, at noon, and the first step starts from there.

Every step of Hour, Minute, Day, Month or Year sets the clock (gui_time_set()). When nobody has chosen a zone yet, that first set also stores the zone the page shows, so the face asks nothing more, and the log says time: set by hand in <city>, which is now chosen.

A step of Time zone asks AO_Boot for the next zone of the table, west to east and round, with the same config key="zone" set a console line makes. AO_Boot applies and stores it in kset/zone, and its answer repaints the face and the row. What the clock reads across the change depends on who set it:

  • The page set it this boot, and nobody has written it since: the clock keeps its local reading in the new zone, and the log says time: <hh:mm> set by hand, kept in <city>. That is a set of the clock too, so AO_Scheduler hears it.
  • The console, the Kode channel, a time server or an earlier boot set it: the clock keeps its UTC, and the hour it reads moves with the zone.

The list of auto-lock times, which no row of the Settings list opens in this build, has six rows, 30 s, 1 min, 2 min, 5 min, 10 min, Never, and a pick stores kgui/lock and goes back to the page that opened it. Up and down move the ring with wrap, TOP or a tap picks, and left and right do nothing. BOT, a swipe right or a drag down on the header go back with nothing changed, and BOT held takes the whole card away to Apps' root. The list opens with the current choice under the finger that opened it, so a second tap picks the same choice again.

The 21 zones the Time zone row steps through and the POSIX TZ string each one stores:

RowPOSIX TZ
HonoluluHST10
Los AngelesPST8PDT,M3.2.0,M11.1.0
DenverMST7MDT,M3.2.0,M11.1.0
ChicagoCST6CDT,M3.2.0,M11.1.0
Mexico CityCST6
New YorkEST5EDT,M3.2.0,M11.1.0
Bogota, Lima<-05>5
Sao Paulo<-03>3
UTCUTC0, the zone of a board with nothing stored
London, LisbonGMT0BST,M3.5.0/1,M10.5.0
Madrid, ParisCET-1CEST,M3.5.0,M10.5.0/3
AthensEET-2EEST,M3.5.0/3,M10.5.0/4
JohannesburgSAST-2
Istanbul, Moscow<+03>-3
Dubai<+04>-4
MumbaiIST-5:30
Bangkok<+07>-7
Beijing, Perth<+08>-8
Tokyo, SeoulJST-9
SydneyAEST-10AEDT,M10.1.0,M4.1.0/3
AucklandNZST-12NZDT,M9.5.0,M4.1.0/3

The Kody card

The Kody page says which pack plays and where it comes from. It has one capsule.

StateLinesButton
IdleThe pack that playsUpdate
An update runsUpdating and 3 of 14 filesNone
An update failedThe update failed: and the reason, such as offlineRetry

Small print says why the button is missing, or what it does:

  • Connect Wi-Fi to update.
  • Wait for the write to end.
  • The card's pack is in use. Updates go to the Dot.
  • Replaces the pack on the Dot. Your own scenes go on the card.

Update fetches the pack named by CONFIG_KGUI_ASSETS_URL into the internal FAT and never writes the card. The install is on internals/gui/kody-pack.

The details and Remove

The details of an app and the two cards of Remove are described with the rail they open from, on internals/gui/launcher. In the sheet they are the kinds DETAILS, REMOVE and REMOVING. kgui_details.c builds the page once on the card and takes the kit's handle and header disc off the screen; kgui_dtext.c writes the size, the build date and the line under the name. The whole card is its header, so a drag down from anywhere on it closes it.

Launching an installed app

The launch of an installed app is a short scene on the layer above everything. The icon leaves its row and flies to the middle of the glass while the screen darkens under it. A Ring turns round the icon. Then the Ring closes in green and the icon pops, the screen fades to black, and the board resets into the app. The scene shows no words: the icon and the Ring are all there is.

StageFromWhat is on the screen
flight0 msThe icon of the row, 80 px, flies to the middle (205, 231), growing to 176 px (KGUI_LAUNCH_ICON_PX), in 220 ms on an ease-out. The screen darkens in 4 steps
ring220 msThe Ring turns round the icon, 226 px across with a line of 10 px, in Focus Blue over a charcoal track, for 528 ms (KGUI_LAUNCH_SPIN_MS)
close748 msThe Ring turns the success green and closes while the icon pops (scale 1.06 and back, 198 ms), then stands whole for 495 ms (KGUI_LAUNCH_HOLD_MS)
fade1,441 msA black layer over the whole scene, 3 steps 50 ms apart
done1,591 msThe screen is black. The scene reports once and the run is asked for

The scene covers the glass and takes every touch. While it runs, Apps under it is locked: no pad, no touch, no Settings, no home and no lock. It starts only from an icon that is on the screen: the row the launcher launched, or the disc of the Stopped card. A launch with no icon to start from takes the write screen at 100 % and asks for the run at once.

gui_launch_tick() steps the scene before the pass that draws. When the fade is over, it logs launching <name> (the fade is over), arms a 3 s wait (GUI_OPEN_RUN_MS) and calls appmgr_run_request(). AO_Boot then writes the boot request. A run AO_AppMgr refuses turns the card into Didn't open after the 3 s.

The write screen and Didn't open

A flash write shows two kinds of card on the system frame: the write screen (opening, the Opening card of the pages about AO_AppMgr and AO_Storage) and Didn't open (failure). A flash write never uses the loading screen.

The write screen shows how far a write has gone. The edge fills round the glass, and the share stands in the middle in kui_font_hero_160 with its % under it. A small protagonist stands above: the app's disc, or a glyph for the system. Under the figure stand the name and a second line. It is busy: it answers no pad button and no touch, and BOT does nothing.

WriteSecond lineFailure title and sentence
An install that runs (KWRITE_APP_RUN)Installing, then OpeningDidn't open: "The file is missing or damaged. Copy it to the card from apps.kode.diy."
An install that stays (KWRITE_APP)InstallingDidn't install, the same three lines
A kodeOS update (KWRITE_OS)Restarts when doneDidn't update: "Nothing changed. kodeOS keeps running the version it had."
A radio update (KWRITE_C5)Keep the Dot onDidn't update: "Nothing changed. The radio keeps the firmware it had."

An install the launcher did not start. An install from the console or the Kode channel belongs to no row of Apps. Its card wears the app's face from the app's data folder: the name, the icon and the colour. The writer's first reports name only the file, which for a download is the last part of its URL, then the project, and the folder answers after them. So the card stays off the glass until its face carries the folder's words (gui_write_card_show()). While no report names the app it waits however long the download takes to open. Once one does, a row of Apps that has already heard from the folder lends its face at once, and otherwise the card waits at most 5 s for the folder (KGUI_WFACE_WAIT_MS). An app with no data folder rises then, with its project name and its letters. The store fetches the folder first (appdata_get) and sends the install right after. The fetch raises the card at 0 %, and when the fetch ends the card stays at 0 % and waits for the install, at most 15 s (KODE_APPMGR_HOLD_MS): the figure and the edge move only with the bytes the install writes. The install keeps that card and its face until its image names the app, and a report that names another app takes the face over. A fetch asked with install=off, and one whose install does not come in those 15 s, ends its card as a write that is done. A failure raises its card at once, except the fetch's: a fetch that made no folder installed nothing, so its card goes without a failure, and one still waiting off the glass never rises (gui_data_lost(), the log says write card: no data folder came for '<project>'; the card goes without a failure). A write that ends before its card rose shows only its notice. The log says write card: up <n> ms after a report named '<project>', with its folder's words, or the wait for its folder ran out.

How a write ends. The figure follows APP_FLASH_PROGRESS_SIG. When a write that runs reaches its end, the edge closes in 297 ms and the figure climbs to 100 with it; the edge turns green and pops, the second line says Opening, and only then is the run asked for. A write that does not run closes the same way, the card leaves, and both lists of apps are asked again because the directory changed. When the write installed an app, the next notice reads <name> is ready. A write that names no app, such as the radio's image or an image parked in the mailbox, announces nothing. The write screen of a run carries the small print Hold BOT+LEFT to come back. A write of the OS publishes no done event and ends with the restart into the new kodeOS.

Kody's writing and goodbye animations are not played by any screen in this interface: the write screen shows the edge and a figure, and an app runs when the edge has closed.

Didn't open is the write screen filled again. The edge is cut: it turns resting grey and a red dot stands where it stopped. The title is Didn't open, Didn't install or Didn't update, with the name under it and three lines of why. The pill says Try again when the request can be repeated, and Close otherwise. Try again asks the question again, and for a file it asks which apps the write would evict first, because the failed write may have evicted apps already. A refused launch, an install that fails and a run that never took the board away turn the write screen into this card. The card does not leave by itself.

An install that AO_AppMgr turns away because the card stayed busy while an app it would push out was copied (KFAIL_BUSY, see Making room below) keeps the write's title and wears its own three lines: "Nothing changed. The SD card was busy. Try again in a moment." Nothing was written, and the pill says Try again.

Making room

An install of a file from the SD card asks no question. The apps region keeps its apps oldest first, and when the file does not fit, the oldest apps make room for it, as install does from the console. AO_AppMgr copies the installed apps to the SD card while it is idle (sdk/kaos/appmgr). When an app it would push out has no copy there yet and the card could take one, AO_AppMgr copies it first, the write screen stands at 0 % for the seconds that takes, and the write goes on by itself. Only a card that stays busy for 30 s of that wait turns the card into Didn't install or Didn't open with the lines "The SD card was busy. Try again in a moment."

When an app's copy does not fit the card, the hint says SD card is full, once for each card mounted. If the glass is parked, at Rest or on another screen then, the hint waits and shows on the way into the face awake, Apps or Settings.

The install begins with a question to AO_AppMgr, in two stages that gui_info shows as launch: asking and writing. AO_Gui calls appmgr_evict_query() with the size and project name; AO_AppMgr answers one entry for each app that would go and an end marker.

  • busy: AO_AppMgr could not look. AO_Gui asks again after 150 ms, up to 4 times, then says Busy. Try again.
  • The image is bigger than the region: nothing is written and the hint says Too big for this Dot.
  • It fits, with or without apps to push out: the write screen rises and the write starts. The log says install: <n> app(s) make room for <app> when some go.
  • A locked card is up while apps would go: the install is given up with Busy. Try again.
  • No answer within 1,500 ms: the hint says No answer. Try again, and a late answer is ignored.

There is never more than one question out. An end still missing 35 s after its question is taken as lost, so one dry event pool cannot block the installs for good.

Stopped

When a board comes back from an app that panicked, hit a watchdog or lost its supply, the Stopped card rises over Apps. The system frame shows the face of the app that ran, its name, and Stopped. The body gives one line of why:

How the app endedThe line
PanicIt crashed
WatchdogIt stopped responding
BrownoutThe battery dipped

The small print under it is Hold BOT+LEFT and to come back. The button is Run again, the yellow pill, and it is there only when the app is in the list. When no installed app sits where the app ran, the card says An app and has no button. A clean end shows no card, and an end that cannot be told reads as clean, so a healthy app is never accused.

Run again plays a click and launches the app as Apps launches any app. A run that is refused turns the card into Didn't open. BOT closes the card, and Apps stands as it was.

The fault notice

When KodeOS restarts after a fault of its own, a panic or a watchdog while no app was running, the fault notice rises on the first free glass. AO_Boot works out how KodeOS ended before the boot (boot_os_end(), sdk/kaos/boot). A fault that follows an app is the app's, and raises Stopped instead. The notice waits for the same free glass as the update card (above): the face awake, Apps or the settings screen, with no card up, nothing in motion and no hand on the board.

The card is a system card on the system frame, and the notice draws no edge. It says kodeOS restarted and one line of why, the Stopped card's own words: It crashed after a panic, It stopped responding after a watchdog. One pill, OK, answers it. Kody's fault animation (internals/gui/kody-pack) plays once in a band of 410 x 160 px that stands on the glass's lower edge, and stops 1.2 s after it began (KGUI_FAULT_HOLD_MS), on the frame with the X. The card draws the pack's file on a canvas 13/10 of the band's, 533 x 208 px, set on the band's lower right corner: Kody and the X stand 30% larger than the pack draws them, and the band cuts off the empty rest of the canvas. The words and the pill stand above the band. The card waits up to 5 s (KGUI_FAULT_KODY_WAIT_MS) for the pack's file to be read. When the pack has no fault file, the file cannot be read, or the built-in pack plays, a red X stands as the protagonist and the words and the pill take their usual places.

The notice is owed until someone answers it. The boot that follows the fault stores a record in the kgui namespace, key fault: one byte with the class in bits 0 and 1 (1 a panic, 2 a watchdog) and bit 7 set when the fault left a core dump. A notice nobody answered rises again at the next boot. OK, Send, BOT and HOME answer it and erase the key, and a later fault stores its own record in place of the one kept.

Rest and the auto-lock take it down. The notice rises with nobody asking, so, like the update card, it holds neither count, and their door takes it down with the glass. The notice stays owed and becomes due again at the next button press or touch. While a report is being sent the card holds both counts, as any card does. The critical battery card takes the notice's place when no report is being sent, and the notice rises again on the next free glass.

The report. A build with CONFIG_KGUI_FAULT_REPORT (on by default, and it needs CONFIG_KODEOS_DUMP_HTTP) can send the fault's core dump to Kode over the Kode channel (internals/kode-channel). The notice offers it when all of these hold:

  • The fault left a core dump, and the coredump partition holds a dump whose ELF SHA-256 is that of a KodeOS image in flash.
  • Wi-Fi is on.
  • The Kode channel is up and its session names a dumps link.

While the channel is on its way (no network yet, joining, or waiting to try again), the notice waits for it, at most 30 s from the moment it was due (KGUI_FAULT_NET_WAIT_MS), and then rises with OK alone. A radio not heard from yet this boot counts as on its way. Without the option, with no such dump, with Wi-Fi off, with a channel that cannot come up (off, refused or with no identity) or with no dumps link, the notice rises at once with OK alone.

The notice that offers the report adds the line A report is a copy of kodeOS's memory. and answers with a pair: OK on the left, with the focus, and Send on the right. Send answers the notice first, so it never rises again whatever the send's end, then asks AO_Net for the upload (net_dump_request()). The card then takes one of three faces:

FaceWhat it showsAnswer
Sending report...The edge spinsNone. BOT and HOME close the card, and the send's end goes to the log
Report sentThe edge closes in greenAny press closes it, and it leaves by itself after 1.5 s (KGUI_FAULT_SENT_MS)
Couldn't send the reportOne line of why, and the edge cutClose and Retry
WhyWhen
The service refused itThe service answered with a status other than 201
No answerTLS, the socket or a timeout failed, or no answer came within 75 s (KGUI_FAULT_SEND_GUARD_MS)
Busy. Try againAO_Net was busy with another job or upload, had no memory for the dump, or had no room for the request
No connectionThe channel is down, or its session names no dumps link
Nothing to sendNo dump of a KodeOS image is in flash

Each change of face shuts the card's input for 300 ms, as a rise does, and a press already down acts on nothing. A failure buzzes a thud.

Only a press at the board sends. The console's btn, tap, touch and swipe are marked remote when their line came from the Kode channel or a cron entry (internals/command-set). On this card a remote press of Send or Retry does nothing but write fault: a remote press does not send a report (<pill>) to the log, with no buzz and no words on the glass. A remote press of the pad moves no focus and shows no ring, so a remote line cannot put the focus on Send for the next press of TOP. OK and Close answer any press. The same verbs over the cable, the charging base or Bluetooth are not remote.

The log lines, all under kgui's tag:

LineWhen
fault: <crashed|hung> owed, dump <yes|no>At AO_Gui's start, when a notice is owed
fault: the notice is on the glass (<class>), <look>, <OK alone|with Send>The card rises. The look is Kody plays or the X in his place
fault: <what> answered the noticeOK, Send, the bottom button or home answered it
fault: Rest took the notice down; it rises again at the next button or touchRest or the auto-lock took it down
fault: the report was sent, fault: the report was not sent: <why> (http <n>)AO_Net answered the send
fault: a remote press does not send a report (<pill>), fault: a remote press moves no focusA remote line pressed Send, Retry or the pad

gui_info logs fault: owed=<crashed|hung|none> dump=<yes|no> due=<yes|no> face=<notice|sending|sent|failed|->. The notice's decisions are in kgui_fault.c, which the host tests cover.

Critical battery

When the charge falls to 10 % or less (KGUI_BAT_CRIT_PCT) and the cell is not charging, the Critical battery card rises. The system frame shows a red battery with a sliver of charge, the name Battery and the second line Critical, <n> %. The detail says Plug in the cable.. The card follows the charge while it is up, and it closes when the cable goes in, because it asks for the cable. It has no button; BOT closes it.

The card rises over any screen, the face at Rest included, where its arrival lights the screen. It rises once for each entry into critical, and never with a cable in. A charge that wobbles around the line is not a new entry: the card can rise again after the charge climbs 3 points (KGUI_BAT_CRIT_REARM_PCT) above the line, or after the cable goes in. A board that has not read a charge above 0 % yet raises nothing, because a gauge that reads no cell says 0 % on every reading. It does not rise over a locked card, another system card or a guided test, except the update card and the fault notice while no report is being sent: it takes that card's place in place. The update is not offered again until the next boot, and the fault notice stays due and rises again on the next free glass.

Turn off

The Turn off card asks to confirm that the board switches off. The board never does this by itself. Two things raise it: BOT held on the face for 5 s after the red arc has filled, and the Turn off circle of the settings screen. The system frame shows a red power glyph, the title Turn off? and two lines: Hold the red button and to turn it on again.. The card has one red Turn off pill.

When a cable is in, the board does not switch off: AO_LowPower refuses the request. So the two lines give way to Not while USB is in and the pill is grey. The pill is still there, because AO_LowPower is the one that refuses, and it says why over the screen as a hint.

For 300 ms after it began to rise the card answers nothing. Then:

  • TOP released, or a tap on the pill, confirms. The card asks and the button confirms: there is no hold.
  • BOT released answers no, and closes the card with nothing done.
  • A swipe down answers no too, at the lift, and the swipe must be at least 40 px.

gui_off_ask() raises the card and logs turn off? asked (<why>). A confirmation logs turn off: confirmed and calls gui_power_off() once. That function logs power off requested before it calls kode_power_off(), and AO_LowPower asks every owner to rest and turns the board off (internals/power-and-sleep).

Pairing

When a central connects to the BLE console the board picks a six-digit passkey and the pairing card rises with it, broken after three digits (482 913), in kui_font_code_80. Two lines read "Type this code" and "on the other device". The system frame shows the Bluetooth glyph as its protagonist, with the title Pairing and the second line Another device. The card has no button.

The digits go nowhere else: no log line carries them, because AO_Log copies every line to the BLE console and a paired peer would read the next one's code.

What happenedThe card says
The devices bondedPaired
The peer left in the middleThe other device disconnected
Encryption failed, or the security manager's 30 s ran outPairing failed
You pressed BOTNothing; the card closes and the pairing is refused

The outcome replaces the digits for 1.2 s, then the tick posts the close. Leaving the card in any other way while the code is live refuses the pairing in the shell's exit, so the peer fails at once. A busy sheet, Gui_btn_test, Gui_tp_test and Gui_selftest refuse a pairing outright, and a write that takes the card over refuses it through gui_pair_yield(). The pairing policy is on internals/ble-console.

Self-test

The Settings list's Self-test row opens it, and a run ends on it. The first row, Run the test (level yellow), starts the whole-unit check. Under it come the rows of the last run in plain words (Charger, Touch, Card slot):

  • OK on green with a check.
  • Problem on danger with the row's own line such as Light not working.
  • No answer and Skipped with no icon.

Failed rows come first, then the rest in the order they ran. The value of Run the test is the verdict on the last run, followed by the time of the run in the face's time zone, such as All good - 13 Oct 09:41.

VerdictWhen
Never runNo run is kept
All goodEvery row of the run passed
1 problem, <n> problemsA row failed. Rows nobody judged are not counted then
<n> not checkedNothing failed, and some rows have no answer or were skipped. A run left alone leaves the rows that wait for a person, such as buttons, LED, display and touch, with no answer

The Settings list's Self-test row reads the same count (internals/gui/settings-screen), so the two never disagree about a run. The small print under the rows reads Takes a few minutes before any run and Tap a row to test it again after a run with no failure. After a failure it is three lines, Tap a row to test it again., Still failing? and Contact Kode support. TOP or a tap on a row of the last run repeats that one row. The words and the count are in kgui_selftest.c, which the host tests cover.

When a run starts the screen stops being a sheet and AO_Gui enters Gui_selftest, which shows the loading screen with Kody in his wheel. The line under him reads:

MomentThe line reads
StartStarting
A row<n> of <N> and the row's label; for the card rows, Hold a card to the back
Waiting for handsNow we need you and TOP to continue; TOP calls autotest_continue()
Charger rowPlug in the charger, Checking the charger, Keep it plugged in, Now unplug the charger
BOT before the holdStopping after this check; the row in flight ends first
Another client's runThe page says Another test is running

AO_Autotest owns the rows and the report (sdk/kaos/autotest). The auto-lock does not count during a run, and a stopped run keeps no report. After a run, the board opens Settings and then the Self-test page.

Gotchas

Example code

Pair a computer over Bluetooth and watch the card:

  1. Open a console session over the USB-C cable first. Opening the port resets the board, and attaching the cable after the card is up would end the pairing.
  2. Clear the bond on both sides, on the board with Forget all on the Bluetooth page and on the computer in its Bluetooth settings.
  3. Attach over Bluetooth from the computer. The pairing card rises with a code such as 482 913. For 300 ms it answers no button.
  4. Type the code on the computer. The card reads Paired for 1.2 s and closes.
  5. Repeat and press BOT while the code shows. The card closes and the computer reports a failed pairing at once.

In the SDK

  • kui_sheet.c: the kit's sheet, built once by kui_sheet_create().
  • kgui_ao.c: the three shells, gui_sheet_body(), gui_syscard_of() and every page's fill function.
  • kgui_sysscreen.c and kgui_ring.c: the system frame, the edge and the Ring.
  • kgui_assets.c: the update behind the Kody card.
  • kgui_fault.c: when the fault notice is owed, when it rises and what a press on it does.