summaryrefslogtreecommitdiffstats
path: root/src/serialport/qserialport_unix_p.h
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@kdab.com>2014-04-25 19:20:56 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-14 15:43:55 +0200
commitd913488a75acabff3497b5f0b6c5fa29158fbd63 (patch)
tree649398382c582e93ca10fe7213e557411b49373f /src/serialport/qserialport_unix_p.h
parent4b34f99e837b8fff9e690e63f80da76805a4686f (diff)
Refactor QSerialPortPrivate::setBaudRate()
Split platform specific functions into their own setCustomBaudRate() methods to improve readability. As a side-effect, remove isCustomBaudRateSupported flag. Change-Id: Ia26d5472219756fbf186c78aa049bba72966d7b5 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Diffstat (limited to 'src/serialport/qserialport_unix_p.h')
-rw-r--r--src/serialport/qserialport_unix_p.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/serialport/qserialport_unix_p.h b/src/serialport/qserialport_unix_p.h
index 97a88c00..0691cf17 100644
--- a/src/serialport/qserialport_unix_p.h
+++ b/src/serialport/qserialport_unix_p.h
@@ -136,12 +136,7 @@ public:
struct termios currentTermios;
struct termios restoredTermios;
-#ifdef Q_OS_LINUX
- struct serial_struct currentSerialInfo;
- struct serial_struct restoredSerialInfo;
-#endif
int descriptor;
- bool isCustomBaudRateSupported;
QSocketNotifier *readNotifier;
QSocketNotifier *writeNotifier;
@@ -161,6 +156,10 @@ public:
private:
bool updateTermios();
+ bool setCustomBaudRate(qint32 baudRate,
+ QSerialPort::Directions directions);
+ bool setStandardBaudRate(qint32 baudRate,
+ QSerialPort::Directions directions);
QSerialPort::SerialPortError decodeSystemError() const;