Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search all available devices #84

Open
ahmedprusevic opened this issue Jul 10, 2021 · 1 comment
Open

Search all available devices #84

ahmedprusevic opened this issue Jul 10, 2021 · 1 comment

Comments

@ahmedprusevic
Copy link

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?

@thegecko
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants