summaryrefslogtreecommitdiffstats
path: root/examples/serialport
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2014-01-28 16:22:33 +0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-11 08:16:42 +0100
commita93fc13093ce6c75f23f8edcf323a1244891f14b (patch)
treebd4876deac5fe396dc870294b3599dce8145a0ec /examples/serialport
parentf85c5fc1e25dd16dc625d15036d2dbc9498e8b76 (diff)
Keep the DTR line state at changing of DCB properties
Updating of the DCB structure (in case of setup of some properties through setXX() methods) leads to reset of a status of the DTR line to an initial state. For example, after opening of port the DTR state was "high", further the call of method setDataTerminalReady(false) will drop the DTR to "low" state. But if now to change any properties of the device (e.g. to setup a new baud rate), the DTR will again be set to "high". The reason of this behavior is the fDtrControl flag of DCB structure: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363214%28v=vs.85%29.aspx To control of DTR is used the EscapeCommFunction() function which has no relation to the DCB structure. Therefore any re-initialization of the DCB discard the results of the EscapeCommFunction() function in case a state of the fDtrControl flag not equal to the real DTR state. Solution is change of a fDtrControl flag after successfully call of the EscapeCommFunction() function. Then further change of any property will be with a correct DCB. Besides, it is necessary to drop the flag DTR_CONTROL_HANDSHAKE at opening of device. Because in this mode the manual control of the DTR line is forbidden. Thanks to Dr. Alexander W. Lenhardt Task-number: QTBUG-36490 Change-Id: I14b040761f7e28108db87e667eb76f559be436cb Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'examples/serialport')
0 files changed, 0 insertions, 0 deletions