summaryrefslogtreecommitdiff
path: root/pyserial/serial
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2002-11-26 02:56:39 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2002-11-26 02:56:39 +0000
commit802165e5dc01a54139face06eea426b9506fa3c0 (patch)
treed769bb31a20f25a285b293f28eaf240b0258017d /pyserial/serial
parent8901aef33ca733297cf4b2c4aa5289983a80744f (diff)
downloadpyserial-git-802165e5dc01a54139face06eea426b9506fa3c0.tar.gz
RTS/CTS handling as sugested in Bug #635072
Diffstat (limited to 'pyserial/serial')
-rw-r--r--pyserial/serial/serialwin32.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/pyserial/serial/serialwin32.py b/pyserial/serial/serialwin32.py
index ec7e2ed..e225838 100644
--- a/pyserial/serial/serialwin32.py
+++ b/pyserial/serial/serialwin32.py
@@ -11,7 +11,7 @@ import win32con # constants.
import sys, string
import serialutil
-VERSION = string.split("$Revision: 1.15 $")[1] #extract CVS version
+VERSION = string.split("$Revision: 1.16 $")[1] #extract CVS version
PARITY_NONE, PARITY_EVEN, PARITY_ODD = range(3)
STOPBITS_ONE, STOPBITS_TWO = (1, 2)
@@ -234,22 +234,18 @@ class Serial(serialutil.FileLike):
def setRTS(self,level=1):
"""set terminal status line"""
if not self.hComPort: raise portNotOpenError
- comDCB = win32file.GetCommState(self.hComPort)
if level:
- comDCB.fRtsControl = win32file.RTS_CONTROL_ENABLE;
+ win32file.EscapeCommFunction(self.hComPort, win32file.SETRTS)
else:
- comDCB.fRtsControl = win32file.RTS_CONTROL_DISABLE;
- win32file.SetCommState(self.hComPort, comDCB)
+ win32file.EscapeCommFunction(self.hComPort, win32file.CLRRTS)
def setDTR(self,level=1):
"""set terminal status line"""
if not self.hComPort: raise portNotOpenError
- comDCB = win32file.GetCommState(self.hComPort)
if level:
- comDCB.fDtrControl = win32file.DTR_CONTROL_ENABLE;
+ win32file.EscapeCommFunction(self.hComPort, win32file.SETDTR)
else:
- comDCB.fDtrControl = win32file.DTR_CONTROL_DISABLE;
- win32file.SetCommState(self.hComPort, comDCB)
+ win32file.EscapeCommFunction(self.hComPort, win32file.CLRDTR)
def getCTS(self):
"""read terminal status line"""