добавил функцию конфигуратора esp

This commit is contained in:
Dmitry Borisenko
2022-01-14 20:42:11 +01:00
parent 6f8d88d155
commit d4f9069f6f
2 changed files with 18 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
#pragma once
#include "Global.h"
extern void configuration(String& path);
extern void configure(String& path);

View File

@@ -1,5 +1,20 @@
#include "Config.h"
void configuration(String& path) {
file = seekFile(path);
void configure(String& path) {
File file = seekFile(path);
while (file.available()) {
String jsonArrayElement = file.readStringUntil('}') + "}";
String value;
if (jsonRead(jsonArrayElement, F("subtype"), value)) {
if (value == F("button-out")) {
//=============================
} else if (value == F("pwm-out")) {
//=============================
}
} else {
SerialPrint(F("E"), F("System"), F("Fatal configuration error, type wrong or missing"));
}
}
file.close();
}