From 1eaa42c99d8442a40718b8560903b0bfeb401a0e Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 2 Jul 2015 17:51:03 +0300 Subject: 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 Reviewed-by: Sergey Belyashov Reviewed-by: Denis Shienkov --- src/serialport/qserialport_win.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index 57b70966..761a26e0 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; -- cgit v1.2.3