mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
use espMqttClient, qos2 fixed
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include <StatefulService.h>
|
||||
#include <HttpEndpoint.h>
|
||||
#include <FSPersistence.h>
|
||||
#include <AsyncMqttClient.h>
|
||||
#include <espMqttClient.h>
|
||||
#include <ESPUtils.h>
|
||||
|
||||
#include <uuid/common.h>
|
||||
@@ -104,13 +104,13 @@ class MqttSettingsService : public StatefulService<MqttSettings> {
|
||||
MqttSettingsService(AsyncWebServer * server, FS * fs, SecurityManager * securityManager);
|
||||
~MqttSettingsService();
|
||||
|
||||
void begin();
|
||||
void loop();
|
||||
bool isEnabled();
|
||||
bool isConnected();
|
||||
const char * getClientId();
|
||||
AsyncMqttClientDisconnectReason getDisconnectReason();
|
||||
AsyncMqttClient * getMqttClient();
|
||||
void begin();
|
||||
void loop();
|
||||
bool isEnabled();
|
||||
bool isConnected();
|
||||
const char * getClientId();
|
||||
espMqttClientTypes::DisconnectReason getDisconnectReason();
|
||||
espMqttClient * getMqttClient();
|
||||
|
||||
protected:
|
||||
void onConfigUpdated();
|
||||
@@ -120,7 +120,7 @@ class MqttSettingsService : public StatefulService<MqttSettings> {
|
||||
FSPersistence<MqttSettings> _fsPersistence;
|
||||
|
||||
// Pointers to hold retained copies of the mqtt client connection strings.
|
||||
// This is required as AsyncMqttClient holds references to the supplied connection strings.
|
||||
// This is required as espMqttClient holds references to the supplied connection strings.
|
||||
char * _retainedHost;
|
||||
char * _retainedClientId;
|
||||
char * _retainedUsername;
|
||||
@@ -131,15 +131,15 @@ class MqttSettingsService : public StatefulService<MqttSettings> {
|
||||
unsigned long _disconnectedAt;
|
||||
|
||||
// connection status
|
||||
AsyncMqttClientDisconnectReason _disconnectReason;
|
||||
espMqttClientTypes::DisconnectReason _disconnectReason;
|
||||
|
||||
// the MQTT client instance
|
||||
AsyncMqttClient _mqttClient;
|
||||
espMqttClient _mqttClient;
|
||||
|
||||
void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
void onMqttConnect(bool sessionPresent);
|
||||
void onMqttDisconnect(AsyncMqttClientDisconnectReason reason);
|
||||
void configureMqtt();
|
||||
void onMqttDisconnect(espMqttClientTypes::DisconnectReason reason);
|
||||
bool configureMqtt();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user