123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef MQTTPUB_H
- #define MQTTPUB_H
- #include <QThread>
- #include <QDateTime>
- #include <QJsonArray>
- #include <QJsonDocument>
- #include <QJsonObject>
- #include <QJsonValue>
- #include <QJsonParseError>
- #include <QVariantMap>
- class MqttData{
- public:
- explicit MqttData(QString t="",QByteArray d=""){
- topic = t;
- data = d;
- }
- QString topic;
- QByteArray data;
- };
- class MqttPub : public QThread
- {
- Q_OBJECT
- public:
- explicit MqttPub(QObject *parent = nullptr);
- void run();
- void stop();
- void devMessage(MqttData dev);
- signals:
- void mqttData(QString mqtt_msg);
- void dataListLog(QString msg);
- public slots:
- private:
- bool keep;
- QList<MqttData> mqttDataList;
- };
- #endif // MQTTPUB_H
|