Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions dbus_service/dbus-service
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ class Device(dbus.service.Object):
def Resume(self):
logging.debug('In Resume')
tls.reset()
try:
init.open_common()
except:
init.open_common()
for attempt in range(20):
try:
init.open()
return
except usb_core.USBError as e:
logging.debug('Resume attempt %d failed: %s' % (attempt + 1, repr(e)))
time.sleep(0.1)

@dbus.service.method(dbus_interface=INTERFACE_NAME, in_signature="s", out_signature="as")
def ListEnrolledFingers(self, user):
Expand Down
2 changes: 1 addition & 1 deletion validitysensor/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def match(d):

def open_dev(self, dev: ucore.Device):
if dev is None:
raise Exception('No matching devices found')
raise USBError('No matching devices found')

self.dev = dev
self.dev.default_timeout = 15000
Expand Down