ble: catch and ignore the InProgress error when we're already listening
This commit is contained in:
parent
d4405cc1ef
commit
5f9766cb71
|
@ -320,8 +320,14 @@ class BlueZDeviceManager(GObject.Object):
|
|||
continue
|
||||
|
||||
objpath = obj.get_object_path()
|
||||
try:
|
||||
i.StartDiscovery()
|
||||
logger.debug('{}: Discovery started (timeout {})'.format(objpath, timeout))
|
||||
except GLib.Error as e:
|
||||
if (e.domain == 'g-io-error-quark' and
|
||||
e.code == Gio.IOErrorEnum.DBUS_ERROR and
|
||||
Gio.dbus_error_get_remote_error(e) == 'org.bluez.Error.InProgress'):
|
||||
logger.debug('{}: Already listening'.format(objpath))
|
||||
|
||||
if timeout > 0:
|
||||
GObject.timeout_add_seconds(timeout, self._discovery_timeout_expired)
|
||||
|
|
Loading…
Reference in New Issue