c++ - how does readyRead() work in Qt? -
This is my first question on this website!
I have a problem reading a dump from a comm port, I send a complete message from another com port, and when I get it from Qt, it is always cut in many subpages .
Zero SerialPortReader :: init () {connect (m_serialPort, SIGNAL (readyRead ()), this, slot (readData ())); } Zero SerialPortReader :: readData () {// m_serialPort-> Waiter Reid (200); QByteArray Byte = m_serialPort-> ReadAll (); QDebug () & lt; & Lt; Bytearray; If (Baitarekstartsvith (Sof) and amp; Baitareyreds (Aofaiels) and Baitareaijh () & gt; = MIN_SIZE_DATA) {Dikoddeta (Baitare. Constdeta ()); } And {qDebug () & lt; & Lt; "LIB SWCom: Invalid Tram!"; }}
Sent messages are 25 or 27 bytes long, if I use a hybrid to read or read them, then I have no problem. If I use 2 emulated serial port to use COM, then I do not have this problem ... It only happens with the QT reading system and 2 physical COM portes ...
It seems that I'm not ready when the Reed Signals are extinguished ...
I am very confused, thanks in advance for your help!
Comments
Post a Comment