示例#1
0
    def __init__(self, adapter, listener):
        MCAPInstance.__init__(self, adapter, listener)
        self.counter = 0
#        self.ping_counter = 50
        self.send_script = []
        self.sent = []
        self.received = []
示例#2
0
文件: hdp.py 项目: nawrasg/hdpy
    def resume(self):
        """Resume operations
		"""
        if not self.suspended:
            return

        self.suspended = False
        MCAPInstance.start(self)
        self.publish()
示例#3
0
文件: hdp.py 项目: nawrasg/hdpy
    def suspend(self):
        """Reversible 'stopping'
		"""
        if self.suspended:
            return

        while self.devices:
            self.remove_device(self.devices[-1])

        self.unpublish()
        MCAPInstance.stop(self)
        self.suspended = True
示例#4
0
文件: hdp.py 项目: nawrasg/hdpy
    def __init__(self, manager, config):
        err = self.process_config(config)
        if err:
            raise HealthError("Bad config: %s" % err)

        MCAPInstance.__init__(self, adapter="", listen=True)

        self.mdl_watch(False)

        self.manager = manager

        self.devices = []  # relationship 1:(0,1) with MCL
        self.channels = []  # relationship 1:1 with MDL
        self.stopped = False
        self.suspended = False

        self.publish()

        BlueZ().register_observer(self, self.remote_uuid)