def DiscoverLocalHIDU2FDevices(selector=HidUsageSelector): for d in hid.Enumerate(): if selector(d): try: dev = hid.Open(d['path']) yield UsbHidTransport(dev) except OSError: # Insufficient permissions to access device pass
def main(): devs = hid.Enumerate() for dev in devs: print(dev)