code wiki / (root) / nx_iot_local_wiz.nx

nx_iot_local_wiz.nx

buildroot/runtime/nx_iot_local_wiz.nx

19255 B448 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic iot
docsdependenciesstructsconstsfunctions

about

nx_iot_local_wiz.nx -- WiZ JSON-over-UDP LAN protocol. Roadmap: NISHI_IOT_HUB_ROADMAP.md Epoch 2 (SPEAK). S-class invariants: S0 (bit-equal payload encode), S6 (no cloud), S7 (sealed-enum verdicts), S8 (kind-isolated -- imports no sibling nx_iot_local_* primitive). Kind generator. Siblings: nx_iot_local_tuya_v33, nx_iot_local_magic_home. Wire format (vendor-published partial spec + community RE per pywizlight; TIER_0_VENDOR_PUBLISHED route in iot-hub-research.toml): Transport: UDP/38899 Crypto: none Format: JSON Set RGB+brightness: {"method":"setPilot","params":{"r":255,"g":0,"b":0,"dimming":80}} Set scene (1..32 are vendor-defined scenes): {"method":"setPilot","params":{"sceneId":4}} Power on/off: {"method":"setPilot","params":{"state":true}} Query state: {"method":"getPilot","params":{}} Discovery: {"method":"registration","params":{"register":false,"phoneIp":"...", "phoneMac":"..."}} Response (to getPilot or setPilot): {"method":"getPilot","env":"pro","result":{"mac":"a8bb...", "rssi":-56,"state":true,"sceneId":0,"r":255,"g":0,"b":0, "dimming":80,"temp":2700,"src":""}} What this primitive does today: - JSON payload builders for setPilot RGB / setPilot scene / setPilot state / getPilot / registration

dependencies 1 imports · 1 importers

nx_syscalls_x86_64.nx nx_iot_local_wiz.nx nx_iot_local_wiz_test.nx

imports: nx_syscalls_x86_64.nx

imported by: nx_iot_local_wiz_test.nx

structs

132struct IotWizPilot

consts

111const NX_IOT_WIZ_VERDICT_UNKNOWN: i64 = 0
112const NX_IOT_WIZ_VERDICT_OK: i64 = 1
113const NX_IOT_WIZ_VERDICT_BUF_TOO_SMALL: i64 = 2
114const NX_IOT_WIZ_VERDICT_NO_RESULT: i64 = 3 // no "result" key
115const NX_IOT_WIZ_VERDICT_KEY_NOT_FOUND: i64 = 4
116const NX_IOT_WIZ_VERDICT_BAD_VALUE: i64 = 5
117const NX_IOT_WIZ_VERDICT_BAD_ARG: i64 = 6
118const NX_IOT_WIZ_VERDICT_N: i64 = 7
128const NX_IOT_WIZ_PORT: i64 = 38899

functions

120func nx_iot_wiz_verdict_is_valid(v: i64) -> i64
called by 1: main
158func nx_iot_wiz_itoa(out: *u8, v: i64) -> i64
181func nx_iot_wiz_find(buf: *u8, len: i64, pat: *u8, pat_len: i64) -> i64
206func nx_iot_wiz_atoi(buf: *u8, len: i64, off: i64,
228func nx_iot_wiz_build_set_rgb(out: *u8, out_cap: i64,
called by 1: main calls 1: nx_iot_wiz_itoa
274func nx_iot_wiz_build_set_state(out: *u8, out_cap: i64, on: i64) -> i64
called by 1: main
302func nx_iot_wiz_build_set_scene(out: *u8, out_cap: i64, scene_id: i64) -> i64
called by 1: main calls 1: nx_iot_wiz_itoa
327func nx_iot_wiz_build_get_pilot(out: *u8, out_cap: i64) -> i64
called by 1: main
350func nx_iot_wiz_value_offset(buf: *u8, len: i64,
360func nx_iot_wiz_parse_pilot(buf: *u8, len: i64,