Package pyrobot :: Package system :: Package serial :: Module serialutil :: Class SerialBase
[frames | no frames]

Type SerialBase

object --+    
         |    
  FileLike --+
             |
            SerialBase

Known Subclasses:
Serial

Serial port base class. Provides __init__ function and properties to
get/set port settings.

Method Summary
  __init__(self, port, baudrate, bytesize, parity, stopbits, timeout, xonxoff, rtscts)
Initialize comm port object.
  __repr__(self)
String representation of the current port settings and its state.
  getBaudrate(self)
Get the current baudrate setting.
  getByteSize(self)
Get the current byte size setting.
  getParity(self)
Get the current parity setting.
  getPort(self)
get the current port setting.
  getRtsCts(self)
Get the current RtsCts setting.
  getStopbits(self)
Get the current stopbits setting.
  getSupportedBaudrates(self)
  getSupportedByteSizes(self)
  getSupportedParities(self)
  getSupportedStopbits(self)
  getTimeout(self)
Get the current timeout setting.
  getXonXoff(self)
Get the current XonXoff setting.
  isOpen(self)
Check if the port is opened.
  setBaudrate(self, baudrate)
Change baudrate.
  setByteSize(self, bytesize)
Change byte size.
  setParity(self, parity)
Change parity setting.
  setPort(self, port)
Change the port.
  setRtsCts(self, rtscts)
Change RtsCts setting.
  setStopbits(self, stopbits)
Change stopbits size.
  setTimeout(self, timeout)
Change timeout setting.
  setXonXoff(self, xonxoff)
Change XonXoff setting.
    Inherited from FileLike
  flush(self)
flush of file like objects...
  read(self, size)
  readline(self, size, eol)
read a line which is terminated with end-of-line (eol) character...
  readlines(self, sizehint, eol)
read a list of lines, until timeout...
  write(self, s)
  writeline(self, message, eol)
  writelines(self, sequence)
  xreadlines(self, sizehint)
just call readlines - here for compatibility...
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...

Property Summary
  baudrate
  bytesize
  parity
  port
  rtscts
  stopbits
  timeout
  xonxoff

Class Variable Summary
tuple BAUDRATES = (50, 75, 110, 134, 150, 200, 300, 600, 1200,...
tuple BYTESIZES = (5, 6, 7, 8)
tuple PARITIES = ('N', 'E', 'O')
tuple STOPBITS = (1, 2)

Method Details

__init__(self, port=None, baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=0, rtscts=0)
(Constructor)

Initialize comm port object. If a port is given, then the port will be
opened immediately. Otherwise a Serial port object with in clsoed state
is returned.
Overrides:
__builtin__.object.__init__

__repr__(self)
(Representation operator)

String representation of the current port settings and its state.
Overrides:
__builtin__.object.__repr__

getBaudrate(self)

Get the current baudrate setting.

getByteSize(self)

Get the current byte size setting.

getParity(self)

Get the current parity setting.

getPort(self)

get the current port setting. The value that was passed on init or using
setPort() is passed back. See also the attribute portstr which contains
the name of the port as a string.

getRtsCts(self)

Get the current RtsCts setting.

getStopbits(self)

Get the current stopbits setting.

getTimeout(self)

Get the current timeout setting.

getXonXoff(self)

Get the current XonXoff setting.

isOpen(self)

Check if the port is opened.

setBaudrate(self, baudrate)

Change baudrate.

setByteSize(self, bytesize)

Change byte size.

setParity(self, parity)

Change parity setting.

setPort(self, port)

Change the port. The attribute portstr is set to a string that
contains the name of the port.

setRtsCts(self, rtscts)

Change RtsCts setting.

setStopbits(self, stopbits)

Change stopbits size.

setTimeout(self, timeout)

Change timeout setting.

setXonXoff(self, xonxoff)

Change XonXoff setting.

Property Details

baudrate

Get Method:
getBaudrate(self)
Set Method:
setBaudrate(self, baudrate)
Delete Method:
'Baudrate setting'

bytesize

Get Method:
getByteSize(self)
Set Method:
setByteSize(self, bytesize)
Delete Method:
'Baudrate setting'

parity

Get Method:
getParity(self)
Set Method:
setParity(self, parity)
Delete Method:
'Baudrate setting'

port

Get Method:
getPort(self)
Set Method:
setPort(self, port)
Delete Method:
'Baudrate setting'

rtscts

Get Method:
getRtsCts(self)
Set Method:
setRtsCts(self, rtscts)
Delete Method:
'Baudrate setting'

stopbits

Get Method:
getStopbits(self)
Set Method:
setStopbits(self, stopbits)
Delete Method:
'Baudrate setting'

timeout

Get Method:
getTimeout(self)
Set Method:
setTimeout(self, timeout)
Delete Method:
'Baudrate setting'

xonxoff

Get Method:
getXonXoff(self)
Set Method:
setXonXoff(self, xonxoff)
Delete Method:
'Baudrate setting'

Class Variable Details

BAUDRATES

Type:
tuple
Value:
(50, 75, 110, 134, 150, 200, 300, 600, 1200)                           

BYTESIZES

Type:
tuple
Value:
(5, 6, 7, 8)                                                           

PARITIES

Type:
tuple
Value:
('N', 'E', 'O')                                                        

STOPBITS

Type:
tuple
Value:
(1, 2)                                                                 

Generated by Epydoc 2.1 on Mon Jul 25 01:39:26 2005 http://epydoc.sf.net