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

near0312

  • 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
    begin
          node := Nodes.Add(nil, nrUSB1.Hosts[Level_01].NameFriendly);

          for Level_02:=0 to nrUSB1.Hosts[Level_01].HubCount-1 do   //Find HUB
          begin
               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
               begin
                     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
                     begin
         
            {If this port connected to a USB HUB,I don't know how to enumerate this HUB's ports}      
                         

                     end;

                     
               end;
          end;
    end;


Can anyone help me? :'(