rene-aguirre / pywinusb

USB / HID windows helper library
BSD 3-Clause "New" or "Revised" License
207 stars 63 forks source link

core.py Issues with sending output report to HID device #85

Open Chris0074 opened 5 months ago

Chris0074 commented 5 months ago

Sending an output report to an HID device (it is a kind of USB-dongle) results in an hanging communication. I investigated a little bit and found a workaround for my problem. The described modification are working on my side. My workaround looks like this: In the member function send_output_report(self, data) (file core.py) I replaced lines 534 - 567 by the following 2 lines: _result = hid_dll.HiD_SetOutputReport(int(self.hid_handle), byref(raw_data), len(rawdata)) return result

As I do not know very much about HID devices, my question is: Is the change I did OK ? It can also be that my USB device has some issues and the original code is fully OK. For me it is a logical step to use the API-call from the DLL to communicate with the USB device. The same is done for the member function send_featue_report(self, data), which also calls the API-function _hid_dll.HidD_SetFeature(int(self.hid_handle), byref(raw_data), len(rawdata)).