简体   繁体   中英

qserialport data missing while reading from port but returns 9 bytes available

While reading from the port using the function readdata of qextserialport class data loss happens

For example serialobj->bytesavailable returns 9 bytes but while serialobj->readData returns only two characters from pic microcontroller

Judging by the comments, you're trying to print out the received bytes to the console. Obviously, some of the bytes you attempt to print out are not printable and produce no visual output.

Perhaps you want to see the values of the bytes in hexadecimal base:

qDebug() << serialObj->readData().toHex();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM