#ifndef DATACOLLECTORSUB_H
#define DATACOLLECTORSUB_H

#include <QThread>
#include <qmqtt.h>
#include <QTimer>

class DataCollectorSub : public QThread
{
    Q_OBJECT
public:
    explicit DataCollectorSub(QObject *parent = nullptr);
    void run();

signals:
    void sendDevData(QString topic,QByteArray data);

public slots:
    void time_out();
    void onConnected();
    void onReceived(const QMQTT::Message &message);

private:
    QTimer *timer;
    QMQTT::Client *m_client;
};

#endif // DATACOLLECTORSUB_H
