#ifndef BTNSERIALTHREAD_H
#define BTNSERIALTHREAD_H

#include <QThread>
#include <QByteArray>
#include "btnserialtool.h"

class BtnSerialThread : public QThread
{
        Q_OBJECT
public:
    BtnSerialThread(QObject *parent = nullptr);
    ~BtnSerialThread(); // 声明析构函数
signals:
    void dataReceived(const QByteArray& data);
    void sendDataRequest(const QByteArray &data);
    void serialToolCreated();
    void destroySerialTool();
private slots:
    void handleReceivedData(const QByteArray &data);
    void onDestroySerialTool();
protected:
    void run() override;
private:
    BtnSerialTool *btnSerialTool;
};

#endif // BTNSERIALTHREAD_H
