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

Is it possible to include a length parameter for the ReceiveFeatureReport function? #108

Open
sd016808 opened this issue May 5, 2023 · 2 comments

Comments

@sd016808
Copy link

sd016808 commented May 5, 2023

In our web application, we need to reduce the packet size to increase the update frequency.

When using the Logic Analyzer to observe the packet, I noticed that ReceiveFeatureReport always returns the full length as defined in the descriptor. However, with HIDIOCGFEATURE(len) in Linux or HidD_GetFeature in Windows, only a specific length will be obtained.

How can we do it using WebHID?

@nondebug
Copy link
Collaborator

nondebug commented May 5, 2023

Interesting, I didn't realize you could request a shorter report to improve update frequency. Currently, WebHID uses the size of the report defined in the report descriptor and doesn't provide a way to specify the report size.

We could support this by adding an (optional) options parameter to receiveFeatureReport:

device.receiveFeatureReport(reportId, {overrideReportLength: 8});

I'm not sure what this should do if the requested report length is longer than the length defined in the report descriptor. I think for most devices this will cause a device error, but perhaps there are devices where this is necessary.

@sd016808
Copy link
Author

sd016808 commented May 8, 2023

Thanks! I am really looking forward for this feature.

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