mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
добавил функцию конфигуратора esp
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
|
|
||||||
extern void configuration(String& path);
|
extern void configure(String& path);
|
||||||
@@ -1,5 +1,20 @@
|
|||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
void configuration(String& path) {
|
void configure(String& path) {
|
||||||
file = seekFile(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