Skip to content

Commit

Permalink
Fix an initialisation issue with mEnableSerialLogs
Browse files Browse the repository at this point in the history
  • Loading branch information
plapointe6 committed Apr 14, 2019
1 parent 1685eb5 commit 4ce19e1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/EspMQTTClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ EspMQTTClient::EspMQTTClient(
const bool enableWebUpdater, const bool enableSerialLogs)
: mWifiSsid(wifiSsid), mWifiPassword(wifiPassword), mMqttServerIp(mqttServerIp),
mMqttServerPort(mqttServerPort), mMqttUsername(mqttUsername), mMqttPassword(mqttPassword),
mMqttClientName(mqttClientName), mConnectionEstablishedCallback(connectionEstablishedCallback),
mEnableSerialLogs(enableSerialLogs)
mMqttClientName(mqttClientName), mConnectionEstablishedCallback(connectionEstablishedCallback)
{
initialize();

if (enableWebUpdater)
enableHTTPWebUpdater();

if (enableSerialLogs)
enableDebuggingMessages();
}

EspMQTTClient::EspMQTTClient(
Expand All @@ -67,13 +69,15 @@ EspMQTTClient::EspMQTTClient(
const bool enableWebUpdater, const bool enableSerialLogs)
: mWifiSsid(wifiSsid), mWifiPassword(wifiPassword), mMqttServerIp(mqttServerIp),
mMqttServerPort(mqttServerPort), mMqttUsername(mqttUsername), mMqttPassword(mqttPassword),
mMqttClientName(mqttClientName), mConnectionEstablishedCallback(connectionEstablishedCallback),
mEnableSerialLogs(enableSerialLogs)
mMqttClientName(mqttClientName), mConnectionEstablishedCallback(connectionEstablishedCallback)
{
initialize();

if (enableWebUpdater)
enableHTTPWebUpdater();

if (enableSerialLogs)
enableDebuggingMessages();
}

EspMQTTClient::~EspMQTTClient() {}
Expand Down Expand Up @@ -104,6 +108,9 @@ void EspMQTTClient::initialize()
mUpdateServerAddress = NULL;
mHttpServer = NULL;
mHttpUpdater = NULL;

// other
mEnableSerialLogs = false;
}

// =============== Configuration functions, most of them must be called before the first loop() call ==============
Expand Down

0 comments on commit 4ce19e1

Please sign in to comment.