Revert "base: once the device is registered, we're done"

This broke device initialization in some cases (not sure why it worked until
today though). Where a device is in register mode but the ManufacturerData has
not yet updated to the 4-byte string (i.e. a device previously known
normally), the device would now always call listen(). The firmware - in
register mode - would start initializing the connection though and get
rejected, leaving us with a device that cannot be registered.

This reverts commit a061240b11.
pull/146/head
Peter Hutterer 2019-07-15 21:08:10 +10:00
parent 48a339c3b7
commit 498a867558
1 changed files with 3 additions and 3 deletions

View File

@ -385,11 +385,11 @@ class Tuhi(GObject.Object):
d = self.devices[bluez_device.address]
if d.mode == DeviceMode.LISTEN or d.listening:
d.listen()
else:
if mode == DeviceMode.REGISTER:
d.mode = mode
logger.debug(f'{bluez_device.objpath}: call Register() on device')
elif d.listening:
d.listen()
def _on_bluez_device_updated(self, manager, bluez_device):
self._add_device(manager, bluez_device, True)