diff options
author | Laszlo Papp <lpapp@kde.org> | 2013-05-05 21:03:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-06 10:06:30 +0200 |
commit | 5abd6a5afd5f1429df59b3d2b373b6dfad8070c2 (patch) | |
tree | b19b239dcdd3582545c93d9eb704f8d3d439c9e7 | |
parent | 494c616951d41f2f394a7157f8970e14096f41b4 (diff) | |
download | qtserialport-5abd6a5afd5f1429df59b3d2b373b6dfad8070c2.tar.gz |
Update the documentation and internal setBreakEnabled API
The change 0add3b934b8405fc5b65efeba9f05cc1dc353e64 changed the API, and we had
a compromise in there to get the API changes in as soon as possible. This change
tries to address the suggested documentation and internal API changes.
Only tested on Linux with Qt 4.8.4 and Qt 5.1, so it might break on other
platforms.
Change-Id: I153e5a35d76beb26e04dbabf184bc9b90ef4b70b
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
-rw-r--r-- | src/serialport/qserialport.cpp | 17 | ||||
-rw-r--r-- | src/serialport/qserialport_symbian.cpp | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_symbian_p.h | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_unix_p.h | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_win.cpp | 6 | ||||
-rw-r--r-- | src/serialport/qserialport_win_p.h | 2 |
7 files changed, 11 insertions, 22 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index b86b382..2d0d582 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -1160,7 +1160,7 @@ bool QSerialPort::waitForBytesWritten(int msecs) If the duration is non zero then zero bits are transmitted within a certain period of time depending on the implementation. - \sa setBreak(), clearBreak() + \sa setBreakEnabled() */ bool QSerialPort::sendBreak(int duration) { @@ -1174,12 +1174,12 @@ bool QSerialPort::sendBreak(int duration) If \a set is true then enables the break transmission; otherwise disables. - \sa clearBreak(), sendBreak() + \sa sendBreak() */ bool QSerialPort::setBreakEnabled(bool set) { Q_D(QSerialPort); - return d->setBreak(set); + return d->setBreakEnabled(set); } /*! @@ -1222,17 +1222,6 @@ void QSerialPort::setError(QSerialPort::SerialPortError serialPortError, const Q emit error(serialPortError); } -/*! - \fn bool QSerialPort::clearBreak(bool clear) - - Controls the signal break, depending on the flag \a clear. - If successful, returns true; otherwise returns false. - - If clear is false then enables the break transmission; otherwise disables. - - \sa setBreak(), sendBreak() -*/ - #include "moc_qserialport.cpp" QT_END_NAMESPACE diff --git a/src/serialport/qserialport_symbian.cpp b/src/serialport/qserialport_symbian.cpp index bbe56f3..2bba5a4 100644 --- a/src/serialport/qserialport_symbian.cpp +++ b/src/serialport/qserialport_symbian.cpp @@ -229,7 +229,7 @@ bool QSerialPortPrivate::sendBreak(int duration) return false; } -bool QSerialPortPrivate::setBreak(bool set) +bool QSerialPortPrivate::setBreakEnabled(bool set) { // TODO: Implement me return false; diff --git a/src/serialport/qserialport_symbian_p.h b/src/serialport/qserialport_symbian_p.h index 3601769..7f9eadd 100644 --- a/src/serialport/qserialport_symbian_p.h +++ b/src/serialport/qserialport_symbian_p.h @@ -65,7 +65,7 @@ public: bool clear(QSerialPort::Directions dir); bool sendBreak(int duration); - bool setBreak(bool set); + bool setBreakEnabled(bool set); qint64 systemInputQueueSize () const; qint64 systemOutputQueueSize () const; diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index f16eccc..2f6c8cc 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -336,7 +336,7 @@ bool QSerialPortPrivate::sendBreak(int duration) return ::tcsendbreak(descriptor, duration) != -1; } -bool QSerialPortPrivate::setBreak(bool set) +bool QSerialPortPrivate::setBreakEnabled(bool set) { return ::ioctl(descriptor, set ? TIOCSBRK : TIOCCBRK) != -1; } diff --git a/src/serialport/qserialport_unix_p.h b/src/serialport/qserialport_unix_p.h index 98ed7b0..ce70c24 100644 --- a/src/serialport/qserialport_unix_p.h +++ b/src/serialport/qserialport_unix_p.h @@ -72,7 +72,7 @@ public: bool clear(QSerialPort::Directions dir); bool sendBreak(int duration); - bool setBreak(bool set); + bool setBreakEnabled(bool set); qint64 systemInputQueueSize () const; qint64 systemOutputQueueSize () const; diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index d062583..bbc3e8c 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -376,15 +376,15 @@ bool QSerialPortPrivate::clear(QSerialPort::Directions dir) bool QSerialPortPrivate::sendBreak(int duration) { // FIXME: - if (setBreak(true)) { + if (setBreakEnabled(true)) { ::Sleep(duration); - if (setBreak(false)) + if (setBreakEnabled(false)) return true; } return false; } -bool QSerialPortPrivate::setBreak(bool set) +bool QSerialPortPrivate::setBreakEnabled(bool set) { if (set) return ::SetCommBreak(descriptor); diff --git a/src/serialport/qserialport_win_p.h b/src/serialport/qserialport_win_p.h index d058e52..a59ea9a 100644 --- a/src/serialport/qserialport_win_p.h +++ b/src/serialport/qserialport_win_p.h @@ -78,7 +78,7 @@ public: bool clear(QSerialPort::Directions dir); bool sendBreak(int duration); - bool setBreak(bool set); + bool setBreakEnabled(bool set); qint64 systemInputQueueSize () const; qint64 systemOutputQueueSize () const; |