compile with esp mqtt lib

This commit is contained in:
technyon
2023-01-27 19:29:13 +01:00
parent 10650c1132
commit c9dbbb5dc1
113 changed files with 9740 additions and 2997 deletions

View File

@@ -3,6 +3,7 @@
#include "../PreferencesKeys.h"
#include "../Logger.h"
#include "../MqttTopics.h"
#include "espMqttClient.h"
RTC_NOINIT_ATTR char WiFiDevice_reconfdetect[17];
@@ -31,12 +32,13 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* _preferences)
_wifiClientSecure->setCertificate(_cert);
_wifiClientSecure->setPrivateKey(_key);
}
_mqttClient = new MqttClient(*_wifiClientSecure);
// TODO
// _mqttClient = new espMqttClient(*_wifiClientSecure);
} else
{
Log->println(F("MQTT without TLS."));
_wifiClient = new WiFiClient();
_mqttClient = new MqttClient(*_wifiClient);
_mqttClient = new espMqttClient(_wifiClient);
}
if(_preferences->getBool(preference_mqtt_log_enabled))
@@ -51,11 +53,6 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* _preferences)
}
}
MqttClient *WifiDevice::mqttClient()
{
return _mqttClient;
}
void WifiDevice::initialize()
{
std::vector<const char *> wm_menu;
@@ -152,3 +149,8 @@ void WifiDevice::clearRtcInitVar(WiFiManager *)
{
memset(WiFiDevice_reconfdetect, 0, sizeof WiFiDevice_reconfdetect);
}
MqttClientSetup *WifiDevice::mqttClient()
{
return _mqttClient;
}