Do not use call waiting with a "while", because of this, you're slow/freeze Qt event loop.
Use signals and slots.
To find out about the possibility of reading the first 15 bytes, for example, can after first emitted signal readyRead(), make to run QTimer, with wait timeout limit. Thus, after each emitting readyRead() to check the number of bytes available for reading bytesAVailable(), and if it is >= 15 then reset QTimer and read the data; if <15 then do nothing (wait for the next readyRead()). If worked signal from QTimer, then the limit has expired timeout - then do something.
Ie this approach the analysis and reading the input data will be executed asynchronously, as if with a delay in phase relative to their real receive.
So it must be done!




Reply With Quote
rocSerialDataReceive()
Bookmarks