-
Notifications
You must be signed in to change notification settings - Fork 35
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
macOS implementation lacks USBDeviceOpenSeize #87
Comments
Does If that's the case, it might make sense to make |
I checked this, but the interface that I need to claim only exists on configuration 1 and it doesn't get set automatically. Claiming the interface without setting a configuration results in
I tested this out and it does seem to work with my device. |
Additionally |
Opened #88 Turns out that having an interface claimed does not cause
Old Apple documentation seems to indicate that a device with bDeviceClass != 0 (composite / class defined at interface level) is not guaranteed to have a configuration set by default, and I remember this being the case with bDeviceClass = 0xff (vendor) at one point. However, I'm testing now with a vendor-class device and I do get configuration 1 by default, not sure why that is. |
I overviewed #88, gave it a test (it works), but also came up with a question.
I don't know if this would help, but I could provide you with packet captures from wireshark with the OS enumerating my device. Maybe that could give us some clues? |
Sure, I'll take a look. I could maybe clone the descriptors with Facedancer and see if I can reproduce that behavior. |
In that case, I'll do you one better. I checked, and it results in the same behavior as with the real device. |
Hey,
Thanks for creating a pure rust replacement for libusb! I was eager to replace rusb with nusb in my project, but I found an issue in the macos implementation -
Device::open
does not (always?) open devices.Details
results in
Side-note: would be great if nusb returned strings for those errors!
Solution
I looked into what libusb was doing and found that it was always calling USBDeviceOpenSeize.
I tested this out by adding the following to
IoKitDevice::new
:And it worked!
I curiously didn't find any direct call to
USBDeviceOpen
orUSBDeviceOpenSeize
in nusb, I guess that this should have happened implicitly somewhere, but I am not that familiar with iokit to tell exactly where.The text was updated successfully, but these errors were encountered: