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

Feature Request: Add libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, uint16_t product_id,uint16_t deviceIndex) function #547

Closed
snikeguo opened this issue Apr 2, 2019 · 3 comments
Labels
enhancement New features

Comments

@snikeguo
Copy link

snikeguo commented Apr 2, 2019

libusb_open_device_with_vid_pid(ctx, usb_vid, usb_pid,0);
libusb_open_device_with_vid_pid(ctx, usb_vid, usb_pid,1);
This is more convenient.what do you think?

@mcuee mcuee added the enhancement New features label Apr 7, 2019
@mcuee
Copy link
Member

mcuee commented Apr 7, 2019

The problem is what is deviceIndex defined.

@hjelmn
Copy link
Member

hjelmn commented Apr 10, 2019

I agree. There will be some degree of nondeterminism with the ordering of devices in the device list. You can always get the device list and run through it yourself.

@dickens
Copy link
Member

dickens commented Jan 13, 2020

Going to close this for now. The libusb_open_device_with_vid_pid() function is really meant for applications that want a simplified way of opening a specific device when there will only be one such device connected. As mentioned, there is too much non-determinism in how the devices are enumerated that the value of the proposed function is questionable.

@dickens dickens closed this as completed Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features
Projects
None yet
Development

No branches or pull requests

4 participants