PyQt5, QByteArray slices return str, how to get bytes or int?
The closest match to my question is a Qt example, not a PyQt5 example. I am using a QByteArray in PyQt5 to receive packets of data over a QSerialPort. My system is real-time. The host and peripheral are not perfectly synchronized. I could get a partial data packet read in one timer cycle. So I have devised a data packet format which gives the payload length in byte 1, as an unsigned 8-bit integer. If I don't receive the expected number of bytes in one cycle, I know to keep reading on the next cycle. The payload also contains binary content, not ASCII. Today I was surprised to discover that QBy
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.