BLE improvements
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
|
||||
void NetworkDevice::init()
|
||||
{
|
||||
_useEncryption = false;
|
||||
|
||||
if(_preferences->getBool(preference_mqtt_ssl_enabled, false)) {
|
||||
if (!SPIFFS.begin(true)) {
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
@@ -265,6 +267,21 @@ void NetworkDevice::mqttDisable()
|
||||
_mqttEnabled = false;
|
||||
}
|
||||
|
||||
void NetworkDevice::mqttRestart()
|
||||
{
|
||||
if (_useEncryption)
|
||||
{
|
||||
delete _mqttClientSecure;
|
||||
_mqttClientSecure = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete _mqttClient;
|
||||
_mqttClient = nullptr;
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
bool NetworkDevice::isEncrypted()
|
||||
{
|
||||
return _useEncryption;
|
||||
|
||||
Reference in New Issue
Block a user