This commit is contained in:
Dmitry Borisenko
2022-01-14 20:23:22 +01:00
parent 1fda00d5ca
commit 6f8d88d155
2 changed files with 0 additions and 0 deletions

27
src/classes/SendJson.cpp Normal file
View File

@@ -0,0 +1,27 @@
#include "classes/SendJson.h"
SendJson::SendJson() {}
SendJson::~SendJson() {}
void SendJson::sendFile(String path, uint8_t num) {
_path = path;
_num = num;
file = seekFile(path);
}
void SendJson::loop() {
if (file.available()) {
String jsonArrayElement = _path + file.readStringUntil('}') + "}";
sendWs(jsonArrayElement);
}
}
void SendJson::sendWs(String& jsonArrayElement) {
standWebSocket.sendTXT(_num, jsonArrayElement);
}
void SendJson::sendMqtt(String& jsonArrayElement) {
// mqtt send to do
}
SendJson* mySendJson;