以编程方式检测USB集线器和设备信息 [英] Detect USB Hub and device information programatically

查看:143
本文介绍了以编程方式检测USB集线器和设备信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要列出现有的USB集线器以及集线器中连接的设备。



我可以使用终端打印USB集线器和集线器连接的设备命令

I need to list existing USB hub and the devices connected in the hub.

I can able to print the USB Hub and devices connected in hub from terminal using the commands

lsusb
lsusb -v 





我怎么能以编程方式执行此操作在我的Qt应用程序中是否可以使用任何C ++类。



How I can do this programmatically. Is there any C++ classes available to use in my Qt application.

推荐答案

只需查看 usbutils [ ^ ]包含 lsusb 实用程序的源。它使用 libusb [ ^ ]包。请参阅 libusb API [ ^ ]。
Just have a look at the usbutils[^] sources which contain the lsusb utility. It uses the libusb[^] package. See the libusb API[^] for the provided functions.


这篇关于以编程方式检测USB集线器和设备信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆