nx_iot_control_page.nx
buildroot/runtime/nx_iot_control_page.nx
about
nx_iot_control_page.nx -- emit a ZERO-JS, CROSS-BROWSER IoT CONTROL page.
Operator 2026-06-22: "work via nishi browser and 3rd party like chrome/firefox/edge
and simple for other people to use aka reproducible." The cross-browser + reproducible
answer is SERVER-RENDERED HTML + CSS with ZERO <script>: controls are real <form> POSTs
to the hub's /home/cmd, so they actuate in EVERY browser with nothing to install (the
same no-JS doctrine the reader arc proved). Capability-driven (nx_iot_capability): a
switch gets On/Off, a colour bulb gets brightness/colour/warmth/scene -- chosen per
device, never hardcoded. Library organ: cp_head/cp_card/cp_foot/cp_find + a demo main()
(the gate calls the functions; on import the demo main is stripped).
NEVER-BRICK #26: the page only emits on/off/brightness/scene COMMANDS (no firmware).
license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_iot_capability.nx
imported by: nx_iot_control_page_gate.nxnx_iot_dashboard.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 18 | const CP_OUT: *u8 = "web_assets/iot_control.html" |
| 19 | const CP_CAP: i64 = 262144 |
functions
| 21 | func cp_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 27 | func cp_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 40 | func cp_find(buf: *u8, len: i64, pat: *u8, pat_len: i64) -> i64 called by 1: main |
| 60 | func cp_cmd_open(h: *u8, off: i64, id: *u8) -> i64 |
| 69 | func cp_widgets(h: *u8, off: i64, id: *u8, caps: i64, is_on: i64) -> i64 |
| 101 | func cp_card(h: *u8, off: i64, id: *u8, name: *u8, room: *u8, vlabel: *u8, dev_class: i64, is_on: i64) -> i64 |
| 116 | func cp_head(h: *u8, off: i64) -> i64 |
| 137 | func cp_foot(h: *u8, off: i64) -> i64 |
| 145 | func main() -> i64 |