Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
qextserialport使用类数据丢失的函数readdata从端口读取时发生
qextserialport
例如serialobj->bytesavailable返回 9 个字节,但从serialobj->readDatapic 微控制器只返回两个字符
serialobj->bytesavailable
serialobj->readData
从评论来看,您正在尝试将收到的字节打印到控制台。显然,您尝试打印的某些字节是不可打印的,并且不会产生视觉输出。
也许您想查看以十六进制为基数的字节值:
qDebug() << serialObj->readData().toHex();