BLE improvements

This commit is contained in:
iranl
2025-06-20 09:27:10 +02:00
parent 01c72f2e3f
commit ef85bc105b
11 changed files with 79 additions and 54 deletions

View File

@@ -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;