summaryrefslogtreecommitdiff
path: root/README.txt
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2002-02-14 01:31:49 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2002-02-14 01:31:49 +0000
commit757d5de98de695e5f118c781eea032ea3305969f (patch)
treeab13f945a6bcd7dc9a9457191fd44872369ae5a7 /README.txt
parentb17ccf8ab75790d329354ef1dbbe480ae764486e (diff)
downloadpyserial-757d5de98de695e5f118c781eea032ea3305969f.tar.gz
updated docs for 1.1
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@8 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'README.txt')
-rw-r--r--README.txt37
1 files changed, 24 insertions, 13 deletions
diff --git a/README.txt b/README.txt
index 213b7c5..1717024 100644
--- a/README.txt
+++ b/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/