Package ckbot :: Module port2port
[hide private]
[frames] | no frames]

Module port2port

source code

module ckbot.port2port

This module provides point-to-point connectivity tools for the rest of the ckbot classes. In particular, it encapsulates the differences between serial ports in Linux, OS X and other common operating environments, as well as offering a UDP transport and an xbee wrapper for serial links.

All connections provided by this module are subclasses of Connection class.

Classes [hide private]
  Connection
Abstract superclass of all Connection objects
  SerialConnection
Concrete Connection subclass representing a serial port
  UDPConnection
Functions [hide private]
 
newConnection(spec)
Factory method for creating a Connection from a string or dictionary
source code
Variables [hide private]
  winreg = None
hash(x)
Function Details [hide private]

newConnection(spec)

source code 
Factory method for creating a Connection from a string or dictionary

Formats:
udp={dst="host", dport=<port>, sport=<sport>} -- set up a UDP
  connection.
tty={glob=<glob>, baudrate=<baud>, stopbits = <n>, parity = 'N'|'E'|'O', timeout=0.5 } -- set up a tty connection
  
In dictionary format, the Connection type is given by the TYPE key, e.g.
  dict( TYPE='tty', baudrate=9600 )
other: assumed to be a Serial device glob pattern