SerialReceiver Class Reference

A helper class to handle some protocol on the serial byte stream. More...

Inheritance diagram for SerialReceiver:

Inheritance graph
[legend]
Collaboration diagram for SerialReceiver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

def __init__
 Initialize the class with defaults from a configuration file.
def __additionalOptions
def quit
 Call this method from another thread to force the receive loop to exit.
def receive
 Receive a block of data from the serial port and write it to a file.

Static Public Attributes

int CONVERT_CRLF = 2
int CONVERT_CR = 1
int CONVERT_LF = 0

Detailed Description

A helper class to handle some protocol on the serial byte stream.

Definition at line 158 of file gSerial.py.


Member Function Documentation

def __additionalOptions   self,
  config
 

Serial line options the [serial] block of the configuration file can be:
convert_nl=CR/LF/CRLF: Convert newline character(s) to one of CR, LF, CRLF
                   (default: OS dependent)

Definition at line 176 of file gSerial.py.

def __init__   self,
  config,
  echo = False
 

Initialize the class with defaults from a configuration file.

Parameters:
config - A ConfigParser configuration object
echo - Option to override the configuration file's echo value

Definition at line 164 of file gSerial.py.

def quit   self  ) 
 

Call this method from another thread to force the receive loop to exit.

Definition at line 197 of file gSerial.py.

def receive   self,
  filename = None
 

Receive a block of data from the serial port and write it to a file.

Receive a block of data from the serial port and write it to a file. In order of decreasing precedence, the filename is given by:

  • an optional argument to this method
  • a name embedded in the serial byte stream
  • the name of the program executing this method followed by an underscore and a timestamp with a '.txt' extension, e.g., 'serialReceiver_12345678.txt'. The timestamp used is what is returned by Python's time() method, but with the decimal point separator removed.

To avoid conflicts while the file is being written, the data is initially written to a temporary file. When the temporary file is complete (as provided by a signal in the serial byte stream), it is renamed with the filename as described above.

Parameters:
filename - Optional filename to contain the data

Definition at line 203 of file gSerial.py.


Member Data Documentation

int CONVERT_CR = 1 [static]
 

Definition at line 161 of file gSerial.py.

int CONVERT_CRLF = 2 [static]
 

Definition at line 160 of file gSerial.py.

int CONVERT_LF = 0 [static]
 

Definition at line 162 of file gSerial.py.


The documentation for this class was generated from the following file:
Generated on Thu Apr 27 20:54:16 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO