mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-14 11:39:03 +00:00
Document transport_hid class
This commit is contained in:
parent
78e9afae6e
commit
e7cb1d474a
@ -10,6 +10,6 @@ To get a list of TREZORs that are currently plugged into our computer, we use th
|
||||
|
||||
We can now interact with our TREZORs by creating a :doc:`TrezorClient <client>` object.
|
||||
|
||||
.. automodule:: trezorlib.transport_hid
|
||||
.. autoclass:: trezorlib.transport_hid.HidTransport
|
||||
:members:
|
||||
:undoc-members:
|
@ -54,6 +54,9 @@ class HidTransport(Transport):
|
||||
|
||||
@classmethod
|
||||
def enumerate(cls):
|
||||
"""
|
||||
Return a list of available TREZOR devices.
|
||||
"""
|
||||
devices = {}
|
||||
for d in hid.enumerate(0, 0):
|
||||
vendor_id = d['vendor_id']
|
||||
@ -74,7 +77,9 @@ class HidTransport(Transport):
|
||||
return devices.values()
|
||||
|
||||
def is_connected(self):
|
||||
# Check if the device is still connected
|
||||
"""
|
||||
Check if the device is still connected.
|
||||
"""
|
||||
for d in hid.enumerate(0, 0):
|
||||
if d['path'] == self.device:
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user