1 Reply Latest reply on Sep 7, 2018 2:07 AM by SrinathS_16

    CYAPI   demo application\cpp\bulkloop    Open();

      In theC:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\application\cpp\bulkloop,there is a demo called bulkloop.




      int nDeviceIndex = 0;





      The nDeviceIndex is always o.

      If there are several devices,how can i get it? Maybe i select second device,how can it distinguish?

      I think it maybe a mistake!

        • 1. Re: CYAPI   demo application\cpp\bulkloop    Open();



          You can distinguish the devices based on the VID/PID combination. This attribute is defined to be a part of the CCyUSBDevice class and can be accessed through an instance of the class.




          do {

          // Open() automatically calls Close() if necessary


          vID = USBDevice->VendorID;

          pID = USBDevice->ProductID;


          } while ((d < devices ) && (vID != 0x04b4) && (pID != 0x00f1));


          In case you have multiple devices with the same VID/PID, distinction can be made possible through the addition of a unique serial number in the device firmware (string descriptors). The serial number can be queried on the host application using the wchar_t CCyUSBDevice::SerialNumber attribute of the CCyUSBDevice class.


          Best regards,

          Srinath S