CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
host_api_ui.cpp File Reference

Real implementations for the UI subset that plugins use most. More...

Go to the source code of this file.

Functions

int host_ui_push_toast (const char *text, uint8_t icon, uint16_t duration_ms)
 Show a transient toast overlay.
int host_ui_push_message (const char *text, uint8_t icon, uint32_t duration_ms)
 Show a blocking message view that auto-dismisses after duration_ms.
int host_ui_push_info (const char *title, const char *body)
 Show a scrollable info screen with title and body.
int host_ui_view_image (const uint8_t *data, uint32_t len)
 Decode and show an image (PNG/JPEG) from an in-memory buffer, dithered. No capability required; the buffer is bounds-checked.
int host_ui_view_markdown (const uint8_t *data, uint32_t len)
 Render and show Markdown from an in-memory (UTF-8) buffer. No capability required; the buffer is bounds-checked.
int host_browser_open (const char *url)
 Open a URL in the badge browser (enters the browser and loads it). No capability required.
int host_ui_pop (void)
 Pop the topmost view.
int host_ui_pop_to_plugin (void)
 Pop back to the plugin's first view.
int host_ui_repaint (void)
 Force a repaint of the current view.
int host_ui_wink (uint8_t count, uint16_t period_ms)
 Blink the backlight as a visual identification signal.

Detailed Description

Real implementations for the UI subset that plugins use most.

Pushes pre-built cdc_views onto the ViewStack. The remaining UI host API (T9, PIN, slider, date/time, list with action callbacks) lands in later Phase-3 steps once the Plugin object can route action-id callbacks back into the WASM module.

Definition in file host_api_ui.cpp.