wangfq
c0220c1d37
fix(vd960DBN): IoT socket 重复创建 + broker IP 解析错误
...
- iot_connect_broker: 删除 memcpy,get_ipstr_to_array 已正确解析 IP
之前 memcpy 把原始 ASCII 字节覆写到 broker_ip,导致 IP 变成 49.50.49.46
- peripheral_main.c: IoT 模式下跳过 WCHNET_CreateTcpMqttSocket,
由 iot_connect_broker() 统一管理 socket 生命周期,避免重复创建
2026-07-06 10:46:51 +08:00
wangfq
e6dbdb5296
fix(vd960DBN): 修复无法设置 IoT 模式的 bug
2026-07-06 10:24:15 +08:00
wangfq
39bda6067f
fix(vd960DBN): add missing closing brace for case PUBLISH block in iot_process_recv
...
case PUBLISH: { ... } was missing its closing }, causing ARMCC to think
iot_send_heartbeat and iot_connect_broker were declared inside a function body.
2026-07-03 18:28:40 +08:00
wangfq
122c36bb9d
fix(vd960DBN): iot_make_topic missing 5th arg for "srv"/"ctrl" topic
2026-07-03 18:18:38 +08:00
wangfq
6f5effae8c
fix(vd960DBN): iot_mqtt_srv compilation errors
...
- Add extern g_report_active (from tcp_json_srv.h)
- Fix iot_make_topic call: 4-arg -> 5-arg (add NULL for 'status' sub)
- Fix SOCK_INF field names: DestPort->DesPort, DestAddr->IPAddr
- Fix struct _WCHNET_IPAddr -> uint8_t broker_ip[4] (type not available)
2026-07-03 18:12:55 +08:00
wangfq
9629729dc9
feat: IoT MQTT 客户端实现 — NET_SSC_ENABLE=0 时启用
...
新增文件:
- iot_mqtt_srv.h/c: MQTT 客户端 (TCP→CONNECT→SUBSCRIBE→READY)
支持: dev_info_query, pwd_verify (其他命令框架预留)
上报: loop_data (传感器), heartbeat (心跳 60s)
断线重连: 指数退避 5s~60s
协议: DLD960 IoT MQTT V1.00 (dld960/{sn}/...)
修改:
- net_config.h: 新增 NET_IOT_ENABLE = !NET_SSC_ENABLE,
IoT 模式分配 1 TCP socket (MQTT client)
- net_srv.c: IoT 初始化 + socket 中断路由
- peripheral_main.c: IoT poll + sensor publish 调用
模式:
NET_SSC_ENABLE=1 → SCC + TCP JSON Server (原有行为)
NET_SSC_ENABLE=0 → IoT MQTT Client (新增)
2026-07-03 17:36:22 +08:00