комментарии

This commit is contained in:
Dmitry Borisenko
2022-01-15 17:41:12 +01:00
parent ccead93da4
commit a9c07e8865
3 changed files with 2 additions and 2 deletions

27
src/ESPConfiguration.cpp Normal file
View File

@@ -0,0 +1,27 @@
#include "ESPConfiguration.h"
std::vector<IoTSensor*> iotSensors;
//============================================================================================
//здесь скопируйте строку и вставьте ниже, заменив имя AnalogAdc на название вашего сенсора
extern void* getAPI_AnalogAdc(String params);
//============================================================================================
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()); //это нужно оптимизировать в последствии
}
//===============================================================================================================
//здесь нужно скопировать блок еще раз и вставить его ниже, переименовав AnalogAdc на название вашего сенсора
myIoTSensor = (IoTSensor*)getAPI_AnalogAdc(jsonArrayElement);
if (myIoTSensor) {
iotSensors.push_back(myIoTSensor);
}
//================================================================================================================
}
file.close();
}