Files
IoTManager/src/classes/SendJson.cpp

28 lines
572 B
C++
Raw Normal View History

2022-01-14 20:22:52 +01:00
#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('}') + "}";
2021-12-30 23:58:56 +01:00
sendWs(jsonArrayElement);
}
}
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
}
SendJson* mySendJson;