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 生命周期,避免重复创建
This commit is contained in:
wangfq
2026-07-06 10:46:51 +08:00
parent e6dbdb5296
commit c0220c1d37
2 changed files with 4 additions and 11 deletions
@@ -238,15 +238,9 @@ void Main_Circulation(void)
if(g_net_state.flag == 2)
{
if(g_sub_code_enable.iot_enable){
if(iot_net_info.mode == IOT_Addr_IP_Mode){
if(get_ipstr_to_array(iot_net_info.remote_addr, RemoteIP) == 0){
WCHNET_CreateTcpMqttSocket();
}
}
else{
//DNS
}
// IoT MQTT 模式由 iot_connect_broker() 自行管理 socket
// 不要在此重复创建,直接推进状态
g_net_state.flag = 3;
}
else
{