diff options
Diffstat (limited to 'src/serialport/qserialport_unix.cpp')
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index 4df1fcba..4941a86d 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -763,13 +763,19 @@ bool QSerialPortPrivate::setFlowControl(QSerialPort::FlowControl flowControl) return setTermios(&tio); } +bool QSerialPortPrivate::startAsyncRead() +{ + setReadNotificationEnabled(true); + return true; +} + bool QSerialPortPrivate::readNotification() { Q_Q(QSerialPort); // Always buffered, read data from the port into the read buffer qint64 newBytes = buffer.size(); - qint64 bytesToRead = ReadChunkSize; + qint64 bytesToRead = QSERIALPORT_BUFFERSIZE; if (readBufferMaxSize && bytesToRead > (readBufferMaxSize - buffer.size())) { bytesToRead = readBufferMaxSize - buffer.size(); @@ -798,10 +804,6 @@ bool QSerialPortPrivate::readNotification() newBytes = buffer.size() - newBytes; - // If read buffer is full, disable the read port notifier. - if (readBufferMaxSize && buffer.size() == readBufferMaxSize) - setReadNotificationEnabled(false); - // only emit readyRead() when not recursing, and only if there is data available const bool hasData = newBytes > 0; |