summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@kdab.com>2014-04-25 19:30:16 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-14 15:45:18 +0200
commitfa1feb5737ef275e1a81f5469161b2bfad7e3f7d (patch)
treec28770aee02762dc46a6bf5a048cc1b8b2c17e55
parentd913488a75acabff3497b5f0b6c5fa29158fbd63 (diff)
downloadqtserialport-fa1feb5737ef275e1a81f5469161b2bfad7e3f7d.tar.gz
QNX: Enable custom baud rate
Change-Id: Iec4124886514c5bdeae1cf00e3b2e9432a2c75ee Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
-rw-r--r--src/serialport/qserialport_unix.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index 50695fa..a00d0db 100644
--- a/src/serialport/qserialport_unix.cpp
+++ b/src/serialport/qserialport_unix.cpp
@@ -596,6 +596,17 @@ bool QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directi
return false;
}
+#elif defined (Q_OS_QNX)
+
+bool QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directions directions)
+{
+ // On QNX, the values of the 'Bxxxx' constants are set to 'xxxx' (i.e.
+ // B115200 is defined to '115200'), which means that literal values can be
+ // passed to cfsetispeed/cfsetospeed, including custom values, provided
+ // that the underlying hardware supports them.
+ return setStandardBaudRate(baudRate, directions);
+}
+
#else
bool QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directions directions)