code wiki / (root) / nx_moonraker_io.nx

nx_moonraker_io.nx

buildroot/runtime/nx_moonraker_io.nx

8834 B211 linesdepth 6pulls 9 transitivereach 10 importersview sourcekind librarytopic moonraker
docsdependenciesstructsconstsfunctions

about

nx_moonraker_io.nx -- network roundtrip layer for nx_moonraker_client. v2 of the Moonraker client arc: composes the v1 request builders (URL / JSON / POST/GET byte assembly) with real socket I/O so we can actually talk to a Klipper printer over the LAN. Loopback-only for this primitive (composes tcp_connect_loopback from nx_tls13_io for testability via fork-based smoke). An operator-facing variant accepting arbitrary sockaddr_in is queued as v3 -- trivial extension once loopback is proven. Composition map: nx_moonraker_client -- request builders (v1) nx_tls13_io -- tcp_connect_loopback (loopback helper) nx_syscalls -- sys_write / sys_read / sys_close Per cardinal feedback-engineering-sciences-bits-up-3d-print-first: this primitive demonstrates that the substrate already has every piece needed to talk to networked engineering tools (printers, CNCs, robotics controllers) -- the operator-side workflow is just composition of shipped primitives. Per cardinal feedback-real-playtest-loop-not-just-logs: the smoke uses fork() with a real fake Moonraker server in the parent and our real client in the child. Bytes flow over a real loopback socket through the real Linux kernel TCP stack in qemu. license_tier: ORIGINAL

dependencies 4 imports · 7 importers

nx_syscalls.nx nx_connect.nx nx_tls13_io.nx nx_moonraker_client.nx nx_moonraker_io.nx nx_iot_ctl_lib.nx nx_moonraker_io_ipv4_test.nx nx_moonraker_io_test.nx nx_moonraker_ready_check.nx nx_moonraker_ready_check_test.nx nx_printer_ctl_gate.nx nx_printer_ctl_lib.nx

imports: nx_syscalls.nxnx_connect.nxnx_tls13_io.nxnx_moonraker_client.nx

imported by: nx_iot_ctl_lib.nxnx_moonraker_io_ipv4_test.nxnx_moonraker_io_test.nxnx_moonraker_ready_check.nxnx_moonraker_ready_check_test.nxnx_printer_ctl_gate.nxnx_printer_ctl_lib.nx

structs

none

consts

37const NX_MR_IO_OK: i64 = 0
38const NX_MR_IO_ERR_BUILD_FAILED: i64 = 1
39const NX_MR_IO_ERR_CONNECT_FAILED: i64 = 2
40const NX_MR_IO_ERR_WRITE_FAILED: i64 = 3
41const NX_MR_IO_ERR_READ_FAILED: i64 = 4

functions

43func nx_mr_io_verdict_name(v: i64) -> *u8
66func nx_mr_pack_ipv4(a: i64, b: i64, c: i64, d: i64) -> i64
called by 1: main
70func nx_mr_tcp_connect_ipv4(ipv4: i64, port: i64) -> i64
97func nx_mr_post_loopback(port: i64,
134func nx_mr_post_ipv4(ipv4: i64, port: i64,
160func nx_mr_get_ipv4(ipv4: i64, port: i64,
186func nx_mr_get_loopback(port: i64,