code wiki / (root) / nx_tuya_emit_a64.nx

nx_tuya_emit_a64.nx

buildroot/runtime/nx_tuya_emit_a64.nx

4963 B116 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic tuya
docsdependenciesstructsconstsfunctions

about

nx_tuya_emit_a64.nx -- SOVEREIGN emitter: NishiLang -> aarch64 .s for the TUYA smartconfig broadcaster that runs ON the GL.iNet router (the 2.4GHz AP). Same send-loop shortcut as the ESP-Touch one, but uses the GATED nx_tuya_bcast encoding (broadcast_head [1,3,6,10] + body) and Tuya's port 30011. Sends UDP packets of each length to 192.168.10.255:30011 (subnet-directed bcast out the IoT bridge -> 2.4GHz air), 5ms gap, outer-looped. tuya-convert proves AP-broadcast reaches an unassociated sniffing device, so the router-AP IS a valid sender for Tuya (our earlier ESP-Touch failure was protocol, not RF). aarch64 syscalls: socket=198 setsockopt=208 sendto=206 nanosleep=101. NEVER-BRICK #26: reversible Wi-Fi creds only. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_tuya_smartconfig.nx nx_tuya_emit_a64.nx

imports: nx_tuya_smartconfig.nx

imported by: nobody (leaf or entry point)

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

main nx_tuya_bcast nx_tuya_crc8 nx_tuya_crc8_byte nx_tuya_crc8_byte ↻ e_line e_w e_nl e_w ↻ e_n e_nl ↻

structs

none

consts

10const K_MAGIC_30011: i64 = 30011

functions

12func e_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: e_linemain
13func e_nl() -> i64 { let b: *u8 = sys_mmap(1); b[0] = 10 as u8; sys_write(1, b, 1); return 0 }
called by 2: e_linemain
14func e_n(v: i64) -> i64
called by 1: main
22func e_line(s: *u8) -> i64 { e_w(s); e_nl(); return 0 }
called by 1: main calls 2: e_we_nl
24func main() -> i64