summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2013-03-20 03:27:58 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 15:06:09 +0200
commit0f52055ff79781af865dc38d7ee7ccb2b539cda2 (patch)
tree0e7fc8fce9af2fa00a961e0069ddecf10c544600
parente71f0601b840ccbcbf3c56190628b2ed05ce3a18 (diff)
downloadqtserialport-0f52055ff79781af865dc38d7ee7ccb2b539cda2.tar.gz
Add support for BSD4 baud rates, i.e. not Unix compatible
1) These baud rates were revealed for BSD 4 based operating systems. The relevant Qt macro might be added in the future once the grouping is fixed for all the baudrates. As for the time being, no other UNIX operating system has support for this that that is being awared of, other than BSDs, so that may result an easily maintainable code. 2) For future reference, it may be groupped separately from the "truly standard rates" as they are not yet present on Linux (and perhaps other Unix variants) and so forth. Therefore, it might result a simpler maintainable and more compact code snippet. 3) It is unknown if other UNIX variants add support for these in the future, but based on the last few decades, probably not any soon. 4) See the following headers for further details about the BSD, Mac and so forth termios.h content: OpenBSD: http://fxr.watson.org/fxr/source/sys/termios.h?v=OPENBSD#L228 FreeBSD: http://svnweb.freebsd.org/base/head/sys/sys/_termios.h?view=markup Apple: http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/sys/termios.h 5) The following wikipedia page can also serve a good basis for checking what the BSD 4 OS type includes for future reference if needed. http://en.wikipedia.org/wiki/Berkeley_Software_Distribution#4.4BSD_and_descendants 6) The macros may be necessary in the future as a user might define the baudrate on his own to get this right (i.e. with Qt4), but this can lead to confusion and errors as the kernel will actually not support it. This remains to be seen. 7) Another change follows this one fixing the grouping for the baud rates properly. 8) Thank you to Israel Lins Albuquerque for bringing up the topic on Gerrit. Change-Id: I04afe63f956f4a03dc45a81c5431110b8754127d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
-rw-r--r--src/serialport/qserialport_unix.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index be0467b..6a5a5c2 100644
--- a/src/serialport/qserialport_unix.cpp
+++ b/src/serialport/qserialport_unix.cpp
@@ -1279,14 +1279,26 @@ static const BaudRateMap createStandardBaudRateMap()
baudRateMap.insert(4800, B4800);
#endif
+#ifdef B7200
+ baudRateMap.insert(7200, B7200);
+#endif
+
#ifdef B9600
baudRateMap.insert(9600, B9600);
#endif
+#ifdef B14400
+ baudRateMap.insert(14400, B14400);
+#endif
+
#ifdef B19200
baudRateMap.insert(19200, B19200);
#endif
+#ifdef B28800
+ baudRateMap.insert(28800, B28800);
+#endif
+
#ifdef B38400
baudRateMap.insert(38400, B38400);
#endif
@@ -1295,6 +1307,10 @@ static const BaudRateMap createStandardBaudRateMap()
baudRateMap.insert(57600, B57600);
#endif
+#ifdef B76800
+ baudRateMap.insert(76800, B76800);
+#endif
+
#ifdef B115200
baudRateMap.insert(115200, B115200);
#endif