nx_iot_local_wiz.nx
buildroot/runtime/nx_iot_local_wiz.nx
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
imports: nx_syscalls_x86_64.nx
imported by: nx_iot_local_wiz_test.nx
structs
| 132 | struct IotWizPilot |
consts
| 111 | const NX_IOT_WIZ_VERDICT_UNKNOWN: i64 = 0 |
| 112 | const NX_IOT_WIZ_VERDICT_OK: i64 = 1 |
| 113 | const NX_IOT_WIZ_VERDICT_BUF_TOO_SMALL: i64 = 2 |
| 114 | const NX_IOT_WIZ_VERDICT_NO_RESULT: i64 = 3 // no "result" key |
| 115 | const NX_IOT_WIZ_VERDICT_KEY_NOT_FOUND: i64 = 4 |
| 116 | const NX_IOT_WIZ_VERDICT_BAD_VALUE: i64 = 5 |
| 117 | const NX_IOT_WIZ_VERDICT_BAD_ARG: i64 = 6 |
| 118 | const NX_IOT_WIZ_VERDICT_N: i64 = 7 |
| 128 | const NX_IOT_WIZ_PORT: i64 = 38899 |
functions
| 120 | func nx_iot_wiz_verdict_is_valid(v: i64) -> i64 called by 1: main |
| 158 | func nx_iot_wiz_itoa(out: *u8, v: i64) -> i64 |
| 181 | func nx_iot_wiz_find(buf: *u8, len: i64, pat: *u8, pat_len: i64) -> i64 |
| 206 | func nx_iot_wiz_atoi(buf: *u8, len: i64, off: i64, |
| 228 | func nx_iot_wiz_build_set_rgb(out: *u8, out_cap: i64, |
| 274 | func nx_iot_wiz_build_set_state(out: *u8, out_cap: i64, on: i64) -> i64 called by 1: main |
| 302 | func nx_iot_wiz_build_set_scene(out: *u8, out_cap: i64, scene_id: i64) -> i64 |
| 327 | func nx_iot_wiz_build_get_pilot(out: *u8, out_cap: i64) -> i64 called by 1: main |
| 350 | func nx_iot_wiz_value_offset(buf: *u8, len: i64, |
| 360 | func nx_iot_wiz_parse_pilot(buf: *u8, len: i64, |