craesh
craesh

Reputation: 3746

libusb: get Device by serial number

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?

Upvotes: 3

Views: 3297

Answers (1)

Simon Richter
Simon Richter

Reputation: 29618

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.

Upvotes: 2

Related Questions