From de3a7c197e60f682098622401bd4eb405b47cadc Mon Sep 17 00:00:00 2001 From: wangfq Date: Mon, 6 Jul 2026 11:31:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(vd960DBN):=20MQTTPacket=5FconnectData=5Fini?= =?UTF-8?q?tializer=20=E4=B8=8D=E8=83=BD=E7=94=A8=E4=BA=8E=E8=B5=8B?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E7=94=A8=E4=B8=B4=E6=97=B6=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E4=B8=AD=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/iot_mqtt_srv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/iot_mqtt_srv.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/iot_mqtt_srv.c index 387824b..940a406 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/iot_mqtt_srv.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/iot_mqtt_srv.c @@ -81,7 +81,8 @@ static int iot_mqtt_send_connect(void) { static uint8_t buf[256]; // static: 避免 256字节栈开销 int len; - opts = MQTTPacket_connectData_initializer; + // struct assignment 不支持 brace initializer,用临时变量中转 + { MQTTPacket_connectData _init = MQTTPacket_connectData_initializer; opts = _init; } opts.MQTTVersion = 4; // MQTT 3.1.1 opts.keepAliveInterval = IOT_MQTT_KEEPALIVE_SEC;