Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.10, 5.11, 5.12.4, 5.13.0
-
None
-
-
4ff9993d9f2e991f2da1885a694d4f3a61c9af73
Description
We upgraded from Qt 5.9.0 to Qt 5.13.0 a few weeks ago.
We have been getting weird behavior during communication of suddenly not receiving any more readyRead() notifications until the port is closed and opened again.
After spending a few hours tracking down changes in QSerialPort between versions, the culprit is the removal of the following code from QSerialPort::readData(char *data, qint64 maxSize):
#if defined(Q_OS_WIN32) // We need try to start async reading to read a remainder from a driver's queue // in case we have a limited read buffer size. Because the read notification can // be stalled since Windows do not re-triggered an EV_RXCHAR event if a driver's // buffer has a remainder of data ready to read until a new data will be received. Q_D(QSerialPort); if (d->readBufferMaxSize || d->flowControl == QSerialPort::HardwareControl) d->startAsyncRead(); #elif defined(Q_OS_UNIX) // We need try to re-trigger the read notification to read a remainder from a // driver's queue in case we have a limited read buffer size. Q_D(QSerialPort); if (d->readBufferMaxSize && !d->isReadNotificationEnabled()) d->setReadNotificationEnabled(true); #endif
Having readBufferMaxSize == 0 and NoFlowControl, calling startAsyncRead() apparently causes the problem.
Please revert this change.
Attachments
Issue Links
- is required for
-
QTBUG-93865 Fix regressions in QtSerialPort after porting to alertable I/O functions on Windows
- Closed