Question

libusb lets you find a device by it's vendor and product ID. But what if I have several devices with the same VID and PID attached, and want to get a handle to one of them by knowing it's serial number? There is a libusb_open_device_with_vid_pid, but no libusb_open_device_with_serial or similar. Would I have to crawl though the full device list (libusb_get_device_list) or is there a more convenient way?

Was it helpful?

Solution

I think crawling through the device list is the only way here. You could copy the code from libusb_open_device_with_vid_pid, as that is precisely what this function does.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top