32 lines
606 B
C++
32 lines
606 B
C++
//
|
|
// 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();
|
|
|
|
bool openCom(QSerialPort *serial, const QString &com, int baud);
|
|
bool closeCom(QSerialPort *serial);
|
|
|
|
private:
|
|
QSerialPort *serial_{};
|
|
MQueue<QString> *queue_{};
|
|
private slots:
|
|
// [[deprecated("建议自行定义读取函数")]] void readCom();
|
|
|
|
};
|
|
|
|
|
|
#endif //TRAIN_RFID_COMDETECT_H
|