diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2005-08-12 21:04:44 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2005-08-12 21:04:44 +0000 |
commit | 22a50cbc141ffa56829b7b4faedd17b7dfa6bb02 (patch) | |
tree | cacafb25e1620969c62d6770f711f1e994f1559b | |
parent | 5ddc34239ffb57b9a6b9fd3fd39e5ab012bb51d7 (diff) | |
download | pyserial-22a50cbc141ffa56829b7b4faedd17b7dfa6bb02.tar.gz |
release 2.2release2_2@140
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk@140 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r-- | pyserial/CHANGES.txt | 12 | ||||
-rw-r--r-- | pyserial/MANIFEST | 1 | ||||
-rw-r--r-- | pyserial/examples/test_high_load.py | 67 | ||||
-rw-r--r-- | pyserial/serial/serialposix.py | 4 | ||||
-rw-r--r-- | pyserial/setup.py | 2 |
5 files changed, 82 insertions, 4 deletions
diff --git a/pyserial/CHANGES.txt b/pyserial/CHANGES.txt index 1eacd11..f6acba0 100644 --- a/pyserial/CHANGES.txt +++ b/pyserial/CHANGES.txt @@ -152,9 +152,17 @@ Version 2.1 28 Jul 2004 - Implement write timeouts ('writeTimeout' parameter) -Version 2.2 XXXX +Version 2.2 31 Jul 2005 + Bugfixes: + - [Bug 1014227]: property <del> broken + - [Bug 1105687]: serial_tcp_example.py: --localport option + - [Bug 1106313]: device (port) strings cannot be unicode + Bugfixes (posix): + - [Patch 1043436] Fix for [Bug 1043420] (OSError: EAGAIN) + - [Patch 1102700] fileno() added + - ensure disbaled PARMRK Bugfixes (win32): - - keep RTS/CTS state on port setting changes [Patch 983106] + - [Patch 983106]: keep RTS/CTS state on port setting changes New Features: - dsrdtr setting to enable/disable DSR/DTR flow control independently diff --git a/pyserial/MANIFEST b/pyserial/MANIFEST index c702a42..74c907e 100644 --- a/pyserial/MANIFEST +++ b/pyserial/MANIFEST @@ -11,6 +11,7 @@ examples\miniterm.py examples\tcp_serial_redirect.py examples\test.py examples\test_advanced.py +examples\test_high_load.py examples\scan.py examples\enhancedserial.py examples\wxSerialConfigDialog.py diff --git a/pyserial/examples/test_high_load.py b/pyserial/examples/test_high_load.py new file mode 100644 index 0000000..656f213 --- /dev/null +++ b/pyserial/examples/test_high_load.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +#Python Serial Port Extension for Win32, Linux, BSD, Jython +#see __init__.py +# +#(C) 2001-2003 Chris Liechti <cliechti@gmx.net> +# this is distributed under a free software license, see license.txt + +"""Some tests for the serial module. +Part of pyserial (http://pyserial.sf.net) (C)2002-2003 cliechti@gmx.net + +Intended to be run on different platforms, to ensure portability of +the code. + +For all these tests a simple hardware is required. +Loopback HW adapter: +Shortcut these pin pairs: + TX <-> RX + RTS <-> CTS + DTR <-> DSR + +On a 9 pole DSUB these are the pins (2-3) (4-6) (7-8) +""" + +import unittest, threading, time +import serial + +#on which port should the tests be performed: +PORT=0 +BAUDRATE=115200 +#~ BAUDRATE=9600 + + +class TestHighLoad(unittest.TestCase): + """Test sending and receiving large amount of data""" + + N = 16 + #~ N = 1 + + def setUp(self): + self.s = serial.Serial(PORT,BAUDRATE, timeout=10) + def tearDown(self): + self.s.close() + + def test0_WriteReadLoopback(self): + """Send big strings, write/read order.""" + for i in range(self.N): + q = ''.join(map(chr,range(256))) + self.s.write(q) + self.failUnless(self.s.read(len(q))==q, "expected a '%s' which was written before" % q) + self.failUnless(self.s.inWaiting()==0, "expected empty buffer after all sent chars are read") + + def test1_WriteWriteReadLoopback(self): + """Send big strings, multiple write one read.""" + q = ''.join(map(chr,range(256))) + for i in range(self.N): + self.s.write(q) + read = self.s.read(len(q)*self.N) + self.failUnless(read==q*self.N, "expected what was written before. got %d bytes, expected %d" % (len(read), self.N*len(q))) + self.failUnless(self.s.inWaiting()==0, "expected empty buffer after all sent chars are read") + +if __name__ == '__main__': + import sys + print __doc__ + print "Testing port", PORT + sys.argv.append('-v') + # When this module is executed from the command-line, it runs all its tests + unittest.main() diff --git a/pyserial/serial/serialposix.py b/pyserial/serial/serialposix.py index c78893e..b057015 100644 --- a/pyserial/serial/serialposix.py +++ b/pyserial/serial/serialposix.py @@ -13,7 +13,7 @@ import sys, os, fcntl, termios, struct, select, errno from serialutil import * -VERSION = "$Revision: 1.27 $".split()[1] #extract CVS version +VERSION = "$Revision: 1.28 $".split()[1] #extract CVS version #Do check the Python version as some constants have moved. if (sys.hexversion < 0x020100f0): @@ -168,6 +168,8 @@ class Serial(SerialBase): iflag &= ~(TERMIOS.INLCR|TERMIOS.IGNCR|TERMIOS.ICRNL|TERMIOS.IGNBRK) if hasattr(TERMIOS, 'IUCLC'): iflag &= ~TERMIOS.IUCLC + if hasattr(TERMIOS, 'PARMRK'): + iflag &= ~TERMIOS.PARMRK #setup baudrate try: diff --git a/pyserial/setup.py b/pyserial/setup.py index edf608e..3428d40 100644 --- a/pyserial/setup.py +++ b/pyserial/setup.py @@ -15,7 +15,7 @@ if sys.version < '2.2.3': setup( name="pyserial", description="Python Serial Port Extension", - version="2.1", + version="2.2", author="Chris Liechti", author_email="cliechti@gmx.net", url="http://pyserial.sourceforge.net/", |