Report error when no devices found to configure. (#398)

This commit is contained in:
Liam Murphy
2021-11-01 19:51:55 +11:00
committed by GitHub
parent 4eb7f02985
commit 44988695ab

View File

@@ -124,7 +124,10 @@ def main(args):
length=32, byteorder='big', signed=False) length=32, byteorder='big', signed=False)
} }
for authenticator in tqdm(get_opensk_devices(args.batch)): devices = get_opensk_devices(args.batch)
if not devices:
fatal("No devices found.")
for authenticator in tqdm(devices):
# If the device supports it, wink to show which device # If the device supports it, wink to show which device
# we're going to program. # we're going to program.
if authenticator.device.capabilities & hid.CAPABILITY.WINK: if authenticator.device.capabilities & hid.CAPABILITY.WINK: