mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
проверка
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
#define STANDARD_WEB_SERVER
|
||||
#define STANDARD_WEB_SOCKETS
|
||||
|
||||
//#define QUEUE_FROM_STR
|
||||
|
||||
//#define REST_FILE_OPERATIONS
|
||||
|
||||
#define MQTT_RECONNECT_INTERVAL 20000
|
||||
|
||||
46
include/classes/QueueFromStruct.h
Normal file
46
include/classes/QueueFromStruct.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
#include "Global.h"
|
||||
#ifdef QUEUE_FROM_STR
|
||||
#include <queue>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct QueueItems {
|
||||
String myword;
|
||||
uint8_t num;
|
||||
};
|
||||
|
||||
class QueueFromStruct;
|
||||
|
||||
class QueueFromStruct {
|
||||
public:
|
||||
QueueFromStruct();
|
||||
~QueueFromStruct();
|
||||
|
||||
void push(QueueItems word);
|
||||
void pop();
|
||||
QueueItems front();
|
||||
bool empty();
|
||||
|
||||
private:
|
||||
queue<QueueItems> queue1;
|
||||
QueueItems tmpItem;
|
||||
};
|
||||
|
||||
extern QueueFromStruct* filesQueue;
|
||||
|
||||
//=======проверка очереди из структур=================
|
||||
// myQueueStruct = new QueueFromStruct;
|
||||
// QueueItems myItem;
|
||||
// myItem.myword = "word1";
|
||||
// myQueueStruct->push(myItem);
|
||||
// myItem.myword = "word2";
|
||||
// myQueueStruct->push(myItem);
|
||||
// myItem.myword = "word3";
|
||||
// myQueueStruct->push(myItem);
|
||||
// Serial.println(myQueueStruct->front().myword);
|
||||
// Serial.println(myQueueStruct->front().myword);
|
||||
// Serial.println(myQueueStruct->front().myword);
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
#include "Global.h"
|
||||
#ifdef QUEUE_FROM_STR
|
||||
#include "classes/QueueFromStruct.h"
|
||||
|
||||
class SendJson;
|
||||
|
||||
@@ -8,7 +10,7 @@ class SendJson {
|
||||
SendJson();
|
||||
~SendJson();
|
||||
|
||||
void sendFile(String path, uint8_t num);
|
||||
void addFileToQueue(String path, uint8_t num);
|
||||
|
||||
void loop();
|
||||
|
||||
@@ -16,12 +18,14 @@ 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;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user