ckbot :: ckmodule :: Module :: Class Module
[hide private]
[frames] | no frames]

Class Module

source code


Abstract superclass representing a CKBot module. Cluster creates the appropriate Module subclass by calling Module.newFromDiscovery

Instance Methods [hide private]
 
__init__(self, node_id, typecode, pna)
Concrete constructor.
source code
 
get_od(self)
This method creates an Object dictionary for this module.
source code
 
iterhwaddr(self)
Iterator for all Object Dictionary index addresses in this module
source code
 
iterprop(self, perm='')
Iterator for Object Dictionary properties exposed by this module
source code
 
iterattr(self, perm='')
Iterator for module attributes exposed by this module class
source code
 
_getAttrProperty(self, prop, req)
(private) Access python attributes exposed as properties ('/@' property names)
source code
 
_getModAttrOfClp(self, clp, attr)
Obtain a module attribute from a clp
source code
 
start(self)
This method sends a CAN Message to start this module.
source code
 
stop(self)
This method sends a CAN Message to stop this module.
source code
 
reset(self)
This method sends a CAN Message to reset this module.
source code

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

Class Methods [hide private]
 
newFromDiscovery(cls, nid, typecode, pna)
Factory method for instantiating Module subclasses given a node id and typecode...
source code
Class Variables [hide private]
  Types = {}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

newFromDiscovery(cls, nid, typecode, pna)
Class Method

source code 

Factory method for instantiating Module subclasses given a node id and typecode
INPUTS:
  nid -- int -- the node id
  typecode -- string -- the typecode string, which is looked up in
     the Module.Types dictionary
  pna -- a ProtocolNodeAdaptor -- typically created using a 
     Protocol instance's .generatePNA(nid) factory method

__init__(self, node_id, typecode, pna)
(Constructor)

source code 

Concrete constructor. 

ATTRIBUTES:
  node_id -- 7 bit number to address a module uniquely
  typecode -- version number of module code 
  pna -- ProtocolNodeAdaptor -- specialized for this node_id

Overrides: object.__init__

iterhwaddr(self)

source code 

Iterator for all Object Dictionary index addresses in this module

The addresses are returned as integers

iterprop(self, perm='')

source code 

Iterator for Object Dictionary properties exposed by this module

INPUTS:
  perm -- string -- ''(default) all properties; 
        'R' readable/gettable
        'W' writable/settable
OUTPUT:
  property names returned as strings

iterattr(self, perm='')

source code 

Iterator for module attributes exposed by this module class

INPUTS:
  perm -- string -- ''(default) all properties; 'R' readable/gettable
            'W' writable/settable
OUTPUT:
  property names returned as strings

_getModAttrOfClp(self, clp, attr)

source code 

Obtain a module attribute from a clp

At the module level, the clp is expected to start with '/'

This is the Module superclass implementation. clp-s starting with /@ expose module attrbiutes