Import/Export config over MQTT
This commit is contained in:
@@ -32,7 +32,7 @@ void NetworkDevice::init()
|
||||
if(ca_cert.length() > 1)
|
||||
{
|
||||
_useEncryption = true;
|
||||
Log->println(("MQTT over TLS."));
|
||||
Log->println("MQTT over TLS.");
|
||||
_mqttClientSecure = new espMqttClientSecure(espMqttClientTypes::UseInternalTask::NO);
|
||||
_mqttClientSecure->setCACert(caDest);
|
||||
|
||||
@@ -57,7 +57,7 @@ void NetworkDevice::init()
|
||||
|
||||
if(cert.length() > 1 && key.length() > 1)
|
||||
{
|
||||
Log->println(("MQTT with client certificate."));
|
||||
Log->println("MQTT with client certificate.");
|
||||
_mqttClientSecure->setCertificate(certDest);
|
||||
_mqttClientSecure->setPrivateKey(keyDest);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ void NetworkDevice::init()
|
||||
|
||||
if (!_useEncryption)
|
||||
{
|
||||
Log->println(("MQTT without TLS."));
|
||||
Log->println("MQTT without TLS.");
|
||||
_mqttClient = new espMqttClient(espMqttClientTypes::UseInternalTask::NO);
|
||||
}
|
||||
|
||||
@@ -251,6 +251,11 @@ void NetworkDevice::mqttDisable()
|
||||
_mqttEnabled = false;
|
||||
}
|
||||
|
||||
bool NetworkDevice::isEncrypted()
|
||||
{
|
||||
return _useEncryption;
|
||||
}
|
||||
|
||||
MqttClient *NetworkDevice::getMqttClient() const
|
||||
{
|
||||
if (_useEncryption)
|
||||
|
||||
Reference in New Issue
Block a user