nx_moonraker_ready_check.nx
buildroot/runtime/nx_moonraker_ready_check.nx
about
nx_moonraker_ready_check.nx -- pre-print Klipper state gate.
Per NISHI_3D_PRINT_BULLETPROOF_PREFLIGHT_ROADMAP ยง1.4 (printer-
side ready check): refuse to send print-start unless Klipper is
in "ready" state. Catches the failure mode where operator sends
a print to a printer in shutdown/error/startup state and Klipper
silently ignores it.
Composes:
nx_moonraker_io -- GET /printer/info roundtrip
nx_moonraker_client -- HTTP status parse
substring check -- simple text scan for "state":"ready"
(full nx_json composition queued v2)
Klipper states (per Klipper API server docs):
"ready" -- accepting commands, ready to print
"startup" -- initializing, not yet ready
"shutdown" -- entered error / safe-shutdown state
"error" -- runtime error, operator intervention needed
Only "ready" returns SAFE. Everything else returns NOT_READY
with the actual state-string available for operator diagnosis.
license_tier: ORIGINAL
dependencies 3 imports · 1 importers
imports: nx_syscalls.nxnx_moonraker_client.nxnx_moonraker_io.nx
imported by: nx_moonraker_ready_check_test.nx
structs
| none |
consts
| 32 | const NX_READY_OK: i64 = 0 |
| 33 | const NX_READY_NOT_READY: i64 = 1 |
| 34 | const NX_READY_BAD_RESPONSE: i64 = 2 |
| 35 | const NX_READY_NETWORK_ERR: i64 = 3 |
functions
| 37 | func nx_ready_verdict_name(v: i64) -> *u8 called by 1: main |
| 50 | func nx_ready_contains(buf: *u8, len: i64, needle: *u8) -> i64 called by 1: nx_ready_classify_body |
| 77 | func nx_ready_classify_body(body: *u8, body_len: i64) -> i64 called by 3: nx_moonraker_ready_check_loopbacknx_moonraker_ready_check_ipv4main calls 1: nx_ready_contains |
| 98 | func nx_moonraker_ready_check_loopback(port: i64, |
| 116 | func nx_moonraker_ready_check_ipv4(ipv4: i64, port: i64, |