Skip to content

Conversation

@Mornix
Copy link
Contributor

@Mornix Mornix commented Dec 13, 2020

HidD_SetFeature() requires a feature report be at least a certain size similar to the requirement for WriteFile() in the implementation of hid_write().

@Youw
Copy link
Member

Youw commented Dec 16, 2020

Thanks, this is good.
Do you mind making a small change?
Cache the buffer as a device member, and allocate it only on first use.
An optimisation, so we don't do dynamica allocations on each report.

I wanted to apply same optimisation for hid_write to, just didn't have a chance to do so yet.

Copy link
Member

@Youw Youw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
This is exactly how I'd do it.

@Youw Youw merged commit fb4135c into libusb:master Dec 24, 2020
@mcuee mcuee added the Windows Related to Windows backend label Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Windows Related to Windows backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants