Subversion Repositories HomeAutomation

Rev

Rev 742 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 742 Rev 746
Line 11... Line 11...
11
from CanPktHandler1 import CanPktHandler1
11
from CanPktHandler1 import CanPktHandler1
12
 
12
 
13
from NodeIfBase import NodeIfBase
13
from NodeIfBase import NodeIfBase
14
from NodeIfCanStim import NodeIfCanStim
14
from NodeIfCanStim import NodeIfCanStim
15
from NodeIfSerial import NodeIfSerial
15
from NodeIfSerial import NodeIfSerial
-
 
16
from NodeIfTCP import NodeIfTCP
16
 
17
 
17
from DaemonConfig import DaemonConfig
18
from DaemonConfig import DaemonConfig
18
 
19
 
19
daemonApp = None
20
daemonApp = None
20
 
21
 
Line 310... Line 311...
310
#        self.cfg.setupFilterBindings()
311
#        self.cfg.setupFilterBindings()
311
#        self.cfg.setupFilterChain()
312
#        self.cfg.setupFilterChain()
312
 
313
 
313
#        print 'INIT: Starting selected can interface'
314
#        print 'INIT: Starting selected can interface'
314
#        ''' nodeif thread launch '''
315
#        ''' nodeif thread launch '''
315
#        self.ifNotifier = self.IfNotifier()
316
        self.ifNotifier = self.IfNotifier(self)
316
#        pktHandler = CanPktHandler1(self.cfg)
317
        pktHandler = CanPktHandler1(self.cfg)
317
#        
318
#        
318
#        ifConfig = NodeIfCanStim.DEFAULT_CONFIG
319
#        ifConfig = NodeIfCanStim.DEFAULT_CONFIG
319
#        self.nodeIf = NodeIfCanStim(ifConfig, pktHandler, self.ifNotifier)
320
#        self.nodeIf = NodeIfCanStim(ifConfig, pktHandler, self.ifNotifier)
320
# #       ifConfig = NodeIfSerial.DEFAULT_CONFIG
321
# #       ifConfig = NodeIfSerial.DEFAULT_CONFIG
-
 
322
        ifConfig = NodeIfTCP.DEFAULT_CONFIG
321
#    
323
#    
322
#        atexit.register(self.exitHelper)
324
        atexit.register(self.exitHelper)
323
#        sys.excepthook = self.exceptHelper
325
        sys.excepthook = self.exceptHelper
-
 
326
        self.nodeIf = NodeIfTCP(pktHandler, self.ifNotifier ,None)
324
 #       self.nodeIf = NodeIfSerial(pktHandler, ifConfig)
327
#       self.nodeIf = NodeIfSerial(pktHandler, ifConfig)
325
#        
328
#        
326
#        if not self.nodeIf.start():
329
        if not self.nodeIf.start():
327
#            print 'FATAL: Failed to initialize node interface.'
330
            print 'FATAL: Failed to initialize node interface.'
328
#            print 'This may indicate that the interface is unavailable, ' \
331
            print 'This may indicate that the interface is unavailable, ' \
329
#                  'or that you do not have permission to access it.'
332
                  'or that you do not have permission to access it.'
330
#            sys.exit(-1)
333
            sys.exit(-1)
331
 
334
 
332
        print 'Initialize/gather info on connected can nodes and load associated state'
335
        print 'Initialize/gather info on connected can nodes and load associated state'
333
        print 'Start selected TCP and UDP server(s)'
336
        print 'Start selected TCP and UDP server(s)'
334
        # server threads launch
337
        # server threads launch
335
       
338