Skip to content

Commit ae0194d

Browse files
authored
Merge pull request #488 from andreagilardoni/mqtt-poll-moved
moving mqtt poll into ArduinoIoTCloudTCP::handle_Connected
2 parents 25e6583 + dbc4242 commit ae0194d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: src/ArduinoIoTCloudTCP.cpp

+3-4
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()
@@ -304,6 +300,9 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
304300
return State::Disconnect;
305301
}
306302

303+
/* Check for new data from the MQTT client. */
304+
_mqttClient.poll();
305+
307306
/* Retransmit data in case there was a lost transaction due
308307
* to phy layer or MQTT connectivity loss.
309308
*/

0 commit comments

Comments
 (0)