1 Star 0 Fork 1

冷月宫主/VirtualDtu

forked from yuyaowen/VirtualDtu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
serial.h 723 Bytes
一键复制 编辑 原始数据 按行查看 历史
yuyaowen 提交于 2021-01-29 14:46 . 修复无串口设备程序崩溃问题
#ifndef SERIAL_H
#define SERIAL_H
#include <QObject>
#include <QString>
#include <QStringList>
#include <QtSerialPort>
#include <QSerialPort>
#include <QByteArray>
class Serial : public QObject
{
Q_OBJECT
public:
Serial();
~Serial();
void portOpen(void);
void portClose(void);
void changeTo(QString portName);
QStringList serialPortList;
bool isHexDisplay = true;
bool isHexSend = true;
bool isSerialOpened = false;
int baudRate = 115200;
int dataBit = 8;
int checkBit = 0;
int stopBit = 1;
QByteArray comData;
QSerialPort *comPort = Q_NULLPTR;
private:
signals:
void readDone();
private slots:
void readSerial(void);
};
#endif // SERIAL_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/E_wsq/virtual-dtu.git
[email protected]:E_wsq/virtual-dtu.git
E_wsq
virtual-dtu
VirtualDtu
master

搜索帮助