diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2002-02-14 01:31:49 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2002-02-14 01:31:49 +0000 |
commit | 65ec6396d663382c9b230b8151c3925c7d8cf6d6 (patch) | |
tree | 205cf3a5ee28fdec29e4b54c195e7d286d86bf60 /pyserial | |
parent | 1b3270282a4d8e1da0669471d3c5497025f14f0b (diff) | |
download | pyserial-git-65ec6396d663382c9b230b8151c3925c7d8cf6d6.tar.gz |
updated docs for 1.1
Diffstat (limited to 'pyserial')
-rw-r--r-- | pyserial/CHANGES.txt | 18 | ||||
-rw-r--r-- | pyserial/README.txt | 37 |
2 files changed, 42 insertions, 13 deletions
diff --git a/pyserial/CHANGES.txt b/pyserial/CHANGES.txt new file mode 100644 index 0000000..9772a46 --- /dev/null +++ b/pyserial/CHANGES.txt @@ -0,0 +1,18 @@ +Version 1.0 13 Feb 2002 + First public release. + Split from the pybsl application (see mspgcc.sourceforge.net) + + New Features: + - Added Jython support + +Version 1.1 14 Feb 2002 + Bugfixes: + - Win32, when not specifying a timeout + - Typos in the Docs + + New Features: + - added serialutil which provides a base class for the Serial objects. + + - readline, readlines, writelines and flush are now supported + see README.txt for deatils. +
\ No newline at end of file diff --git a/pyserial/README.txt b/pyserial/README.txt index 213b7c5..1717024 100644 --- a/pyserial/README.txt +++ b/pyserial/README.txt @@ -8,6 +8,7 @@ the appropriate backed. It is released under a free software license, see LICENSE.txt for more details. +Project Homepage: pyserial.sourceforge.net (C) 2001-2002 Chris Liechti <cliechti@gmx.net> @@ -20,7 +21,7 @@ Features - support for diffrent bytesizes, stopbits, parity and flow control with RTS/CTS and/or xon/xoff - working with or without receive timeout -- file like API with "read" and "write" +- file like API with "read" and "write" ("readline" etc. also supported) - The files in this package are 100% pure Python. They depend on non standard but common packages on Windows (win32all) and Jython (JavaComm). POSIX (Linux, BSD) uses only modules from the standard @@ -48,17 +49,27 @@ Python versions. Short introduction ------------------ -import serial -#open port 0 at 9600,8,N,1, no timeout -ser = serial.Serial(0) -ser.write("hello") #write a string -ser.close() - -#open port at 19200,8,N,1, 1s timeout -ser = serial.Serial('/dev/ttyS1', 19200, timeout=1) -x = ser.read() #read one byte -s = ser.read(10) #read up to ten bytes (timeout) -ser.close() +Open port 0 at 9600,8,N,1, no timeout +>>> import serial +>>> ser = serial.Serial(0) #open first serial port +>>> print ser.portstr #check which port was realy used +>>> ser.write("hello") #write a string +>>> ser.close() #close port + +Open port at 19200,8,N,1, 1s timeout +>>> ser = serial.Serial('/dev/ttyS1', 19200, timeout=1) +>>> x = ser.read() #read one byte +>>> s = ser.read(10) #read up to ten bytes (timeout) +>>> line = ser.readline() #read a \n terminated line +>>> ser.close() + +Be carfully when using "readline" do specify a timeout when +opening the serial port otherwise it could block forever if +no newline character is received. Also note that "readlines" only +works with a timeout. "readlines" depends on having a timeout +and interprets that as EOF (end of file). It raises an exception +if the port is not opened correctly. + Parameters for the Serial class ------------------------------- @@ -99,5 +110,5 @@ References - win32all: http://starship.python.net/crew/mhammond/ and http://www.activestate.com/Products/ActivePython/win32all.html - Java@IBM http://www-106.ibm.com/developerworks/java/jdk/ - (JavaComm links are on the download page for the respecive platform jdk) + (JavaComm links are on the download page for the respective platform jdk) - Java@SUN http://java.sun.com/products/ |