summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-02-07 00:24:03 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-02-07 00:24:03 +0000
commitd08cbf3a81c9de3534edb892a72c824f0de7ba3d (patch)
treecbdb92d70296f60086207eec2cee25eb936450f8
parentdc5bd3c8e9ce7550f830581b0a97c4cbbfb13a10 (diff)
downloadpyserial-d08cbf3a81c9de3534edb892a72c824f0de7ba3d.tar.gz
doc update
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@200 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r--CHANGES.txt27
-rw-r--r--README.txt141
2 files changed, 89 insertions, 79 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index a51413a..cb9debc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -86,25 +86,25 @@ Bugfixes (posix):
- cygwin port numbering fixed
- test each and every constant for it's existence in termios module,
use default if not existent (fix for Bug item #640214)
-- wrong exception on nonexitstent ports with /dev file. bug report
+- wrong exception on nonexistent ports with /dev file. bug report
by Louis Cordier
Bugfixes (win32):
-- RTS/CTS handling as sugested in Bug #635072
+- RTS/CTS handling as suggested in Bug #635072
- bugfix of timeouts brought up by Markus Hoffrogge
Version 1.19 19 Mar 2003
---------------------------
Bugfixes (posix):
-- removed ``dgux`` entry which actualy had a wrong comment and is
+- removed ``dgux`` entry which actually had a wrong comment and is
probably not in use anywhere.
Bugfixes (win32):
- added ``int()`` conversion, [Bug 702120]
-- remove code to set control lines in close methond of win32
+- remove code to set control lines in close method of win32
version. [Bug 669625]
Version 1.20 28 Aug 2003
@@ -113,9 +113,9 @@ Version 1.20 28 Aug 2003
Bugfixes (win32):
-- don't recreate opverlaped structures and events on each
+- don't recreate overlapped structures and events on each
read/write.
-- don't set unneded event masks.
+- don't set unneeded event masks.
- dont use DOS device names for ports > 9.
- remove send timeout (its not used in the linux impl. anyway).
@@ -177,7 +177,7 @@ Version 2.0b2 4 Oct 2003
- Added serial port configuration dialog for wxPython to the examples.
- Added terminal application for wxPython with wxGlade design file
to the examples.
-- Jython support is currenty broken as Jython does not have a Python 2.2
+- Jython support is currently broken as Jython does not have a Python 2.2
compatible release out yet
@@ -262,7 +262,7 @@ Bugfixes:
Bugfixes (posix):
-- [Bug 1554183] setRTS/setDTR refrence to nonexisting local "on"
+- [Bug 1554183] setRTS/setDTR reference to non existing local "on"
- [Bug 1513653] file descriptor not closed when exception is thrown
- FreeBSD now uses cuadX instead of cuaaX (Patrick Phalen)
@@ -297,3 +297,14 @@ Bugfixes (jython):
- The Jython backend tries javax.comm and gnu.io (Seo Sanghyeon)
+Version 2.5 <date>
+---------------------------
+New Features:
+
+Bugfixes:
+
+- Improve and fix tcp_serial_redirector example.
+
+Bugfixes (win32):
+
+- [Bug 2469098] parity PARITY_MARK, PARITY_SPACE does't supported in win32
diff --git a/README.txt b/README.txt
index ce26437..60793a4 100644
--- a/README.txt
+++ b/README.txt
@@ -1,10 +1,10 @@
========
pySerial
========
-This module capsulates the access for the serial port. It provides backends
+This module encapsulates the access for the serial port. It provides backends
for standard Python running on Windows, Linux, BSD (possibly any POSIX
-compilant system), Jython and IronPython. The module named "serial"
-automaticaly selects the appropriate backend.
+compliant system), Jython and IronPython. The module named "serial"
+automatically selects the appropriate backend.
It is released under a free software license, see LICENSE.txt for more
details.
@@ -20,7 +20,7 @@ Features
- port numbering starts at zero, no need to know the platform dependant port
name in the user program
- port name can be specified if access through numbering is inappropriate
-- support for different bytesizes, stopbits, parity and flow control
+- support for different byte sizes, stopbits, parity and flow control
with RTS/CTS and/or Xon/Xoff
- working with or without receive timeout, blocking or non-blocking
- file like API with "read" and "write" ("readline" etc. also supported)
@@ -80,25 +80,25 @@ Short introduction
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
+ >>> 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 named 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
+ >>> 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()
Open second port at "38400,8,E,1", non blocking HW handshaking::
>>> ser = serial.Serial(1, 38400, timeout=0,
... parity=serial.PARITY_EVEN, rtscts=1)
- >>> s = ser.read(100) #read up to one hunded bytes
- ... #or as much is in the buffer
+ >>> s = ser.read(100) # read up to one hundred bytes
+ ... # or as much is in the buffer
Get a Serial instance and configure/open it later::
@@ -115,31 +115,30 @@ Get a Serial instance and configure/open it later::
>>> ser.isOpen()
False
-Be carefully 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.
+Be carefully 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::
ser = serial.Serial(
- port=None, #number of device, numbering starts at
- #zero. if everything fails, the user
- #can specify a device string, note
- #that this isn't portable anymore
- #if no port is specified an unconfigured
- #an closed serial port object is created
- baudrate=9600, #baudrate
- bytesize=EIGHTBITS, #number of databits
- parity=PARITY_NONE, #enable parity checking
- stopbits=STOPBITS_ONE, #number of stopbits
- timeout=None, #set a timeout value, None to wait forever
- xonxoff=0, #enable software flow control
- rtscts=0, #enable RTS/CTS flow control
- writeTimeout=None, #set a timeout for writes
+ port=None, # number of device, numbering starts at
+ # zero. if everything fails, the user
+ # can specify a device string, note
+ # that this isn't portable anymore
+ # if no port is specified an unconfigured
+ # an closed serial port object is created
+ baudrate=9600, # baudrate
+ bytesize=EIGHTBITS, # number of databits
+ parity=PARITY_NONE, # enable parity checking
+ stopbits=STOPBITS_ONE, # number of stopbits
+ timeout=None, # set a timeout value, None to wait forever
+ xonxoff=0, # enable software flow control
+ rtscts=0, # enable RTS/CTS flow control
+ writeTimeout=None, # set a timeout for writes
)
The port is immediately opened on object creation, if a port is given.
@@ -159,44 +158,44 @@ Options for write timeout::
Methods of Serial instances::
- open() #open port
- close() #close port immediately
- setBaudrate(baudrate) #change baudarte on an open port
- inWaiting() #return the number of chars in the receive buffer
- read(size=1) #read "size" characters
- write(s) #write the string s to the port
- flushInput() #flush input buffer, discarding all it's contents
- flushOutput() #flush output buffer, abort output
- sendBreak() #send break condition
- setRTS(level=1) #set RTS line to specified logic level
- setDTR(level=1) #set DTR line to specified logic level
- getCTS() #return the state of the CTS line
- getDSR() #return the state of the DSR line
- getRI() #return the state of the RI line
- getCD() #return the state of the CD line
+ open() # open port
+ close() # close port immediately
+ setBaudrate(baudrate) # change baud rate on an open port
+ inWaiting() # return the number of chars in the receive buffer
+ read(size=1) # read "size" characters
+ write(s) # write the string s to the port
+ flushInput() # flush input buffer, discarding all it's contents
+ flushOutput() # flush output buffer, abort output
+ sendBreak() # send break condition
+ setRTS(level=1) # set RTS line to specified logic level
+ setDTR(level=1) # set DTR line to specified logic level
+ getCTS() # return the state of the CTS line
+ getDSR() # return the state of the DSR line
+ getRI() # return the state of the RI line
+ getCD() # return the state of the CD line
Read only Attributes of Serial instances::
- portstr #device name
- BAUDRATES #list of valid baudrates
- BYTESIZES #list of valid byte sizes
- PARITIES #list of valid parities
- STOPBITS #list of valid stop bit widths
+ portstr # device name
+ BAUDRATES # list of valid baud rates
+ BYTESIZES # list of valid byte sizes
+ PARITIES # list of valid parities
+ STOPBITS # list of valid stop bit widths
-New values can be assigned to the following attribues, the port
+New values can be assigned to the following attributes, the port
will be reconfigured, even if it's opened at that time (port will be
closed and reopened to apply the changes)::
- port #port name/number as set by the user
- baudrate #current baudrate setting
- bytesize #bytesize in bits
- parity #parity setting
- stopbits #stop bit with (1,2)
- timeout #read timeout setting
- xonxoff #if Xon/Xoff flow control is enabled
- rtscts #if hardware flow control is enabled
- writeTimeout #write timeout setting
+ port # port name/number as set by the user
+ baudrate # current baud rate setting
+ bytesize # byte size in bits
+ parity # parity setting
+ stopbits # stop bit with (1,2)
+ timeout # read timeout setting
+ xonxoff # if Xon/Xoff flow control is enabled
+ rtscts # if hardware flow control is enabled
+ writeTimeout # write timeout setting
These attributes also have corresponding getX and setXX methods.
@@ -233,15 +232,14 @@ Xon/Xoff characters::
Iterator interface
~~~~~~~~~~~~~~~~~~
-It is possible to iterate over lines comming from a serial port::
-
+It is possible to iterate over lines coming from a serial port::
+
>>> ser = serial.Serial(0, timeout=10)
>>> for line in ser:
... print line
-The use is somewhat restricted tough, as many protocols on the
-wire require that commands are sent and answers are read and this
-one only reads lines.
+The use is somewhat restricted tough, as many protocols on the wire require
+that commands are sent and answers are read and this one only reads lines.
Tips & Tricks
@@ -256,12 +254,12 @@ Tips & Tricks
- When packaging a project with py2exe, it will likely print a warning about
missing modules 'javax.comm'. This warning is uncritical as the module is
used in the Jython implementation that is not used but packaged.
-
+
It can be avoided with::
-
+
setup(...
options = {'py2exe': {'excludes': ['javax.comm']}})
-
+
See also setup_demo.py in the examples.
@@ -276,3 +274,4 @@ References
- Java@SUN http://java.sun.com/products/
- IronPython: http://www.codeplex.com/IronPython
- setuptools: http://peak.telecommunity.com/DevCenter/setuptools
+