Subversion Repositories HomeAutomation

Rev

Rev 752 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. from PktFilter import PktFilter
  2. from CanPkt import CanPkt
  3. from StateSpace import StateSpace
  4.  
  5. class DefaultFilter(PktFilter):
  6.    
  7.     DESCRIPTIVE_NAME = 'Default Packet Filter'
  8.     ASSOCIATED_SPACES = ['DefaultStateSpace']
  9.  
  10.     def attach(self):
  11.         pass
  12.    
  13.     def detach(self):
  14.         pass
  15.    
  16.     def filter(self, ifname, pkt, spaceport):
  17.        
  18.         print 'DefaultFilter, PKT from node', hex(pkt.nodeId)
  19.        
  20.         ''' Trigger only when nodeId is not equal to 1 '''
  21.  #       if pkt.nodeId is not 1:
  22.  #           return
  23.    
  24.         ''' Call associated state spaces '''
  25.         spaceport.runAll(None)
  26. # spacePort.run('name')
  27.