-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set Feature Report data last byte corrupted #72
Comments
Well I just answered by own question! I looked through the public methods in this repository and I saw the send_feature_report() method and tried it out. This is doing what I want. Some times we just need to summarize our question in writing and then we can answer our own question. Still curious what was wrong with my set_raw_data() example, but I'm not stuck on this anymore. |
Set your buffer to be one bytes more (for the report ID). https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/hidsdi/nf-hidsdi-hidd_setfeature
|
This is a current design limitation, currently, the HID class doesn't keep an internal feature type so I think your example code makes sense, it should be supported. |
Interesting. Looking at the codes it does seem to differentiate feature report with output report, but maybe I am wrong. |
Hi,
First of all allow me to say thanks for maintaining this repository. It saves me a ton of work!
On Linux I use the usb library (import usb) along with the controlMsg() method for the device to send data, and this works for the particular device. On Windows 10 I'm importing the pywinusb.hid library and trying to send the same type of data. My first attempt was to use the set_raw_data() and send() methods of a feature report to send data to a device, as I did not know if there was a controlMsg() equivalent function in pywinusb. I see the data on the USB bus with my analyzer, but the last byte of the given transaction is always set to zero (0x00). The buffer for this feature report (0xE4) is 263 bytes long, which represents 256 bytes of data plus a 7 byte header.
How can I send the 263 byte data buffer without corruption? Is there another method I should be using?
Thank you.
Here is one transaction worth of data, the last byte should not be zero.
Here is a snippet of my Python code. The 'size' parameter from the hid caps does match the buffer size (263) in the case.
The text was updated successfully, but these errors were encountered: