code wiki / (root) / nx_moonraker_ready_check.nx

nx_moonraker_ready_check.nx

buildroot/runtime/nx_moonraker_ready_check.nx

5303 B130 linesdepth 7pulls 10 transitivereach 1 importersview sourcekind librarytopic moonraker
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_moonraker_client.nx nx_moonraker_io.nx nx_moonraker_ready_check.nx nx_moonraker_ready_check_test.nx

imports: nx_syscalls.nxnx_moonraker_client.nxnx_moonraker_io.nx

imported by: nx_moonraker_ready_check_test.nx

structs

none

consts

32const NX_READY_OK: i64 = 0
33const NX_READY_NOT_READY: i64 = 1
34const NX_READY_BAD_RESPONSE: i64 = 2
35const NX_READY_NETWORK_ERR: i64 = 3

functions

37func nx_ready_verdict_name(v: i64) -> *u8
called by 1: main
50func nx_ready_contains(buf: *u8, len: i64, needle: *u8) -> i64
77func nx_ready_classify_body(body: *u8, body_len: i64) -> i64
98func nx_moonraker_ready_check_loopback(port: i64,
116func nx_moonraker_ready_check_ipv4(ipv4: i64, port: i64,