mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
add optional secure mqtt
This commit is contained in:
@@ -63,6 +63,7 @@ class MqttSettings {
|
||||
bool enabled;
|
||||
String host;
|
||||
uint16_t port;
|
||||
String rootCA;
|
||||
|
||||
// username and password
|
||||
String username;
|
||||
@@ -110,7 +111,9 @@ class MqttSettingsService : public StatefulService<MqttSettings> {
|
||||
bool isConnected();
|
||||
const char * getClientId();
|
||||
espMqttClientTypes::DisconnectReason getDisconnectReason();
|
||||
espMqttClient * getMqttClient();
|
||||
MqttClient * getMqttClient();
|
||||
void setWill(const char * topic);
|
||||
void onMessage(espMqttClientTypes::OnMessageCallback callback);
|
||||
|
||||
protected:
|
||||
void onConfigUpdated();
|
||||
@@ -125,6 +128,7 @@ class MqttSettingsService : public StatefulService<MqttSettings> {
|
||||
char * _retainedClientId;
|
||||
char * _retainedUsername;
|
||||
char * _retainedPassword;
|
||||
char * _retainedRootCA;
|
||||
|
||||
// variable to help manage connection
|
||||
bool _reconfigureMqtt;
|
||||
@@ -134,7 +138,7 @@ class MqttSettingsService : public StatefulService<MqttSettings> {
|
||||
espMqttClientTypes::DisconnectReason _disconnectReason;
|
||||
|
||||
// the MQTT client instance
|
||||
espMqttClient _mqttClient;
|
||||
MqttClient * _mqttClient = nullptr;
|
||||
|
||||
void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
void onMqttConnect(bool sessionPresent);
|
||||
|
||||
Reference in New Issue
Block a user