fix indentation

This commit is contained in:
Ronald Schaten 2016-02-24 07:43:01 +01:00
parent 3d7a089e0e
commit bf61e4c937

View File

@ -191,7 +191,6 @@ void setup() {
// start ticker with 0.5 because we start in AP mode and try to connect
ticker.attach(0.6, toggle_led);
//clean FS, for testing
//SPIFFS.format();
@ -209,18 +208,15 @@ void setup() {
size_t size = configFile.size();
// Allocate a buffer to store contents of the file.
std::unique_ptr<char[]> buf(new char[size]);
configFile.readBytes(buf.get(), size);
DynamicJsonBuffer jsonBuffer;
JsonObject& json = jsonBuffer.parseObject(buf.get());
json.printTo(Serial);
if (json.success()) {
Serial.println("\nparsed json");
strcpy(mqtt_server, json["mqtt_server"]);
strcpy(mqtt_port, json["mqtt_port"]);
strcpy(mqtt_topic, json["mqtt_topic"]);
} else {
Serial.println("failed to load json config");
}