将测试程序:lincom串口例子编译后移植到开发板,出现无法接收十六进制 解决方法:修改工程内serialport.cpp QByteArray SerialPort::read() { mutex_r.lock(); QByteArray retByteArray; if(rev_buf->isEmpty()) { retByteArray.append("aaa"); retByteArray.clear(); }else { retByteArray.append(rev_buf->data()); rev_buf->clear(); } mutex_r.unlock(); return retByteArray; } 修改为: QByteArray SerialPort::read() { mutex_r.lock(); QByteArray retByteArray; if(rev_buf->isEmpty()) { retByteArray.append("aaa"); retByteArray.clear(); }else { retByteArray.append(*rev_buf); rev_buf->clear(); } mutex_r.unlock(); return retByteArray; } |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-23 23:03
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.