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 an开发者_高级运维d 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?
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.
精彩评论