Details
-
Suggestion
-
Resolution: Done
-
P4: Low
-
5.2.0
-
None
-
Windows 7; x64
VS2012 Ultimate
Description
Unfortunately (re)setting the DTR line state via setDataTerminalReady does not change the DCB for the Windows serial port object. The function only uses the EscapeCommFunction of Windows. Result is, for example, changing the serial port baud rate will (re)set DTR line to it's initial state, too. Unfortunately there are some serial devices available using the DTR line for internal reset.
A scenario where this might be pain in the a... is describerd here:
1.) clear DTR to let the device run.
2.) Send device command to make it work with higher baud rate.
3.) Set serial port to this higher baud rate.
4.) DTR is reset to it's initial state, device goes thru reset and works with it's initial baud rate.....
Would be good to add something like the following in future code releases:
if (set)
else
{ EscapeCommFunction(Win_Handle, CLRDTR); Win_CommConfig.dcb.fDtrControl = 0; }I didn't verify the behaviour under Linux or other OSs.
Any comments?
THX