|
From: Xiaofan C. <xia...@gm...> - 2024-05-05 01:59:05
|
On Sat, May 4, 2024 at 5:06 PM <jo...@be...> wrote: > > I’m trying to use libusb in a Qt WebAssembly app via the Emscripten port. > It’s a port of driver that works under Linux & Windows. The first call to > libusb_get_device_list() is failing with the console message: > > DOMException: Failed to execute 'controlTransferIn' on 'USBDevice': > A transfer error has occurred. > > On Windows 11 using Chrome, Edge and Opera. > > Tracing through the code, in emscripten_webusb.cpp makeControlTransferPromise() > calls controlTransferIn with "request_type”: “standard", "recipient”: “device", "request”: 6, > "wValue”: 0x100, "wIndex”: 0, "wLength”: 0x12 before this error. > > Any idea why this might be failing? If I perform the same controlTransfer in > JavaScript, it works OK. As per libusb Wiki, the status of WebAssembly + WebUSB support is EXPERIMENTAL. https://github.com/libusb/libusb/wiki The above Wiki has a link to the following blog post which talks about the difficulties in enumerating the devices using web applications. https://web.dev/articles/porting-libusb-to-webusb#using-the-port If that does not help, please create a new issue in libusb github. https://github.com/libusb/libusb/issues -- Xiaofan |