-
Notifications
You must be signed in to change notification settings - Fork 88
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
Attempt at getting isochronous transfer working in rusb-async #217
Draft
Aytixel
wants to merge
56
commits into
a1ien:rusb-async
Choose a base branch
from
Aytixel:rusb-async
base: rusb-async
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make request_type function in fields.rs a const fn so that it can used to create const global variables. Test: The following code now compiles ``` const CTRL_OUT: u8 = request_type( rusb::Direction::Out, rusb::RequestType::Vendor, rusb::Recipient::Device, ); ```
fields.rs: Make request_type function a const fn
Before this commit, the lifetime of the endpoint descriptor was shorter than the lifetime of the config descriptor, since it was tied to the InterfaceDescriptor object. This commit amends the endpoint_descriptors signature so that an EndpointDescriptor has the same lifetime as the overarching ConfigDescriptor. From my understanding, all state derived from a ConfigDescriptor has a lifetime associated to that ConfigDescriptor. So, it's safe for the EndpointDescriptor to adopt the ConfigDescriptor's lifetime through the InterfaceDescriptor. The new test shows us that the lifetimes are now all equal. This test wouldn't compile without the signature change.
Increase endpoint descriptor's lifetime
Documentation specifies micros, but libusb consumes millis. Therefore passing in 1 micro results in an infinite timeout, not the shortest timeout.
Fix timeout documentation
…apability_descriptor This fix adds missing fields to these two structs so that they can be used from rust without the size mismatching from the C version. See: https://libusb.sourceforge.io/api-1.0/structlibusb__bos__descriptor.html https://libusb.sourceforge.io/api-1.0/structlibusb__bos__dev__capability__descriptor.html
New release
Update checkout@v2 to checkout@v3
Fix changelog urls
Add a function to disable device discovery
fix: 404 link for languages
Add serde support for public enums
rusb 0.9.3
Prepare release for rusb 0.9.3
Change the following methods to accept a non-exclusive reference: - DeviceHandle::set_active_configuration - DeviceHandle::unconfigure - DeviceHandle::reset - DeviceHandle::clear_halt - DeviceHandle::detach_kernel_driver - DeviceHandle::attach_kernel_driver - DeviceHandle::set_auto_detach_kernel_driver - DeviceHandle::claim_interface - DeviceHandle::release_interface - DeviceHandle::set_alternate_setting This is safe to do because libusb is thread-safe. Fixes a1ien#148
bLength, bDescriptorType and wTotalLength to descriptors
Use &self reference for all DeviceHandle methods
Support pkg_config for MSVC.
I and @dragonmux found two issues when building libusb from a MSVC host to a MinGW target. When the build.rs script is built for the MSVC host, - the vcpkg crate is used for detection (which correctly detects the MinGW target and reports an unsupported ABI) - a MSVC flag is applied to the build (and thus breaking the build altogether) This commit fixes both issues by changing vcpkg to a Windows-wide dependency, and then if CARGO_CFG_TARGET_ENV is indeed MSVC, it is used and the /source-charset:utf-8 flag is applied.
Some USB classes (UVC, UAC) provide alternate setting descriptors of interfaces with zero endpoints. Trying to call `endpoint_descriptors` on them caused a panic, because NULL was passed to `slice::from_raw_parts`. A branch was introduced to check for that case and create an iterator over an empty slice. See: https://stackoverflow.com/a/49244874/2948315
…point-descriptors fix: panic when trying to iterate over an interface with zero endpoints
Log callback API added
Fix package detection and build when cross-compiling from MSVC to GNU
…iso_packet_desc (fixes a1ien#199) This prevents panics on debug builds in new rust nightly versions (as of 2024-03-27), since they added bounds checks to `get_unchecked_mut`, which here was called on a zero-length slice representing a flexible array member. See: rust-lang/rust@2b43e75
Fixes a few macOS issues
Replace .get_unchecked_mut() with .as_mut_ptr().add() when accessing iso_packet_desc (fixes a1ien#199)
Add libusb_free_pollfds() in the available FFI methods.
…to-bos fix: Add missing fields to libusb_bos_descriptor and libusb_bos_dev_capability_descriptor
Bump libusb to 1.0.27
Remove unneeded mut
libusb 0.7.0 * fix: Add missing fields to libusb_bos_descriptor and libusb_bos_dev_capability_descriptor * Bump libusb to 1.0.27 * Remove unneeded mut rusb 0.9.4 * bLength, bDescriptorType and wTotalLength to descriptors * Use &self reference for all DeviceHandle methods * fix: panic when trying to iterate over an interface with zero endpoints * Log callback API added * Bump libusb1-sys 0.7.0
Bump rusb 0.9.4 and libusb1-sys 0.7
Android does not have udev, but cross-compiling for Android on a Linux host with udev results in a udev link
Add libusb_init_context and associated structs
Android does not have udev; Do not link to udev on Android
Added new constructor for languages + tests
Co-authored-by: Ryan Butler <[email protected]> Co-authored-by: Kevin Mehall <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an attempt to get isochronous transfer working.
I already tested it with one of my project who needs it (at least on linux).
It should work on any os, but needs testing.
I'm well aware that the implementation is not perfect and I'd really like to get help to get it integrated.
Thanks for any suggestion or help on how to improve it.
The PR also solve this issue #160 making the Error and Result public.