test mqtt with own task, dev.2i

This commit is contained in:
MichaelDvP
2023-10-15 12:55:50 +02:00
parent 654403ca3d
commit abe0d793d6
2 changed files with 4 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ void MqttSettingsService::startClient() {
#if CONFIG_IDF_TARGET_ESP32S3
if (_state.rootCA.length() > 0) {
isSecure = true;
_mqttClient = static_cast<MqttClient *>(new espMqttClientSecure(espMqttClientTypes::UseInternalTask::NO));
_mqttClient = static_cast<MqttClient *>(new espMqttClientSecure(espMqttClientTypes::UseInternalTask::YES));
if (_state.rootCA == "insecure") {
static_cast<espMqttClientSecure *>(_mqttClient)->setInsecure();
} else {
@@ -72,7 +72,7 @@ void MqttSettingsService::startClient() {
}
#endif
isSecure = false;
_mqttClient = static_cast<MqttClient *>(new espMqttClient(espMqttClientTypes::UseInternalTask::NO));
_mqttClient = static_cast<MqttClient *>(new espMqttClient(espMqttClientTypes::UseInternalTask::YES));
static_cast<espMqttClient *>(_mqttClient)->onConnect(std::bind(&MqttSettingsService::onMqttConnect, this, _1));
static_cast<espMqttClient *>(_mqttClient)->onDisconnect(std::bind(&MqttSettingsService::onMqttDisconnect, this, _1));
}
@@ -83,7 +83,7 @@ void MqttSettingsService::loop() {
_disconnectedAt = configureMqtt() ? 0 : uuid::get_uptime();
_reconfigureMqtt = false;
}
_mqttClient->loop();
// _mqttClient->loop(); // done by mqtt task
}
bool MqttSettingsService::isEnabled() {