pywinusb icon indicating copy to clipboard operation
pywinusb copied to clipboard

core.py Issues with sending output report to HID device

Open Chris0074 opened this issue 9 months ago • 0 comments

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(raw_data)) 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(raw_data)).

Chris0074 avatar May 22 '24 11:05 Chris0074