From 39d79e16577331f2a8f84df2f63d28e2f03a1ca4 Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 23 Feb 2017 20:53:55 +0300 Subject: Doc: Describe limitations to use of QSP::setRequestToSend() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The limitations were introduced by the commit 56c001b, but were not documented. Change-Id: I5e44ab78e2e5cce2477ebc1f83280fa8c22e0ef6 Reviewed-by: Topi Reiniƶ --- src/serialport/qserialport.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/serialport/qserialport.cpp') diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index 81beb2d..8140deb 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -956,6 +956,10 @@ bool QSerialPort::isDataTerminalReady() property; otherwise \c false is returned and the error code is set to NotOpenError. + \note An attempt to control the RTS signal in the HardwareControl mode + will fail with error code set to UnsupportedOperationError, because + the signal is automatically controlled by the driver. + \sa pinoutSignals() */ bool QSerialPort::setRequestToSend(bool set) -- cgit v1.2.1 From e5dfb098638628b0215e11791bce372a656af390 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Fri, 21 Apr 2017 19:31:58 +0300 Subject: Fix bytesToWrite() We should not add the size of the internal write buffer here because QIODevice::bytesToWrite() already checks it. Also, take into account the size of 'writeChunkBuffer' on Windows. Change-Id: I87dfcb4dd1cd9d2bbb6f82a084d79fb4db9323d8 Reviewed-by: Thiago Macieira --- src/serialport/qserialport.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/serialport/qserialport.cpp') diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index 8140deb..5534bb8 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -1283,8 +1283,11 @@ qint64 QSerialPort::bytesAvailable() const */ qint64 QSerialPort::bytesToWrite() const { - Q_D(const QSerialPort); - return QIODevice::bytesToWrite() + d->writeBuffer.size(); + qint64 pendingBytes = QIODevice::bytesToWrite(); +#if defined(Q_OS_WIN32) + pendingBytes += d_func()->writeChunkBuffer.size(); +#endif + return pendingBytes; } /*! -- cgit v1.2.1