mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
добавил класс сенсора и наследующий класс аналогового сенсора
This commit is contained in:
23
src/Configuration.cpp
Normal file
23
src/Configuration.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "Configuration.h"
|
||||
|
||||
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")) {
|
||||
//iotSensors.push_back(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();
|
||||
}
|
||||
Reference in New Issue
Block a user