mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
Добавляем релоад конфигурации при нажатии соответсвующей кнопки в интерфейсе
This commit is contained in:
@@ -29,4 +29,12 @@ void configure(String path) {
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
||||
void clearConfigure() {
|
||||
Serial.printf("Start clearing config\n");
|
||||
for (unsigned int i = 0; i < IoTItems.size(); i++) {
|
||||
if (IoTItems[i]) delete IoTItems[i];
|
||||
}
|
||||
IoTItems.clear();
|
||||
}
|
||||
@@ -71,6 +71,8 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
|
||||
//**сохранение**//
|
||||
if (headerStr == "/gifnoc|") {
|
||||
writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256);
|
||||
clearConfigure();
|
||||
configure("/config.json");
|
||||
}
|
||||
// page connection===================================================================
|
||||
//**отправка**//
|
||||
|
||||
Reference in New Issue
Block a user