thegecko/webusb

Search all available devices

Opened this issue · 1 comments

I'm developing an app using electron. Requesting devices with:

usb.requestDevice({ filters: [] })

This promise simply does not return all available devices, when vendor id is passed it works. Is there any way to get all available devices?

You need to insert a selection function in order to control which device is selected and this will mimic the experience seen in the browser. This can be done by creating your own instance of the WebUSB class, see:

https://thegecko.github.io/webusb/docs/index.html#creating-your-own-usb-instances

The default instance you are using will return the first device matching your filters.