#ifndef DATACOLLECTORPUB_H
#define DATACOLLECTORPUB_H

#include <QThread>
#include <QDateTime>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonParseError>

class DevData{
public:
    explicit DevData(QString t="",QByteArray d=""){
        topic = t;
        data = d;
    }
    QString topic;
    QByteArray data;
};


class DataCollectorPub : public QThread
{
    Q_OBJECT
public:
    explicit DataCollectorPub(QObject *parent = nullptr);
    void run();
    void stop();
    void devMessage(DevData dev);


signals:
    void publishDevData(QByteArray data);
    void dataListLog(QString msg);

public slots:

private:
    bool keep;
    QList<DevData> devMsgList;
};

#endif // DATACOLLECTORPUB_H
