diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2002-04-08 22:39:53 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2002-04-08 22:39:53 +0000 |
commit | d47436966a93cdb2c7206d5f65f2a0fe57a92878 (patch) | |
tree | e1d5d4afca6272d2cc0cf22ce87674f2b67f8fc9 | |
parent | fc9eb38aeee0e9505d98d7fea564ca5b7aa0e6d8 (diff) | |
download | pyserial-git-d47436966a93cdb2c7206d5f65f2a0fe57a92878.tar.gz |
added alternative way to enable/disable rts/cts handshake
-rw-r--r-- | pyserial/serial/serialposix.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pyserial/serial/serialposix.py b/pyserial/serial/serialposix.py index e1a0286..ddedcac 100644 --- a/pyserial/serial/serialposix.py +++ b/pyserial/serial/serialposix.py @@ -12,7 +12,7 @@ import sys, os, fcntl, termios, struct, string, select import serialutil -VERSION = string.split("$Revision: 1.4 $")[1] #extract CVS version +VERSION = string.split("$Revision: 1.5 $")[1] #extract CVS version PARITY_NONE, PARITY_EVEN, PARITY_ODD = range(3) STOPBITS_ONE, STOPBITS_TWO = (1, 2) @@ -231,6 +231,12 @@ class Serial(serialutil.FileLike): self.cflag = self.cflag | (TERMIOS.CRTSCTS) else: self.cflag = self.cflag & ~(TERMIOS.CRTSCTS) + elif hasattr(TERMIOS, 'CNEW_RTSCTS'): #try it with alternate constant name + self.cflag = self.cflag | (TERMIOS.CNEW_RTSCTS) + else: + self.cflag = self.cflag & ~(TERMIOS.CNEW_RTSCTS) + #XXX should there be a warning if setting up rtscts (and xonxoff etc) fails?? + #buffer #vmin "minimal number of characters to be read. = for non blocking" if vmin<0 or vmin>255: |