开发者

libusb: get Device by serial number

开发者 https://www.devze.com 2023-02-05 11:29 出处:网络
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 i

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消