nx_moonraker_io.nx
buildroot/runtime/nx_moonraker_io.nx
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
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
| 37 | const NX_MR_IO_OK: i64 = 0 |
| 38 | const NX_MR_IO_ERR_BUILD_FAILED: i64 = 1 |
| 39 | const NX_MR_IO_ERR_CONNECT_FAILED: i64 = 2 |
| 40 | const NX_MR_IO_ERR_WRITE_FAILED: i64 = 3 |
| 41 | const NX_MR_IO_ERR_READ_FAILED: i64 = 4 |
functions
| 43 | func nx_mr_io_verdict_name(v: i64) -> *u8 |
| 66 | func nx_mr_pack_ipv4(a: i64, b: i64, c: i64, d: i64) -> i64 called by 1: main |
| 70 | func nx_mr_tcp_connect_ipv4(ipv4: i64, port: i64) -> i64 |
| 97 | func nx_mr_post_loopback(port: i64, |
| 134 | func nx_mr_post_ipv4(ipv4: i64, port: i64, |
| 160 | func nx_mr_get_ipv4(ipv4: i64, port: i64, |
| 186 | func nx_mr_get_loopback(port: i64, |