突发奇想,想使用ChatGPT试试能不能写一个读写串口数据的demo,以下为测试结果:
#include <QCoreApplication>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
// 获取可用串口