def __init__(self, adapter, listener): MCAPInstance.__init__(self, adapter, listener) self.counter = 0 # self.ping_counter = 50 self.send_script = [] self.sent = [] self.received = []
def resume(self): """Resume operations """ if not self.suspended: return self.suspended = False MCAPInstance.start(self) self.publish()
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
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)