Closed dsanders11 closed 5 years ago
Do you have a problem with these checks in place?
@thegecko, yes, claiming the interface isn't necessary for the control transfers and they may already be claimed by other applications or drivers, so it may not be possible to claim the interface.
Ok, thanks
@dsanders11 Hmm, I can see these checks in the spec:
https://wicg.github.io/webusb/#check-the-validity-of-the-control-transfer-parameters
Step 3 if the recipient is interface
, step 4 if the recipient is endpoint
.
@thegecko, hmm, you're right, I missed that section. Let me look into it some more, it may be another thing that's in the spec that doesn't need to be.
@thegecko, I'm not sure here, I don't have a deep enough understanding of the USB spec to know if it's required or not.
I thought that perhaps libusb was auto-claiming the interface, giving me the illusion of not needing to claim it. There's an auto_claim
function in the Windows code, but I'm using Mac and I don't see one in there. I've also cranked up the debug output for libusb and don't see any mention of claiming the interface. I've tested with claiming first and that also works. ¯\_(ツ)_/¯
Since I can remove the check myself if it becomes a problem, and I'm not clear on the correctness of this PR, I'm going to go ahead and close it.
Ok, let me know if anything changes :)
These checks aren't necessary (aren't mentioned in the latest version of the spec). I have a use-case of adjusting camera settings on a UVC (USB Video Class) device, and have confirmed it works fine without claiming the interface (in addition to verifying in other libraries which don't claim the interface before the control transfers).