Closed Richard-Mathie closed 6 years ago
seems to be the code which checks for capabilities and web capabilities on addapter.loadDevices
. not sure what that is doing, is it an API requirement?
Hi @Richard-Mathie The WebUSB specification highlights that WebUSB enabled devices need to have a WebUSB capability descriptor. Therefore this library will only return devices which satisfy that constraint.
The part of the specification outlining this can be seen here: https://wicg.github.io/webusb/#webusb-platform-capability-descriptor
And this is where I filter based on that capability: https://github.com/thegecko/webusb/blob/master/src/adapter.ts#L259
It's also possible it doesn't return WebUSB devices without URLs (I haven't had a chance to test that) so if that's your case, please let me know.
Yeah I had a look through, and it might have been the URL filter, its a bit hard to trace for me.
You could try disabling each of the filters/checks in turn in the code I point to above and recompiling to see progress?
I've had a chance to test this now and there were errors when a WebUSB device didn't have a URL. Now fixed in #11 and I'll make a release...
@Richard-Mathie Did this fix your issue?
Closing due to inactivity
@Richard-Mathie It seems Chrome allows the user to filter against all devices (not just those with the WebUSB characteristic). Therefore I've removed this restriction in PR #13 (and released in 1.0.4) which may have been the cause of your issue.
Ah nice, Yeah thats right Chrome pops up a dropdown list of devices to approve. I guess i should check if FF, IE or edge behave differently.
Sorry I haven't had much time to look at this lately. I might check it out this evening.
I can get a device with
node-usb
butwebusb
throws an error no devices foundwith
webusb
:gives:
with
node-usb
:output:
in chrome WebUSB works
I guess it's being dropped by the filters somehow, but I am struggling to work out where switching between the different adapters js/ts and the promise api's. Can you point us into the right direction?