What is the Difference between USb Root Hub and USB Composite Device?

6,686

A hub is a device that other devices are connected to. Root hubs represent the USB controllers on your motherboard.

A composite device is a device that has multiple interfaces; your headphones has two interfaces, for mixer controls and for audio capture.

Normal USB devices are not listed as Win32_USBHub, you have too look into the Dependent entries. See Getting the USB Devices Information using WMI for an example.

Share:
6,686

Related videos on Youtube

RL89
Author by

RL89

Updated on September 18, 2022

Comments

  • RL89
    RL89 over 1 year

    I am Developing an application where I need to fetch VID and PID of all the Current USB Devices Connected to the Computer.

    But I am just getting VID and PID number of my Headphone that is attached to my Computer. and not getting for Mouse and Keyboard.

    My Code works like this:-

    static List<USBDeviceInfo> GetUSBDevices()
        {
            List<USBDeviceInfo> devices = new List<USBDeviceInfo>();
    
            ManagementObjectCollection collection;
            using (var searcher = new ManagementObjectSearcher(@"Select * From Win32_USBHub"))
                collection = searcher.Get();
    
            foreach (var device in collection)
            {
                devices.Add(new USBDeviceInfo(
                (string)device.GetPropertyValue("DeviceID"),
                (string)device.GetPropertyValue("PNPDeviceID"),
                (string)device.GetPropertyValue("Description")
                ));
            }
    
            collection.Dispose();
            return devices;
        }
    

    Main Class

    static void Main(string[] args)
        {
           var usbDevices = GetUSBDevices();
           foreach (var usbDevice in usbDevices)
           {
            Console.WriteLine("Device ID: {0}, PNP Device ID: {1}, Description: {2}",
             usbDevice.DeviceID, usbDevice.PnpDeviceID, usbDevice.Description);
           }
          Console.Read();
         }
    

    Now in case of Headphone I am getting Description as USB Composite Device while in Case of other Devices connected to Computer I am getting Description as USB Root Hub

    I don't know why I am getting only VID and PID of only Headphone

    Please suggest

    Thanks in advance.!!

    • Dave
      Dave over 11 years
      There is no need to show your code (this site is not a programming site) as it's relevant to your question per se.
  • miniBill
    miniBill over 8 years
    The link is broken