diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/serialport/qserialport.cpp | 11 | ||||
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_win.cpp | 4 | ||||
-rw-r--r-- | src/serialport/qserialportinfo.cpp | 3 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index 4f9d180..7853f1a 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) @@ -1278,8 +1282,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; } /*! diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index 544658c..4941a86 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -779,7 +779,7 @@ bool QSerialPortPrivate::readNotification() if (readBufferMaxSize && bytesToRead > (readBufferMaxSize - buffer.size())) { bytesToRead = readBufferMaxSize - buffer.size(); - if (bytesToRead == 0) { + if (bytesToRead <= 0) { // Buffer is full. User must read data from the buffer // before we can read more from the port. setReadNotificationEnabled(false); diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index d6a1d13..7ae40d9 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -537,11 +537,11 @@ bool QSerialPortPrivate::startAsyncRead() if (readStarted) return true; - DWORD bytesToRead = QSERIALPORT_BUFFERSIZE; + qint64 bytesToRead = QSERIALPORT_BUFFERSIZE; if (readBufferMaxSize && bytesToRead > (readBufferMaxSize - buffer.size())) { bytesToRead = readBufferMaxSize - buffer.size(); - if (bytesToRead == 0) { + if (bytesToRead <= 0) { // Buffer is full. User must read data from the buffer // before we can read more from the port. return false; diff --git a/src/serialport/qserialportinfo.cpp b/src/serialport/qserialportinfo.cpp index 2547e01..f49051d 100644 --- a/src/serialport/qserialportinfo.cpp +++ b/src/serialport/qserialportinfo.cpp @@ -122,8 +122,7 @@ QSerialPortInfo::~QSerialPortInfo() { } -/*! \fn void QSerialPortInfo::swap(QSerialPortInfo &other) - +/*! Swaps QSerialPortInfo \a other with this QSerialPortInfo. This operation is very fast and never fails. */ |