
> for usb in wmi. The example code using Win32_USBHub is as follows,

(After thinking about it, Win32_USBHub should capture the information of USB hub While Win32_USBControllerDevice captures the information of USB device)

Using MGMT, two instance were tried, in which "Win32_USBHub" can only capture the information of some USB devices But "win32_usbcontrollerdevice" can capture all USB information. If I could see the report descriptor that is reported to the OS at enumeration (what I see on a USB bus analyzer), I. Later, the pyWin32 library was selected, which was more general. I want to see the information that is reported in a USB report descriptor, like TELEPHONY DEVICE PAGE (0X0B) or CONSUMER PAGE (0X0C) as listed in the Universal Serial Bus HID Usage Tables specification provided by usb.org. This problem can be solved by pyusb library, but pyusb needs to rely on libraries, and different Windows may need different libraries, so if the program is to be deployed to different systems on a large scale, it should be carefully considered. VID, but what is stored in the registry is the history of USB devices previously inserted into this Windows system, that is, it is not the information of USB devices currently connected to Windows. Previously, I tried to get USB PID that is currently connected to device through the registry You can run it as a GUI or you can run it with an argument like this to make it save its data to text file: usbview /saveall:usb.txt. This information includes what speeds the USB port supports and speed the device is using. Python’s pyusb library provides class-specific methods and attributes for interacting with these devices.VID is a 10-point easy task, and only needs the "lsusb" command. It uses Windows APIs to get information about each USB port and each device and display it.

USB devices often belong to specific device classes, such as mass storage devices (USB MSC), audio devices (USB Audio), or human interface devices (USB HID). # Assuming 'usb_device' is obtained from previous steps # Retrieving device descriptor device_descriptor = usb_device.get_active_configuration().bConfigurationValue print ( f "Device descriptor: " ) USB Device Classes
