diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2016-07-30 14:45:35 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2016-08-05 09:56:32 +0000 |
commit | b0e3e7469cf5249bb395d044c5344bbe88884553 (patch) | |
tree | ab9860814fe9fee5c2409c8a0ac811b773c452c3 /src/serialport | |
parent | 133dbd59fb04974149d2140b267fce91a7cfd4a2 (diff) | |
download | qtserialport-b0e3e7469cf5249bb395d044c5344bbe88884553.tar.gz |
Add mention of QSP::waitForX() functions in documentation
... otherwise the snippet with the blocking reading does not
make sense logically.
Change-Id: I5a037e7c44f50e57a1c48ab37764f9e7367a6dec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/serialport')
-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 8b4449b..ff5789d 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -154,6 +154,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(), @@ -172,7 +174,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: |