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

Report IN callback #52

Open
NicoPy opened this issue Aug 22, 2018 · 2 comments
Open

Report IN callback #52

NicoPy opened this issue Aug 22, 2018 · 2 comments

Comments

@NicoPy
Copy link

NicoPy commented Aug 22, 2018

I have custom made HID devices with Vendor defined Features, IN and OUT reports.
Feature Get and Set are ok.
Report OUT is ok.
However, I have not been able to set a callback for Report IN transactions.
I use set_raw_data_handler() as a workaround but it is far from a good solution.

Did I missed something ?

@rene-aguirre
Copy link
Owner

Did I missed something?

:-) As everyone does.

If you are want a cleaner interface, decoupled from physical details use a proper HID descriptor that maps your report fields to usages.

For this check the telephone hook example: https://github.com/rene-aguirre/pywinusb/blob/master/examples/hook_button.py

The bare input report raw data handler was just a provision to deal with the fact that most HID devices don't use proper HID descriptors to describe the schema used, most of them don't even have reports on it.

What is your expectation for the input report? why not using the callback?

@NicoPy
Copy link
Author

NicoPy commented Aug 24, 2018

If you are want a cleaner interface, decoupled from physical details use a proper HID descriptor that maps your report fields to usages.

I don't map report fields to usages since my device is proprietary with lot of information transferred through end points. Most information fields are non standard.

What is your expectation for the input report?

A way to register a callback for each Report IN. Each time a report IN message is received, the callback is called with message data.

why not using the callback?

I do.

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