mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-12 01:40:52 +01:00
Fix: handle MQTT message fragmentation
MQTT messages might arrive in parts if their payload is too big. for that reason, we need to be prepared to re-assemble fragmented messages on a topic before handing them over to the subscriber.
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include <Ticker.h>
|
||||
#include <espMqttClient.h>
|
||||
#include <mutex>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class MqttSettingsClass {
|
||||
public:
|
||||
@@ -36,6 +38,7 @@ private:
|
||||
|
||||
MqttClient* _mqttClient = nullptr;
|
||||
Ticker _mqttReconnectTimer;
|
||||
std::map<String, std::vector<uint8_t>> _fragments;
|
||||
MqttSubscribeParser _mqttSubscribeParser;
|
||||
std::mutex _clientLock;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user