I'm trying to read the output of an HID device (NFC Tag Reader: R-DT-EVO-HF2-HID) using hidapi on python 3.9.6. (Windows 10)
`class HID_Reader(): def init(self): self.port = hid.device() a = hid.enumerate() self.port.open(0x10C4, 0x81B9) print("Manufacturer: %s" % self.port.get_manufacturer_string()) print("Product: %s" % self.port.get_product_string()) print("Serial No: %s" % self.port.get_serial_number_string())
def read_port(self):
data = self.port.read(2)
if data:
print(data)
else:
pass`
Following the above code,all went well except the line "data = self.port.read(2)" that raise an exception : 'read error'. How can we read the output of the device ?
Other question: is there a way to actiavate/deactivate the HID device in order to read at a specific moment ?
Best regards, Antoine
Try other package and follow the documentation of hidapi but I'm facing the same error. The purpose is to deactivate the NFC Reader, place a NFC Tag in front, make some stuff in python, activate the reader and read the output from python script.