开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜