#ifndef DATACOLLECTORCORE_H
#define DATACOLLECTORCORE_H

#include <QObject>
#include <qmqtt.h>
#include "logthread.h"
#include "datacollectorsub.h"
#include "datacollectorpub.h"
#include "databasethread.h"

class DataCollectorCore : public QObject
{
    Q_OBJECT
public:
    explicit DataCollectorCore(QObject *parent = nullptr);
    ~DataCollectorCore();
    void start();

signals:

public slots:
    void dataListLog(QString log);
    void receiveDevData(QString topic,QByteArray data);
    void publishDevData(QByteArray data);
    void onConnected();

private:
    logThread *logthread;
    DatabaseThread *dbthread;
    DataCollectorSub *dataSub;
    DataCollectorPub *dataPub;
    quint16 mqttIdx;

    QMQTT::Client *m_client;
};

#endif // DATACOLLECTORCORE_H
