сокеты

This commit is contained in:
Dmitry Borisenko
2021-12-30 23:58:56 +01:00
parent be35992c84
commit 9397bac72e
5 changed files with 50 additions and 39 deletions

View File

@@ -1,7 +1,5 @@
#include "сlasses/sendJson.h"
//базовый класс
SendJson::SendJson() {}
SendJson::~SendJson() {}
@@ -14,8 +12,16 @@ void SendJson::sendFile(String path, uint8_t num) {
void SendJson::loop() {
if (file.available()) {
String jsonArrayElement = _path + file.readStringUntil('}') + "}";
send(jsonArrayElement, _num);
sendWs(jsonArrayElement);
}
}
void SendJson::sendWs(String& jsonArrayElement) {
standWebSocket.sendTXT(_num, jsonArrayElement);
}
void SendJson::sendMqtt(String& jsonArrayElement) {
// mqtt send to do
}
SendJson* mySendJson;