summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2002-06-07 21:53:40 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2002-06-07 21:53:40 +0000
commitf281fde9663f17108b1324d4f1cc46e3131b1a79 (patch)
tree10561c2840f0667154dd3f6c4b32aacfe5c2e609
parent1e95baa3c8168a32ced63f10a73e6162bd360c47 (diff)
downloadpyserial-git-f281fde9663f17108b1324d4f1cc46e3131b1a79.tar.gz
removed TERMIOS.ECHOPRT for cygwin compatibility.
added port names for cygwin. thanks to Gregor Thalhammer
-rw-r--r--pyserial/serial/serialposix.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pyserial/serial/serialposix.py b/pyserial/serial/serialposix.py
index 522221b..cf77446 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.10 $")[1] #extract CVS version
+VERSION = string.split("$Revision: 1.11 $")[1] #extract CVS version
PARITY_NONE, PARITY_EVEN, PARITY_ODD = range(3)
STOPBITS_ONE, STOPBITS_TWO = (1, 2)
@@ -36,6 +36,10 @@ if plat[:5] == 'linux': #Linux (confirmed)
def device(port):
return '/dev/ttyS%d' % port
+elif plat == 'cygwin': #cywin/win32 (confirmed)
+ def device(port):
+ return '/dev/com%d' % port
+
elif plat == 'openbsd3': #BSD (confirmed)
def device(port):
return '/dev/ttyp%d' % port
@@ -176,7 +180,7 @@ class Serial(serialutil.FileLike):
#set up raw mode / no echo / binary
self.cflag = self.cflag | (TERMIOS.CLOCAL|TERMIOS.CREAD)
self.lflag = self.lflag & ~(TERMIOS.ICANON|TERMIOS.ECHO|TERMIOS.ECHOE|TERMIOS.ECHOK|TERMIOS.ECHONL|
- TERMIOS.ECHOCTL|TERMIOS.ECHOPRT|TERMIOS.ECHOKE|TERMIOS.ISIG|TERMIOS.IEXTEN)
+ TERMIOS.ECHOCTL|TERMIOS.ECHOKE|TERMIOS.ISIG|TERMIOS.IEXTEN) #|TERMIOS.ECHOPRT
self.oflag = self.oflag & ~(TERMIOS.OPOST)
if hasattr(TERMIOS, 'IUCLC'):
self.iflag = self.iflag & ~(TERMIOS.INLCR|TERMIOS.IGNCR|TERMIOS.ICRNL|TERMIOS.IUCLC|TERMIOS.IGNBRK)
@@ -399,5 +403,3 @@ if __name__ == '__main__':
print repr(s.read(5))
print s.inWaiting()
del s
-
-