Skip to content

Commit dbc4242

Browse files
moving mqtt poll into ArduinoIoTCloudTCP::handle_Connected
1 parent 8b6ff40 commit dbc4242

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ void ArduinoIoTCloudTCP::update()
232232
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
233233
watchdog_reset();
234234
#endif
235-
236-
/* Check for new data from the MQTT client. */
237-
if (_mqttClient.connected())
238-
_mqttClient.poll();
239235
}
240236

241237
int ArduinoIoTCloudTCP::connected()
@@ -307,6 +303,9 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
307303
return State::Disconnect;
308304
}
309305

306+
/* Check for new data from the MQTT client. */
307+
_mqttClient.poll();
308+
310309
/* Retransmit data in case there was a lost transaction due
311310
* to phy layer or MQTT connectivity loss.
312311
*/

0 commit comments

Comments
 (0)