//
// Created by Mr.V on 2024/2/19.
//

#ifndef TRAIN_RFID_COMDETECT_H
#define TRAIN_RFID_COMDETECT_H

#include <QObject>
#include <QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QtSerialPort/QSerialPort>
#include "MQueue.h"

class ComDetect {
public:
    ComDetect();
    ~ComDetect();

    QSerialPort* openCom(const QString &com, int baud);
    bool closeCom();

    bool writeCom(const QString &str);

private:
    QSerialPort *serial_{};
    MQueue<QString> *queue_{};
private slots:
    [[deprecated("建议自行定义读取函数")]] void readCom();

};


#endif //TRAIN_RFID_COMDETECT_H
