Files
IoTManager/src/Configuration.cpp

23 lines
873 B
C++
Raw Normal View History

#include "Configuration.h"
2022-01-14 20:22:52 +01:00
void configure(String& path) {
File file = seekFile(path);
while (file.available()) {
String jsonArrayElement = file.readStringUntil('}') + "}";
String subtype;
if (jsonRead(jsonArrayElement, F("subtype"), subtype)) {
if (subtype == F("button-out")) {
//=============================
} else if (subtype == F("pwm-out")) {
//=============================
} else if (subtype == F("analog-adc")) {
2022-01-15 00:14:36 +01:00
// iotSensors.push_back(new IoTSensorAnalog(jsonArrayElement));
} else {
SerialPrint(F("E"), F("Config"), F("config.json error, type not exist"));
}
} else {
SerialPrint(F("E"), F("Config"), F("config.json error, type wrong or missing"));
}
}
file.close();
2022-01-14 20:22:52 +01:00
}