fix mqtt ptr init bug
This commit is contained in:
parent
443a02c319
commit
14767df9ec
4 changed files with 93 additions and 41 deletions
|
@ -163,6 +163,9 @@ void InternalDisplay::saveMQTTConfig()
|
|||
// password_set -> a text input to set the mqtt password
|
||||
// topic_set -> a text input to set the mqtt base topic
|
||||
|
||||
// Send the stop bytes to flush the serial buffer
|
||||
this->sendStopBytes();
|
||||
|
||||
// Save the mqtt server
|
||||
if(!this->getStringToBuffer("mqttsv_set.txt", this->mqttConfig->mqtt_server, 16))
|
||||
return;
|
||||
|
@ -183,7 +186,10 @@ void InternalDisplay::saveMQTTConfig()
|
|||
return;
|
||||
|
||||
// Save the mqtt use auth
|
||||
this->mqttConfig->mqtt_useauth = this->getNumber("use_auth.val") == 1 ? true : false;
|
||||
uint8_t use_auth = this->getNumber("use_auth.val");
|
||||
Serial.print("use_auth: ");
|
||||
Serial.println(use_auth);
|
||||
this->mqttConfig->mqtt_useauth = use_auth == 1 ? true : false;
|
||||
this->iot->saveMqttConfig();
|
||||
ESP.restart();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue