From 157ff48835ae9256eb80d6457970ea4280f538a1 Mon Sep 17 00:00:00 2001 From: wangfq Date: Wed, 1 Jul 2026 13:47:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20NET=5FSSC=5FENABLE=3D0=20=E6=97=B6=20g?= =?UTF-8?q?=5Fnet=5Fstate.flag=20=E5=8D=A1=E5=9C=A8=201=20=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=20tcp=5Fjson=5Fsrv=5Finit=20=E5=8F=8D=E5=A4=8D?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WCHNET_CreateUdpSocket 原本会将 flag 推进到 2,被 #if 排除后 net_srv_init 每次主循环都重新执行,tcp_json_srv_init 首次成功后 后续 SocketCreat 都返回 0x1B(socket 已存在) 修复:SSC 禁用时在 tcp_json_srv_init 后手动设 flag=2 --- vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/net_srv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/net_srv.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/net_srv.c index ec5ed66..245c291 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/net_srv.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/net_srv.c @@ -1120,6 +1120,9 @@ void net_srv_init(void) WCHNET_CreateUdpSocket(); #endif tcp_json_srv_init(); // Start JSON protocol TCP listener on port 5960 +#if !NET_SSC_ENABLE + g_net_state.flag = 2; // Skip SSC init, advance state directly +#endif }