mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-29 15:42:20 +03:00
добавил очередь отправки файлов в сокеты
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#define USE_LITTLEFS false
|
||||
#endif
|
||||
|
||||
#define QUEUE_FROM_STR
|
||||
|
||||
//задачи таскера
|
||||
enum TimerTask_t { WIFI_SCAN,
|
||||
WIFI_MQTT_CONNECTION_CHECK,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "classes/NotAsync.h"
|
||||
#include "ESPConfiguration.h"
|
||||
#include "MqttClient.h"
|
||||
#include "classes/QueueFromChar.h"
|
||||
#include "classes/QueueFromInstance.h"
|
||||
//#include "queue/QueueFromChar.h"
|
||||
//#include "queue/QueueFromInstance.h"
|
||||
//#include "queue/QueueInst.h"
|
||||
#include "classes/QueueFromStruct.h"
|
||||
#include "classes/QueueInst.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Global.h"
|
||||
#ifdef QUEUE_FROM_STR
|
||||
#include <queue>
|
||||
#include <iostream>
|
||||
|
||||
@@ -7,6 +8,7 @@ using namespace std;
|
||||
|
||||
struct QueueItems {
|
||||
String myword;
|
||||
uint8_t num;
|
||||
};
|
||||
|
||||
class QueueFromStruct;
|
||||
@@ -19,13 +21,14 @@ class QueueFromStruct {
|
||||
void push(QueueItems word);
|
||||
void pop();
|
||||
QueueItems front();
|
||||
bool empty();
|
||||
|
||||
private:
|
||||
queue<QueueItems> queue1;
|
||||
QueueItems tmpItem;
|
||||
};
|
||||
|
||||
extern QueueFromStruct* myQueueStruct;
|
||||
extern QueueFromStruct* filesQueue;
|
||||
|
||||
//=======проверка очереди из структур=================
|
||||
// myQueueStruct = new QueueFromStruct;
|
||||
@@ -39,3 +42,5 @@ extern QueueFromStruct* myQueueStruct;
|
||||
// Serial.println(myQueueStruct->front().myword);
|
||||
// Serial.println(myQueueStruct->front().myword);
|
||||
// Serial.println(myQueueStruct->front().myword);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Global.h"
|
||||
#include "classes/QueueFromStruct.h"
|
||||
|
||||
class SendJson;
|
||||
|
||||
@@ -8,7 +9,7 @@ class SendJson {
|
||||
SendJson();
|
||||
~SendJson();
|
||||
|
||||
void sendFile(String path, uint8_t num);
|
||||
void addFileToQueue(String path, uint8_t num);
|
||||
|
||||
void loop();
|
||||
|
||||
@@ -16,12 +17,13 @@ class SendJson {
|
||||
|
||||
void sendMqtt(String& jsonArrayElement);
|
||||
|
||||
uint8_t _num;
|
||||
QueueItems myItem;
|
||||
|
||||
private:
|
||||
File file;
|
||||
String _path;
|
||||
uint8_t _num;
|
||||
bool sendingInProgress = false;
|
||||
};
|
||||
|
||||
extern SendJson* sendConfigJson;
|
||||
extern SendJson* sendWigdetsJson;
|
||||
extern SendJson* sendJsonFiles;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Global.h"
|
||||
#ifdef QUEUE_FROM_CHAR
|
||||
|
||||
#define MAX_COMMAND_LENGTH 16
|
||||
#define BUFFER 128
|
||||
@@ -25,7 +26,7 @@ class QueueFromChar {
|
||||
int commandCount = 0;
|
||||
};
|
||||
|
||||
extern QueueFromChar* myBuf;
|
||||
// extern QueueFromChar* myBuf;
|
||||
|
||||
//========проверка очереди=====================
|
||||
// myBuf = new QueueFromChar;
|
||||
@@ -37,3 +38,5 @@ extern QueueFromChar* myBuf;
|
||||
// myBuf->getLastCommand();
|
||||
// myBuf->getLastCommand();
|
||||
// myBuf->printCommands();
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "classes/QueueInst.h"
|
||||
#include "Global.h"
|
||||
#ifdef QUEUE_FROM_INST
|
||||
#include "classes/QueueInst.h"
|
||||
#include <queue>
|
||||
#include <iostream>
|
||||
|
||||
@@ -21,4 +22,5 @@ class QueueFromInstance {
|
||||
queue<QueueInstance> queue1;
|
||||
};
|
||||
|
||||
extern QueueFromInstance* myQueue;
|
||||
// extern QueueFromInstance* myQueue;
|
||||
#endif
|
||||
Reference in New Issue
Block a user