GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HIDAPI(1) HIDAPI HIDAPI(1)

hidapi - HIDAPI

List all info of all devices with:

import hid
for device_dict in hid.enumerate():

keys = list(device_dict.keys())
keys.sort()
for key in keys:
print("%s : %s" % (key, device_dict[key]))
print()


try:

print("Opening the device")
h = hid.device()
h.open(0x534C, 0x0001) # TREZOR VendorID/ProductID
print("Manufacturer: %s" % h.get_manufacturer_string())
print("Product: %s" % h.get_product_string())
print("Serial No: %s" % h.get_serial_number_string())
# enable non-blocking mode
h.set_nonblocking(1)
# write some data to the device
print("Write the data")
h.write([0, 63, 35, 35] + [0] * 61)
# wait
time.sleep(0.05)
# read back the answer
print("Read the data")
while True:
d = h.read(64)
if d:
print(d)
else:
break
print("Closing the device")
h.close() except IOError as ex:
print(ex)
print("You probably don't have the hard-coded device.")
print("Update the h.open() line in this script with the one")
print("from the enumeration list output above and try again.") print("Done")


  • Index
  • Module Index
  • Search Page

SatoshiLabs

2011-2021, SatoshiLabs & contributors

July 3, 2025

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.