feat(vd960DBN): TCP JSON协议服务 — 端口5960, 鉴权+15条命令

- net_config.h: TCP_LISTEN=0→1, TCP=2 支持 JSON 监听
- 新增 tcp_json_srv.h/c: 行分隔 JSON, pwd_verify鉴权, 命令分发
- 实现15条协议命令: dev_info/ssc_net/iot_net/iot_topic/pwd_set/factory_reset等
- loop_param_set/query 接受命令返回stub(Loop MCU中继待实现)
- net_srv.c: 集成 JSON 中断路由 + init
- peripheral_main.c: 主循环 tcp_json_poll()
This commit is contained in:
wangfq
2026-06-30 14:53:53 +08:00
parent ece82be6dd
commit af997a79fe
5 changed files with 843 additions and 23 deletions

View File

@@ -24,9 +24,9 @@ extern "C" {
#define WCHNET_NUM_UDP 1 /* The number of UDP connections */
#define WCHNET_NUM_TCP 1 /* Number of TCP connections */
#define WCHNET_NUM_TCP 2 /* Number of TCP connections (1 SSC/MQTT + 1 JSON accepted) */
#define WCHNET_NUM_TCP_LISTEN 0 /* Number of TCP listening */
#define WCHNET_NUM_TCP_LISTEN 1 /* Number of TCP listening (JSON protocol on port 5960) */
/* The number of sockets, the maximum is 31 */
#define WCHNET_MAX_SOCKET_NUM (WCHNET_NUM_IPRAW+WCHNET_NUM_UDP+WCHNET_NUM_TCP+WCHNET_NUM_TCP_LISTEN)