Files
IoTManager/src/Configuration.cpp

22 lines
695 B
C++
Raw Normal View History

#include "Configuration.h"
extern void* getAPI_AnalogAdc(String params);
2022-01-14 20:22:52 +01:00
std::vector<IoTSensor*> iotSensors;
void configure(String path) {
File file = seekFile(path);
file.find("[");
while (file.available()) {
String jsonArrayElement = file.readStringUntil('}') + "}";
if (jsonArrayElement.startsWith(",")) {
jsonArrayElement = jsonArrayElement.substring(1, jsonArrayElement.length()); //это нужно оптимизировать в последствии
}
myIoTSensor = (IoTSensor*)getAPI_AnalogAdc(jsonArrayElement);
if (myIoTSensor) {
iotSensors.push_back(myIoTSensor);
}
}
file.close();
2022-01-14 20:22:52 +01:00
}