summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-17 22:55:24 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-17 22:55:24 +0200
commita840a9ea5548044c1901f5d4008aaa00553f99d7 (patch)
treee8b5165628bcc7f18c8c03eab3c04b9fcebdaa2c /src
parent63041cc39d965f8309927663211a3dc4bf975651 (diff)
parentdd17942259cf0cbe834f504128d522c93020ea84 (diff)
downloadqtserialport-a840a9ea5548044c1901f5d4008aaa00553f99d7.tar.gz
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I3c5b0052f5645ead630e33bce46b360fa0135061
Diffstat (limited to 'src')
-rw-r--r--src/serialport/qserialport.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp
index 532c149..b2b6a94 100644
--- a/src/serialport/qserialport.cpp
+++ b/src/serialport/qserialport.cpp
@@ -157,6 +157,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(),
@@ -175,7 +177,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: