检测在Linux OS上使用C ++在哪个USB集线器中连接的设备

检测在Linux OS上使用C ++在哪个USB集线器中连接的设备

问题描述:



从过去几周开始,我试图在我的C ++程序中显示USB和集线器信息。我需要使用C ++找到在USB集线器中连接的设备使用C ++

Hi,
From the last several weeks I am trying to display my USB and hub infimation in my C++ program. I nee to find the devices connected in USB hub in a tree structure using C++

我没有任何编码的个人经验但你可以搜索关于INotify的文档。我知道如何在Linux上的用户空间中获取设备通知。我已经看到了它产生的数据类型,你必须解析一堆字符串并自己构建任何所需的树结构。
I don''t have any personal experience of coding this but you could search for documentation on INotify. I understand that''s how to get device notifications in user space on Linux. I have seen the kind of data it produces, you will have to parse a bunch of strings and build any required tree structure yourself.