diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-21 08:34:14 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-09-21 08:34:14 +0200 |
commit | 66be7f7263e6d0e3a788dbdbb90e80ccc82851f6 (patch) | |
tree | 1f106474e8a42828da2458d04b409a4322187cbe /src | |
parent | 2edbb15471b92a7b9fb84db8aca0feeb8081b167 (diff) | |
parent | 0e79f14e56eb43abcb903d5ece41221f6032ef26 (diff) | |
download | qtserialport-66be7f7263e6d0e3a788dbdbb90e80ccc82851f6.tar.gz |
Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: Ib1ba5b90b0e3f911c00eb19e19ac2c92ca363ab8
Diffstat (limited to 'src')
-rw-r--r-- | src/serialport/qserialport.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index e62cf69..d23e3b6 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -158,6 +158,8 @@ void QSerialPortPrivate::setError(const QSerialPortErrorInfo &errorInfo) \note The serial port is always opened with exclusive access (that is, no other process or thread can access an already opened serial port). + Use the close() method to close the port and cancel the I/O operations. + Having successfully opened, QSerialPort tries to determine the current configuration of the port and initializes itself. You can reconfigure the port to the desired setting using the setBaudRate(), setDataBits(), @@ -176,7 +178,19 @@ void QSerialPortPrivate::setError(const QSerialPortErrorInfo &errorInfo) QSerialPort's internal read buffer. You can limit the size of the read buffer using setReadBufferSize(). - Use the close() method to close the port and cancel the I/O operations. + QSerialPort provides a set of functions that suspend the + calling thread until certain signals are emitted. These functions + can be used to implement blocking serial ports: + + \list + + \li waitForReadyRead() blocks calls until new data is available for + reading. + + \li waitForBytesWritten() blocks calls until one payload of data has + been written to the serial port. + + \endlist See the following example: |