Author Topic: I have some trouble to enumerate USB Ports  (Read 646 times)


  • Newbie
  • *
  • Posts: 1
    • View Profile
I have some trouble to enumerate USB Ports
« on: July 24, 2015, 03:41:22 am »
Hello guys
I am using the components nrcommlib, It's my first time to use it.
I have some trouble to enumerate USB Ports.

Here is my code:

    for Level_01:=0 to nrUSB1.HostCount-1 do  //Find HOST
          node := Nodes.Add(nil, nrUSB1.Hosts[Level_01].NameFriendly);

          for Level_02:=0 to nrUSB1.Hosts[Level_01].HubCount-1 do   //Find HUB
               node := Nodes.AddChild(node, nrUSB1.Hosts[Level_01].Hubs[Level_02].Description);

               for Level_03:=0 to nrUSB1.Hosts[Level_01].Hubs[Level_02].PortCount-1 do  //FIND PORT
                     node := Nodes.AddChild(node, nrUSB1.Hosts[Level_01].Hubs[Level_02].Ports[Level_03].Description);
                     node := node.Parent;

                     if  nrUSB1.Hosts[Level_01].Hubs[Level_02].Ports[Level_03].Devices[0] is TnrUSBhub then
            {If this port connected to a USB HUB,I don't know how to enumerate this HUB's ports}      



Can anyone help me? :'(