Skip to content
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

How do I send a simple feature report? #71

Open
simonsolnes opened this issue May 9, 2021 · 2 comments
Open

How do I send a simple feature report? #71

simonsolnes opened this issue May 9, 2021 · 2 comments

Comments

@simonsolnes
Copy link

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.

@mcuee
Copy link

mcuee commented Aug 12, 2021

Just wondering why not stick to pyhidapi? Did you hit into some limitations?

@mcuee
Copy link

mcuee commented Aug 12, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants