xiaoxiang781216 commented on code in PR #1748:
URL: https://github.com/apache/nuttx-apps/pull/1748#discussion_r1192937427


##########
netutils/mqttc/0001_add_connection_status.patch:
##########
@@ -0,0 +1,25 @@
+diff -Naur MQTT-C_orig/include/mqtt.h MQTT-C/include/mqtt.h
+--- MQTT-C_orig/include/mqtt.h 2021-03-29 14:53:52.000000000 -0300
++++ MQTT-C/include/mqtt.h      2023-05-12 19:45:20.090216999 -0300
+@@ -1233,6 +1233,9 @@
+ 
+     /** @brief The sending message queue. */
+     struct mqtt_message_queue mq;
++
++    /** @brief Flag is set on connection event */
++    bool event_connect;
+ };
+ 
+ /**
+diff -Naur MQTT-C_orig/src/mqtt.c MQTT-C/src/mqtt.c
+--- MQTT-C_orig/src/mqtt.c     2021-03-29 14:53:52.000000000 -0300
++++ MQTT-C/src/mqtt.c  2023-05-12 19:51:38.675627411 -0300
+@@ -732,6 +732,8 @@
+                         mqtt_recv_ret = MQTT_ERROR_CONNECTION_REFUSED;
+                     }
+                     break;
++                } else {
++                    client->event_connect = true;

Review Comment:
   but should we clear this flag in mqtt_init(), mqtt_init_reconnect() and 
mqtt_reinit()?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to