mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
Включаем сохранение конфигурации без перезагрузки
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
#include "WsServer.h"
|
#include "WsServer.h"
|
||||||
|
#include "classes/IoTScenario.h"
|
||||||
|
extern IoTScenario iotScen;
|
||||||
|
|
||||||
#ifdef STANDARD_WEB_SOCKETS
|
#ifdef STANDARD_WEB_SOCKETS
|
||||||
void standWebSocketsInit() {
|
void standWebSocketsInit() {
|
||||||
standWebSocket.begin();
|
standWebSocket.begin();
|
||||||
@@ -66,8 +69,8 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
|
|||||||
//**сохранение**//
|
//**сохранение**//
|
||||||
if (headerStr == "/gifnoc|") {
|
if (headerStr == "/gifnoc|") {
|
||||||
writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256);
|
writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256);
|
||||||
// clearConfigure();
|
clearConfigure();
|
||||||
// configure("/config.json");
|
configure("/config.json");
|
||||||
}
|
}
|
||||||
//**сохранение**//
|
//**сохранение**//
|
||||||
if (headerStr == "/tuoyal|") {
|
if (headerStr == "/tuoyal|") {
|
||||||
@@ -76,6 +79,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
|
|||||||
//**сохранение**//
|
//**сохранение**//
|
||||||
if (headerStr == "/oiranecs|") {
|
if (headerStr == "/oiranecs|") {
|
||||||
writeFileUint8tByFrames("scenario.txt", payload, length, headerLenth, 256);
|
writeFileUint8tByFrames("scenario.txt", payload, length, headerLenth, 256);
|
||||||
|
iotScen.loadScenario("/scenario.txt");
|
||||||
}
|
}
|
||||||
// page connection===================================================================
|
// page connection===================================================================
|
||||||
//**отправка**//
|
//**отправка**//
|
||||||
|
|||||||
Reference in New Issue
Block a user