support reboot command for latest solo fw and better testing

This commit is contained in:
Conor Patrick
2020-03-25 14:26:30 -04:00
parent 0a97adc5ec
commit e5ebcab508
+22 -7
View File
@@ -148,15 +148,15 @@ class TestDevice:
dev = None
self.nfc_interface_only = nfcInterfaceOnly
if not nfcInterfaceOnly:
print("--- HID ---")
print(list(CtapHidDevice.list_devices()))
# print("--- HID ---")
# print(list(CtapHidDevice.list_devices()))
dev = next(CtapHidDevice.list_devices(), None)
if not dev:
from fido2.pcsc import CtapPcscDevice
print("--- NFC ---")
print(list(CtapPcscDevice.list_devices()))
# print("--- NFC ---")
# print(list(CtapPcscDevice.list_devices()))
dev = next(CtapPcscDevice.list_devices(), None)
if dev:
self.is_nfc = True
@@ -190,9 +190,24 @@ class TestDevice:
self.find_device(self.nfc_interface_only)
return
print("Please reboot authenticator and hit enter")
input()
self.find_device(self.nfc_interface_only)
if 'solokeys' in sys.argv:
try:
self.dev.call(0x53 ^ 0x80,b'')
except OSError:
pass
print('Rebooting..')
for _ in range(0,8):
time.sleep(0.1)
try:
self.find_device(self.nfc_interface_only)
return
except RuntimeError:
pass
else:
print("Please reboot authenticator and hit enter")
input()
self.find_device(self.nfc_interface_only)
def send_data(self, cmd, data):
if not isinstance(data, bytes):