Subversion Repositories HomeAutomation

Rev

Rev 747 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 747 Rev 750
Line 65... Line 65...
65
    config = {}
65
    config = {}
66
    pktHandler = None
66
    pktHandler = None
67
    tcpThread = None
67
    tcpThread = None
68
    ownerNotifier = None
68
    ownerNotifier = None
69
   
69
   
70
    def __init__(self, pktHandler, ownerNotifier, cfg = None):
70
    def __init__(self, pktHandler, cfg = None):
71
        if cfg is None:
71
        if cfg is None:
72
            self.config = self.DEFAULT_CONFIG
72
            self.config = self.DEFAULT_CONFIG
73
        else:
73
        else:
74
            self.confg = cfg
74
            self.config = cfg
75
        self.pktHandler = pktHandler
75
        self.pktHandler = pktHandler
76
        self.ownerNotifier = ownerNotifier
76
        log.debug('Creating iftcp interface, config: ' + str(self.config))
77
       
77
       
78
    def setPktHandler(self, pktHandler):
78
    def setPktHandler(self, pktHandler):
79
        self.pktHandler = pktHandler
79
        self.pktHandler = pktHandler
-
 
80
       
-
 
81
    def setIfNotifier(self, ifNotifier):
-
 
82
        self.ownerNotifier = ifNotifier
80
   
83
   
81
    def start(self):
84
    def start(self):
82
        host = self.config['host']
85
        host = self.config['host']
83
        port = self.config['port']
86
        port = self.config['port']
84
        self.tcpThread = TCPThread(self.pktHandler, self.ownerNotifier, host, port)
87
        self.tcpThread = TCPThread(self.pktHandler, self.ownerNotifier, host, port)