File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,11 +245,12 @@ def enter_dfu(serial):
245245 """
246246
247247 p = solo .client .find (serial )
248- p .enter_st_dfu ()
249- # this doesn't really work yet ;)
250- # p.reboot()
251-
252- print ("Please powercycle the device (pull out, plug in again)" )
248+ try :
249+ p .enter_st_dfu ()
250+ print ("Please powercycle the device (pull out, plug in again)" )
251+ except Exception as e :
252+ if "wrong channel" in str (e ).lower ():
253+ print ("Command wasn't accepted by Solo. It must be in bootloader mode first and be a 'hacker' device." )
253254
254255
255256aux .add_command (enter_dfu )
Original file line number Diff line number Diff line change 44import sys
55import tempfile
66import time
7+ from threading import Event
78
89from fido2 .client import Fido2Client
910from fido2 .ctap import CtapError
@@ -105,7 +106,13 @@ def use_hid(
105106 def send_only_hid (self , cmd , data ):
106107 if not isinstance (data , bytes ):
107108 data = struct .pack ("%dB" % len (data ), * [ord (x ) for x in data ])
108- self .dev ._dev .InternalSend (0x80 | cmd , bytearray (data ))
109+
110+ no_reply = Event ()
111+ no_reply .set ()
112+ try :
113+ self .dev .call (0x80 | cmd , bytearray (data ), no_reply )
114+ except IOError :
115+ pass
109116
110117 def exchange_hid (self , cmd , addr = 0 , data = b"A" * 16 ):
111118 req = Client .format_request (cmd , addr , data )
You can’t perform that action at this time.
0 commit comments