2022-01-10 16:49:01 +01:00
|
|
|
#include "classes/sendJson.h"
|
2021-12-28 00:01:01 +01:00
|
|
|
|
|
|
|
|
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('}') + "}";
|
2021-12-30 23:58:56 +01:00
|
|
|
sendWs(jsonArrayElement);
|
2021-12-28 00:01:01 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-30 23:58:56 +01:00
|
|
|
void SendJson::sendWs(String& jsonArrayElement) {
|
|
|
|
|
standWebSocket.sendTXT(_num, jsonArrayElement);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SendJson::sendMqtt(String& jsonArrayElement) {
|
|
|
|
|
// mqtt send to do
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-28 00:01:01 +01:00
|
|
|
SendJson* mySendJson;
|