diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/serialport/qserialport.cpp | 17 | ||||
-rw-r--r-- | src/serialport/qserialport.h | 4 | ||||
-rw-r--r-- | src/serialport/qserialport_p.h | 2 |
4 files changed, 16 insertions, 9 deletions
diff --git a/.qmake.conf b/.qmake.conf index a2a0d41..aefa1e7 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.7.1 +MODULE_VERSION = 5.8.0 diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index 532c149..02a9422 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -88,7 +88,6 @@ QSerialPortErrorInfo::QSerialPortErrorInfo(QSerialPort::SerialPortError newError QSerialPortPrivate::QSerialPortPrivate() : readBufferMaxSize(0) - , writeBuffer(InitialBufferSize) , error(QSerialPort::NoError) , inputBaudRate(9600) , outputBaudRate(9600) @@ -123,6 +122,7 @@ QSerialPortPrivate::QSerialPortPrivate() , writeSequenceStarted(false) #endif { + writeBufferChunkSize = InitialBufferSize; } void QSerialPortPrivate::setError(const QSerialPortErrorInfo &errorInfo) @@ -1269,10 +1269,11 @@ bool QSerialPort::canReadLine() const This function blocks until new data is available for reading and the \l{QIODevice::}{readyRead()} signal has been emitted. The function - will timeout after \a msecs milliseconds. + will timeout after \a msecs milliseconds; the default timeout is + 30000 milliseconds. - The function returns true if the readyRead() signal is emitted and - there is new data available for reading; otherwise it returns false + The function returns \c true if the readyRead() signal is emitted and + there is new data available for reading; otherwise it returns \c false (if an error occurred or the operation timed out). \sa waitForBytesWritten() @@ -1297,6 +1298,14 @@ bool QSerialPort::waitForReadyRead(int msecs) /*! \reimp + + This function blocks until at least one byte has been written to the serial + port and the \l{QIODevice::}{bytesWritten()} signal has been emitted. The + function will timeout after \a msecs milliseconds; the default timeout is + 30000 milliseconds. + + The function returns \c true if the bytesWritten() signal is emitted; otherwise + it returns \c false (if an error occurred or the operation timed out). */ bool QSerialPort::waitForBytesWritten(int msecs) { diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h index 3289ca1..0a7ab0f 100644 --- a/src/serialport/qserialport.h +++ b/src/serialport/qserialport.h @@ -262,8 +262,8 @@ public: qint64 bytesToWrite() const Q_DECL_OVERRIDE; bool canReadLine() const Q_DECL_OVERRIDE; - bool waitForReadyRead(int msecs) Q_DECL_OVERRIDE; - bool waitForBytesWritten(int msecs) Q_DECL_OVERRIDE; + bool waitForReadyRead(int msecs = 30000) Q_DECL_OVERRIDE; + bool waitForBytesWritten(int msecs = 30000) Q_DECL_OVERRIDE; #if QT_DEPRECATED_SINCE(5, 5) QT_DEPRECATED bool sendBreak(int duration = 0); diff --git a/src/serialport/qserialport_p.h b/src/serialport/qserialport_p.h index e240798..10fda34 100644 --- a/src/serialport/qserialport_p.h +++ b/src/serialport/qserialport_p.h @@ -55,7 +55,6 @@ #include "qserialport.h" -#include <private/qringbuffer_p.h> #include <private/qiodevice_p.h> #if defined(Q_OS_WIN32) @@ -169,7 +168,6 @@ public: static QList<qint32> standardBaudRates(); qint64 readBufferMaxSize; - QRingBuffer writeBuffer; QSerialPort::SerialPortError error; QString systemLocation; qint32 inputBaudRate; |