code wiki / (root) / nx_iot_sc_broadcast.nx

nx_iot_sc_broadcast.nx

buildroot/runtime/nx_iot_sc_broadcast.nx

3946 B90 linesdepth 2pulls 3 transitivereach 5 importersview sourcekind librarytopic iot
docsdependenciesstructsconstsfunctions

about

nx_iot_sc_broadcast.nx -- SOVEREIGN ESP-Touch v1 BROADCASTER (R1b-live). Sends the U8 length sequence from nx_iot_smartconfig as real UDP packets so a Tuya/ESP device in pairing mode sniffs the Wi-Fi creds off the 2.4GHz air. NO app, NO Windows tooling on the program path. Mechanism (verified from sovereignly-fetched Espressif source, knowledge/fetched/sc_java_*.raw): - each U8 length L -> one UDP packet whose PAYLOAD is L bytes of '1' (ByteUtil.genSpecBytes: `byte[] data=new byte[len]; for(i) data[i]='1';` -- only the LENGTH carries data) - device sniffs in promiscuous mode (sc_idf_device.raw) so the dest addr only has to put the frame on the air: multicast 234.x:7001 or broadcast 255.255.255.255 both work - send the 4 guide lengths repeatedly until the device locks, then loop the datum block Sockets via nx_syscalls.nx (the @ifdef TARGET_X86_64 path: SYS_SOCKET=41/SYS_SENDTO=44 -- the WORKING path; nx_syscalls_x86_64.nx's socket() dies with ENOSYS in WSL). Runs on any x86_64 Linux host that can transmit on the 2.4GHz (NishiOS box on the IoT SSID, or a Wi-Fi-client rung). The ARM router has no Nishi backend yet -> that deployment seam is documented, not faked. NEVER-BRICK #26: emits reversible Wi-Fi creds only; no firmware write. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_iot_smartconfig.nx nx_iot_sc_broadcast.nx nx_iot_sc_broadcast_gate.nx nx_quic_udp.nx

imports: nx_syscalls.nxnx_iot_smartconfig.nx

imported by: nx_iot_sc_broadcast_gate.nxnx_quic_udp.nx

structs

none

consts

19const SO_MAGIC_1024: i64 = 1024
21const SO_BROADCAST: i64 = 6

functions

24func nx_sc_genspec(buf: *u8, len: i64) -> i64
called by 2: nx_sc_send_onemain
31func nx_sc_sockaddr(sa: *u8, a: i64, b: i64, c: i64, d: i64, port: i64) -> i64
46func nx_sc_open() -> i64
56func nx_sc_send_one(fd: i64, sa: *u8, scratch: *u8, len: i64) -> i64
63func nx_sc_broadcast(ssid: *u8, ssid_n: i64, bssid: *u8, pwd: *u8, pwd_n: i64, ip: *u8,