diff --git a/cmd.py b/cmd.py index 311bcf5778..bed3a5be0b 100755 --- a/cmd.py +++ b/cmd.py @@ -114,6 +114,8 @@ class Commands(object): return self.client.load_device(seed, args.pin) def firmware_update(self, args): + if not args.file: + raise Exception("Must provide firmware filename") fp = open(args.file, 'r') if fp.read(4) != 'TRZR': raise Exception("Trezor firmware header expected") diff --git a/trezorlib/transport_hid.py b/trezorlib/transport_hid.py index b6ee9f253e..98af595201 100644 --- a/trezorlib/transport_hid.py +++ b/trezorlib/transport_hid.py @@ -40,7 +40,8 @@ class HidTransport(Transport): def _open(self): self.buffer = '' path = self.device.split(':') - self.hid = hid.device(int(path[0], 16), int(path[1], 16))#, path[2]) + self.hid = hid.device() + self.hid.open(int(path[0], 16), int(path[1], 16)) self.hid.set_nonblocking(True) self.hid.send_feature_report([0x41, 0x01]) # enable UART self.hid.send_feature_report([0x43, 0x03]) # purge TX/RX FIFOs