2021-12-24 00:44:11 +01:00
|
|
|
#pragma once
|
|
|
|
|
#include "Global.h"
|
2022-01-20 13:36:00 +01:00
|
|
|
#ifdef QUEUE_FROM_STR
|
|
|
|
|
#include "classes/QueueFromStruct.h"
|
2021-12-24 00:44:11 +01:00
|
|
|
|
2021-12-28 00:01:01 +01:00
|
|
|
class SendJson;
|
2021-12-24 00:44:11 +01:00
|
|
|
|
2021-12-30 23:58:56 +01:00
|
|
|
class SendJson {
|
2021-12-24 00:44:11 +01:00
|
|
|
public:
|
2021-12-28 00:01:01 +01:00
|
|
|
SendJson();
|
|
|
|
|
~SendJson();
|
2021-12-24 00:44:11 +01:00
|
|
|
|
2022-01-20 13:36:00 +01:00
|
|
|
void addFileToQueue(String path, uint8_t num);
|
2021-12-24 00:44:11 +01:00
|
|
|
|
|
|
|
|
void loop();
|
|
|
|
|
|
2021-12-30 23:58:56 +01:00
|
|
|
void sendWs(String& jsonArrayElement);
|
|
|
|
|
|
|
|
|
|
void sendMqtt(String& jsonArrayElement);
|
|
|
|
|
|
2022-01-20 13:36:00 +01:00
|
|
|
QueueItems myItem;
|
2021-12-28 00:01:01 +01:00
|
|
|
|
2021-12-24 00:44:11 +01:00
|
|
|
private:
|
|
|
|
|
File file;
|
|
|
|
|
String _path;
|
2022-01-20 13:36:00 +01:00
|
|
|
uint8_t _num;
|
|
|
|
|
bool sendingInProgress = false;
|
2021-12-24 00:44:11 +01:00
|
|
|
};
|
|
|
|
|
|
2022-01-20 13:36:00 +01:00
|
|
|
extern SendJson* sendJsonFiles;
|
|
|
|
|
#endif
|