Module zio :: Class Agent

Class Agent

object --+    
         |    
     LockI --+
             |
            Agent

Agent class is used to talk to agent program running in the ZIO board. The class implements the agent communication protocol.
Instance Methods
 
__init__(self, device)
Constructs an Agent object.
 
close(self)
Cleans up resources allocated by the object.
 
get_serial_fd(self)
Retreives the file descriptor associated with the ZIO serial interface.
 
done_events(self)
Quits the wait_for_events loop, when invoked within event callback.
 
wait_for_events(self, timeout=None)
Waits for notification events in an loop, and invokes the appropriate callback handlers.
 
add_trap_handler(self, modid, index, cb)
 
remove_trap_handler(self, modid, index)
 
do_op(self, module, index, op, *bytes)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods

Inherited from LockI: synchronized

Properties
  debug
Enable/disable debugging information

Inherited from object: __class__

Method Details

__init__(self, device)
(Constructor)

 
Constructs an Agent object. The device through which the agent is to be accessed is to be specified. In *nix systems, a device file like /dev/ttySx or /dev/ttyUSBx is to be specified. In Windows, the COM port name is to be specified.
Parameters:
  • device (int) - the device through which agent is to be accessed
Raises:
Overrides: object.__init__

close(self)

 
Cleans up resources allocated by the object. Specifically closes the serial interface.
Decorators:
  • @LockI.synchronized

get_serial_fd(self)

 
Retreives the file descriptor associated with the ZIO serial interface. The file descriptor can be used in a select() or poll() system call to monitor for events along with other user file-descriptors. Availablity: Unix

done_events(self)

 
Quits the wait_for_events loop, when invoked within event callback.
Decorators:
  • @LockI.synchronized

wait_for_events(self, timeout=None)

 
Waits for notification events in an loop, and invokes the appropriate callback handlers. Should be called after all intialization is performed, to handle events. An optional timeout can specified to specifiy how long to wait process events. If not specified waits indefinitely.
Parameters:
  • timeout (float) - optional timeout period in seconds.
Decorators:
  • @LockI.synchronized
Raises:

add_trap_handler(self, modid, index, cb)

 
Decorators:
  • @LockI.synchronized

remove_trap_handler(self, modid, index)

 
Decorators:
  • @LockI.synchronized

do_op(self, module, index, op, *bytes)

 
Decorators:
  • @LockI.synchronized

Property Details

debug

Enable/disable debugging information
Get Method:
_get_debug(self)
Set Method:
_set_debug(self, state)