Exemplo n.º 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 = []
Exemplo n.º 2
0
Arquivo: hdp.py Projeto: nawrasg/hdpy
    def resume(self):
        """Resume operations
		"""
        if not self.suspended:
            return

        self.suspended = False
        MCAPInstance.start(self)
        self.publish()
Exemplo n.º 3
0
Arquivo: hdp.py Projeto: 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
Exemplo n.º 4
0
Arquivo: hdp.py Projeto: 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)