diff options
author | Chris Liechti <cliechti@gmx.net> | 2016-01-21 23:57:02 +0100 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2016-01-21 23:57:02 +0100 |
commit | 4cf6539532e2c87b8bb1f70c4d8d74916ee65734 (patch) | |
tree | 4529630b564aad497b0af5abdf151bf0accf737d /serial/serialwin32.py | |
parent | 78143f97bf9b499a95736da36ad762e882f05a37 (diff) | |
download | pyserial-git-4cf6539532e2c87b8bb1f70c4d8d74916ee65734.tar.gz |
fixes for RTS/DTR handling on open (#59)
- internal RTS/DTR state defaults to None
- serialwin32 and serialcli platforms override that to True (as before)
- serialposix leaves it unset and therefore does not touch RTS/DTR on open
(as it was in pySerial 2.7 and before)
Diffstat (limited to 'serial/serialwin32.py')
-rw-r--r-- | serial/serialwin32.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/serial/serialwin32.py b/serial/serialwin32.py index 658f13f..9e300e1 100644 --- a/serial/serialwin32.py +++ b/serial/serialwin32.py @@ -39,6 +39,11 @@ class Serial(SerialBase): raise SerialException("Port must be configured before it can be used.") if self.is_open: raise SerialException("Port is already open.") + # if RTS and/or DTR are not set before open, they default to True + if self._rts_state is None: + self._rts_state = True + if self._dtr_state is None: + self._dtr_state = True # the "\\.\COMx" format is required for devices other than COM1-COM8 # not all versions of windows seem to support this properly # so that the first few ports are used with the DOS device name |