-
Notifications
You must be signed in to change notification settings - Fork 34
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
Added missing libusb_fill_control / libusb_fill_bulk transfer / other fuctions #14
base: master
Are you sure you want to change the base?
Conversation
@blandger Thanks for sending this in and sorry for taking so long to reply. I'd love to add the remaining definitions to libusb-sys. The main reason they didn't previously exist is that I didn't have the time to write the necessary examples. Examples are compiled and linked with In addition to that, this PR needs to focus on one thing. It's doing a lot more besides adding some missing definitions. All extraneous changes need to be separated. |
let ptr = setup as *const usize; | ||
if !ptr.is_null() { | ||
// let size_of_result = libusb_cpu_to_le16((*setup).wLength); | ||
(*transfer).length = (LIBUSB_CONTROL_SETUP_SIZE + std::mem::size_of::<u16>()).try_into().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that the length of the payload is exactly 16 bits.
For payloads of other sizes, the transfer will fail.
@dcuddeback looks as absent since beginning 2020? That's a pity...