mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-29 15:42:20 +03:00
добавил наследника для класса отправки в сокеты
This commit is contained in:
21
src/сlasses/sendJson.cpp
Normal file
21
src/сlasses/sendJson.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "сlasses/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('}') + "}";
|
||||
send(jsonArrayElement, _num);
|
||||
}
|
||||
}
|
||||
|
||||
SendJson* mySendJson;
|
||||
Reference in New Issue
Block a user