2 Replies Latest reply on Oct 16, 2020 7:37 AM by GiVa_292201

    [C++] How can I predict the order of CCyUSBDevice list?

    GiVa_292201

      Dear all,

      I have more FX3 conncted to the same machine and I need to connect to a specific one.

       

      Normally, to look for a specific device by its serial number, I would do something like this:

       

      CCyUSBDevice device;
      const unsigned char num_of_devices = device.DeviceCount();
      for (unsigned char i = 0; i < num_of_devices; i++)
      {
          device.Open(i);
          if (check(device.SerialNumber))
              break;
          device.Close();
      }
      
      // Do something with the device
      
      device.Close()
      

       

      However, in my case I cannot sequentially open all the connected devices. I need to query WMI database, get a list of all CYUSB3 connected devices and then open a specific one. My problem is that the order of the CYUSB3 devices that I get from WMI database is different from the Cypress driver order.

       

      Is there a way to predict how the Cypress driver (or library) will enumerate my devices (e.g. order by serial, PID, description...) in order to avoid a sequential device scan?

       

      Thank you,
      Gianni