From 28b0ac16112865a20c35cd87f956d6ebec6133e1 Mon Sep 17 00:00:00 2001 From: hsaturn Date: Sun, 11 Apr 2021 21:21:48 +0200 Subject: [PATCH] Fix missing receive loop for mqttclient --- src/TinyMqtt.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/TinyMqtt.cpp b/src/TinyMqtt.cpp index 7a4f49d..f6fe9fe 100644 --- a/src/TinyMqtt.cpp +++ b/src/TinyMqtt.cpp @@ -271,6 +271,17 @@ void MqttClient::loop() // there is no need to send one PingReq per instance. } } +#ifndef TCP_ASYNC + while(client && client->available()>0) + { + message.incoming(client->read()); + if (message.type()) + { + processMessage(&message); + message.reset(); + } + } +#endif } void MqttClient::onConnect(void *mqttclient_ptr, TcpClient*)