Skip to content

Commit

Permalink
mqtt use main task again
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Oct 18, 2023
1 parent 7d85532 commit ddfc9f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/framework/MqttSettingsService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::YES));
_mqttClient = static_cast<MqttClient *>(new espMqttClientSecure(espMqttClientTypes::UseInternalTask::NO));
if (_state.rootCA == "insecure") {
static_cast<espMqttClientSecure *>(_mqttClient)->setInsecure();
} else {
Expand All @@ -72,7 +72,7 @@ void MqttSettingsService::startClient() {
}
#endif
isSecure = false;
_mqttClient = static_cast<MqttClient *>(new espMqttClient(espMqttClientTypes::UseInternalTask::YES));
_mqttClient = static_cast<MqttClient *>(new espMqttClient(espMqttClientTypes::UseInternalTask::NO));
static_cast<espMqttClient *>(_mqttClient)->onConnect(std::bind(&MqttSettingsService::onMqttConnect, this, _1));
static_cast<espMqttClient *>(_mqttClient)->onDisconnect(std::bind(&MqttSettingsService::onMqttDisconnect, this, _1));
}
Expand All @@ -83,7 +83,7 @@ void MqttSettingsService::loop() {
_disconnectedAt = configureMqtt() ? 0 : uuid::get_uptime();
_reconfigureMqtt = false;
}
// _mqttClient->loop(); // done by mqtt task
_mqttClient->loop(); // done by mqtt task
}

bool MqttSettingsService::isEnabled() {
Expand Down

0 comments on commit ddfc9f9

Please sign in to comment.