QT的串口概述
Qt Serial Port 模块中只有两个类: QSerialPortInfo 和 QSerialPort。
QSerialPortInfo 类
作用:获取串口的信息
类包含如下:
QString portName() //串口名称,如 COM1、 COM2
QString description() //串口的文字描述
bool isNull() //串口是否为空,若返回值为 true,则这个串口无效
QString manufacturer() //制造商
quint16 productIdentifier() //产品 ID
QString serialNumber() //序列号
QSerialPort 类
作用:访问具体串口方法/值、也可以称为调用具体串口;
通过setPort()