summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-07-02 17:51:03 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-07-08 07:29:26 +0000
commit1eaa42c99d8442a40718b8560903b0bfeb401a0e (patch)
treef93c691ec4e869faa21cd902802fcb0e1f7fdde6
parent35aa1413c8c4878570786897a0df936fb36b4a17 (diff)
downloadqtserialport-1eaa42c99d8442a40718b8560903b0bfeb401a0e.tar.gz
Fix opening of Exar VCP on Windows
The method QSPP::initialize() calls the GetCommState() function, which returns with the DCB.BaudRate field being 0. The subsequent call of SetCommState() would fail because of that. So, we need set DCB.BaudRate to any non-zero value (for example the input baud rate, which defaults to 9600) before calling the SetCommState() function. Task-number: QTBUG-46993 Change-Id: I809246b13899733f9e0bd12b3667b23c0e43b00b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--src/serialport/qserialport_win.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp
index 57b7096..761a26e 100644
--- a/src/serialport/qserialport_win.cpp
+++ b/src/serialport/qserialport_win.cpp
@@ -671,6 +671,8 @@ inline bool QSerialPortPrivate::initialize()
if (currentDcb.fDtrControl == DTR_CONTROL_HANDSHAKE)
currentDcb.fDtrControl = DTR_CONTROL_DISABLE;
+ currentDcb.BaudRate = inputBaudRate;
+
if (!updateDcb())
return false;