mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 22:52:19 +03:00
19 lines
413 B
C++
19 lines
413 B
C++
|
|
#include "WebSocket.h"
|
||
|
|
|
||
|
|
#include "Global.h"
|
||
|
|
|
||
|
|
void wsSendSetup() {
|
||
|
|
File file = seekFile("/setup.json");
|
||
|
|
DynamicJsonDocument doc(1024);
|
||
|
|
file.find("[");
|
||
|
|
do {
|
||
|
|
deserializeJson(doc, file);
|
||
|
|
wsPublishData(F("config"), doc.as<String>());
|
||
|
|
} while (file.findUntil(",", "]"));
|
||
|
|
}
|
||
|
|
|
||
|
|
void wsPublishData(String topic, String data) {
|
||
|
|
data = "[" + topic + "]" + data;
|
||
|
|
ws.textAll(data);
|
||
|
|
}
|