summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2011-12-29 02:22:17 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2011-12-29 02:22:17 +0000
commit4265a410e3b8a6cd3fd0014a1a7570311cb4b159 (patch)
tree3c417bd2026e708c24655eaa47bd41953303d457
parent80064d7c97a0999f53c63a1a22c9d1435dc37970 (diff)
downloadpyserial-4265a410e3b8a6cd3fd0014a1a7570311cb4b159.tar.gz
update for BSD: list_ports and device function
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@447 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r--CHANGES.txt1
-rw-r--r--serial/serialposix.py8
-rw-r--r--serial/tools/list_ports_posix.py7
3 files changed, 8 insertions, 8 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 92995cb..b615759 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -445,6 +445,7 @@ Version 2.7 2012-nn-nn
Bugfixes (posix):
- [Patch 3462364] Fix: NameError: global name 'base' is not defined
+- list_ports and device() for BSD updated (Anders Langworthy)
Bugfixes (win32):
diff --git a/serial/serialposix.py b/serial/serialposix.py
index 4438a46..6f7bb47 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -103,10 +103,10 @@ elif plat == 'cygwin': # cygwin/win32 (confirmed)
baudrate_constants = {}
-elif plat == 'openbsd3': # BSD (confirmed)
+elif plat[:7] == 'openbsd': # OpenBSD
def device(port):
- return '/dev/ttyp%d' % port
+ return '/dev/cua%02d' % port
def set_special_baudrate(port, baudrate):
raise ValueError("sorry don't know how to handle non standard baud rate on this platform")
@@ -114,8 +114,7 @@ elif plat == 'openbsd3': # BSD (confirmed)
baudrate_constants = {}
elif plat[:3] == 'bsd' or \
- plat[:7] == 'freebsd' or \
- plat[:7] == 'openbsd': # BSD (confirmed for freebsd4: cuaa%d)
+ plat[:7] == 'freebsd':
def device(port):
return '/dev/cuad%d' % port
@@ -595,6 +594,7 @@ class PosixSerial(SerialBase):
WARNING: this function is not portable to different platforms!
"""
if not self.hComPort: raise portNotOpenError
+ if enable:
termios.tcflow(self.fd, TERMIOS.TCION)
else:
termios.tcflow(self.fd, TERMIOS.TCIOFF)
diff --git a/serial/tools/list_ports_posix.py b/serial/tools/list_ports_posix.py
index d5b3e42..7913d81 100644
--- a/serial/tools/list_ports_posix.py
+++ b/serial/tools/list_ports_posix.py
@@ -127,14 +127,13 @@ elif plat == 'cygwin': # cygwin/win32
devices = glob.glob('/dev/com*')
return [(d, d, d) for d in devices]
-elif plat == 'openbsd3': # BSD
+elif plat[:7] == 'openbsd': # OpenBSD
def comports():
- devices = glob.glob('/dev/ttyp*')
+ devices = glob.glob('/dev/cua*')
return [(d, d, d) for d in devices]
elif plat[:3] == 'bsd' or \
- plat[:7] == 'freebsd' or \
- plat[:7] == 'openbsd': # BSD
+ plat[:7] == 'freebsd':
def comports():
devices = glob.glob('/dev/cuad*')