mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
Improve Wifi Reconnect handling and add outgoing queue for MQTT packets to bridge short connection issues.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "concurrency/OSThread.h"
|
||||
#include "mesh/Channels.h"
|
||||
#include "mesh/generated/mqtt.pb.h"
|
||||
#include <PubSubClient.h>
|
||||
#if HAS_WIFI
|
||||
#include <WiFiClient.h>
|
||||
@@ -12,6 +13,8 @@
|
||||
#include <EthernetClient.h>
|
||||
#endif
|
||||
|
||||
#define MAX_MQTT_QUEUE 32
|
||||
|
||||
/**
|
||||
* Our wrapper/singleton for sending/receiving MQTT "udp" packets. This object isolates the MQTT protocol implementation from
|
||||
* the two components that use it: MQTTPlugin and MQTTSimInterface.
|
||||
@@ -52,6 +55,10 @@ class MQTT : private concurrency::OSThread
|
||||
bool connected();
|
||||
|
||||
protected:
|
||||
PointerQueue<ServiceEnvelope> mqttQueue;
|
||||
|
||||
int reconnectCount = 0;
|
||||
|
||||
virtual int32_t runOnce() override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user