Open tommie opened 7 months ago
yeah, I encounter the similar issue on Ubuntu 20.04 that claim the interface automatically. I used a simple script in python to detach the kernel driver. I think the reason they don't implement that feature is because it is different for different platforms and it touches a lot of low-level stuff for different platform, not sure if there is a general fix for that. I can confirm that you don't face the same issue on MacOS not sure on Windows.
Do you have any idea on how to solve the issue without touch the udev
or running the python script like I did for linux?
I'm developing a tool to send usb data to the device for end users and I don't want them to go down to the low level such as that
There are two pieces to this,
Thanks, that's useful to know.
If Windows requires invasive action to relinquish control to the browser, I understand the answer to my question will be "claiming an interface should not be disruptive" for the foreseeable future. Thus I should redesign the device to use a vendor subclass.
Since the user has already performed an action to approve opening the device, taking a defensive position due to security seems questionable. But given the above, I don't think it matters.
My question has been answered. I'm guessing it doesn't need further clarification in the spec, though I think a note that this is intended behavior would be useful.
I'm buildling a USBTMC device, which I'd like to access with WebUSB. When my device connects, the interface is immediately bound to the Linux
usbtmc
kernel driver, andclaimInterface
fails withNetworkError
.libusb provides
libusb_detach_kernel_driver
to explicitly hijack the device.I can't find any information in the WebUSB specification about how implementations are supposed to handle this case. If I have requested the device, the user likely wants the webpage detaching the driver ("just make it work.") To me, it seems
claimInterface
should use always try to detach the kernel driver, but it would be nice with some guidance on how disruptiveclaimInterface
ought to be.For anyone looking for an answer, this udev rule is for a Raspberry Pi RP2040 that can then be claimed by WebUSB:
Caveat emptor: I don't know how this works on other OSes, but I don't think it matters for the general question of how eager
claimInterface
should be to succeed.