21 | Qt5不能获取到串口的数据

1 前提

  • 面对的问题:通过Qt5.4调用串口工具,直接获取数据显示是空,换种思路从接收窗口中获取相应的数据,能正常获取

  • Qt 5.14.2

2 实现方法

2.1 第一种方式

          timer = new QTimer(this);
          timer->stop();             //关闭定时器
          QByteArray buf = buffer;   //读取缓冲区数据
          qDebug()<<"buf"

猜你喜欢

转载自blog.csdn.net/u013916029/article/details/130572367
21
21)