def disconnect_service(self, object_path, uuid, port, ok, err): if uuid == '00000000-0000-0000-0000-000000000000': device = Device(object_path) device.disconnect(reply_handler=ok, error_handler=err) else: def cb(_inst, ret): if ret: raise StopException service = get_service(Device(object_path), uuid) if service.group == 'serial' and 'NMDUNSupport' in self.QueryPlugins( ): self.parent.Plugins.run_ex("service_disconnect_handler", cb, service, ok, err) elif service.group == 'serial' and 'PPPSupport' in self.QueryPlugins( ): service.disconnect(port, reply_handler=ok, error_handler=err) self.parent.Plugins.run("on_rfcomm_disconnect", port) logging.info("Disconnecting rfcomm device") else: if not self.parent.Plugins.run_ex("service_disconnect_handler", cb, service, ok, err): service.disconnect(reply_handler=ok, error_handler=err)
def disconnect_service(self, object_path, uuid, port, ok, err): service = Device(object_path).get_service(uuid) if service.group == 'serial': service.disconnect(port) self.Applet.Plugins.Run("on_rfcomm_disconnect", port) dprint("Disonnecting rfcomm device") else: def cb(_inst, ret): if ret: raise StopException if not self.Applet.Plugins.RunEx("service_disconnect_handler", cb, service, ok, err): service.disconnect(reply_handler=ok, error_handler=err)
def disconnect_service(self, object_path, uuid, port, ok, err): if uuid == '00000000-0000-0000-0000-000000000000': device = Device(object_path) device.disconnect(reply_handler=ok, error_handler=err) else: service = get_service(Device(object_path), uuid) if service.group == 'serial': service.disconnect(port, reply_handler=ok, error_handler=err) self.parent.Plugins.run("on_rfcomm_disconnect", port) logging.info("Disconnecting rfcomm device") else: def cb(_inst, ret): if ret: raise StopException if not self.parent.Plugins.run_ex("service_disconnect_handler", cb, service, ok, err): service.disconnect(reply_handler=ok, error_handler=err)