pywinusb
pywinusb copied to clipboard
How do I send a simple feature report?
I have implemented a relay HID USB controller using pyhidapi on macOS. I'm using pywinusb to implement the windows version of the program, but I cannot seem to find out how to send my feature report to the HID.
On pyhidapi I wrote it like this like this:
h = hid.Device(self.vid, self.pid)
message = bytes([0xFF, relay_number]) #where 0xFF means 'turn on'
h.send_feature_report(message)
And I just cannot figure out how to do the same thing in pywinusb.
To be clear, I have been able to create the HidDevice
object, and opened it using .open()
I have looked through the examples, but cannnot for the life of me figure out how to do it.
I might just be stupid, but I would be really happy if someone could point me in the right direction on this one.
Just wondering why not stick to pyhidapi? Did you hit into some limitations?
For pywinusb, I think you can follow this example, find the right feature report and then set/get the feature report. https://github.com/rene-aguirre/pywinusb/blob/master/examples/simple_send.py
# browse output reports, we could search over feature reports also,
# changing find_output_reports() to find_feature_reports()