mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
добавил функцию конфигуратора esp
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#include "Global.h"
|
||||
|
||||
extern void configuration(String& path);
|
||||
extern void configure(String& path);
|
||||
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user