code wiki / (root) / nx_iot_discover_test.nx

nx_iot_discover_test.nx

buildroot/runtime/nx_iot_discover_test.nx

8485 B180 linesdepth 3pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic iot
docsdependenciesstructsconstsfunctions

about

nx_iot_discover_test.nx -- gate for the universal discovery brain. Proves the operator's "discovery mechanism like all the hardware discovery" across ALL five vendor families from canned beacons, with NO sockets (deterministic), and proves the duplicate-on-repair killer + the measured phantom-device count. Grounded in the live fleet: device A is the operator's REAL TP-Link Kasa HS210 (SSID TP-LINK_HS210_C209, BSSID d8:0d:17:a1:c2:09), and its :9999 reply is built by ENCRYPTING a sysinfo plaintext with the same autokey XOR a real bulb uses -- so the decode path is exercised end to end. Coverage: - discovery-verdict sealed-enum validity gate - Kasa (:9999, XOR) -> decrypt + classify KASA + NEW - WiZ (:38899, cleartext) -> classify WIZ + NEW - MagicHome (service :5577) -> classify MAGICHOME by port + NEW - Tuya (:6667, devId) -> classify TUYA + NEW - NEG control: garbage + off-table port + no MAC -> UNKNOWN, but STILL anchored (UNKNOWN is first-class; no silent drop) - LIAR-KILL: the Kasa XOR decode must round-trip byte-exact + read as sysinfo (break the codec -> RED) - DEDUP: re-discover A (roamed IP) -> SAME logical id, NO new row - MEASURED EXCEED: duplicates_prevented == naive_adopts - count == 1 - NEG control: bad arg (hwid_n=0) -> DISC_BAD_ARG, no state change expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls_x86_64.nx nx_iot_discover.nx nx_iot_discover_test.nx

imports: nx_syscalls_x86_64.nxnx_iot_discover.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_iot_disc_verdict_is_val nx_iot_anchor_init nx_iot_kasa_puts_z nx_iot_kasa_encrypt nx_iot_disc_ingest nx_iot_disc_to_plain nx_iot_kasa_decrypt nx_iot_disc_classify nx_iot_classify_by_reply nx_iot_cls_find nx_iot_cls_strlen nx_iot_classify_by_oui nx_iot_classify_by_port nx_iot_classify_fuse nx_iot_anchor_adopt nx_iot_vendor_is_valid nx_iot_anchor_find nx_iot_anchor_hwid_eq nx_iot_anchor_hwid_base nx_iot_anchor_meta_ptr nx_iot_anchor_store_hwid nx_iot_anchor_hwid_base ↻ nx_iot_anchor_count nx_iot_kasa_decrypt ↻ dt_buf_eq nx_iot_kasa_looks_like_sys nx_iot_kasa_find nx_iot_kasa_strlen nx_iot_anchor_logical_ip nx_iot_anchor_slot_by_logi nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_meta_ptr ↻ nx_iot_anchor_naive_adopts nx_iot_disc_duplicates_pre nx_iot_anchor_duplicates_p

structs

none

consts

none

functions

35func dt_buf_eq(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
54func main() -> i64