Your browser does not allow scripts
Please click here to view a static table of contents without scripts
FT_GetDeviceInfoList
Return to Introduction  Previous page  Next page
This function returns a device information list and the number of D2XX devices in the list.

FT_STATUS
FT_GetDeviceInfo
(FT_DEVICE_LIST_INFO_NODE *pDest, LPDWORD lpdwNumDevs)




Parameters
*pDest
Pointer to an array of FT_DEVICE_LIST_INFO_NODE structures.
lpdwNumDevs
Pointer to the number of elements in the array.




Return Value
FT_OK if successful, otherwise the return value is an FT error code.   



Remarks
This function should only be called after calling FT_CreateDeviceInfoList. If the devices connected to the system change, the device info list will not be updated until FT_CreateDeviceInfoList is called again.

Location ID information is not returned for devices that are open when
FT_CreateDeviceInfoList is called.

The array of FT_DEVICE_LIST_INFO_NODES contains all available data on each device. The structure of FT_DEVICE_LIST_INFO_NODES is given in the Appendix. The storage for the list must be allocated by the application. The number of devices returned by FT_CreateDeviceInfoList can be used to do this.

When programming in Visual Basic, LabVIEW or similar languages,
FT_GetDeviceInfoDetail may be required instead of this function.

Please note that Windows CE and Linux do not support location IDs. As such, the Location ID parameter in the structure will be empty under Windows CE and Linux.



Example

This example shows how to call FT_GetDeviceInfoList.

FT_STATUS ftStatus;
FT_DEVICE_LIST_INFO_NODE *devInfo;
DWORD numDevs;

//
// create the device information list
//
ftStatus = FT_CreateDeviceInfoList(&numDevs);
if (ftStatus == FT_OK) {
   printf("Number of devices is %d\n",numDevs);
}

//
// allocate storage for list based on numDevs
//
devInfo = (FT_DEVICE_LIST_INFO_NODE*)malloc(sizeof(FT_DEVICE_LIST_INFO_NODE)*numDevs);

//
// get the device information list
//
ftStatus = FT_GetDeviceInfoList(devInfo,&numDevs);
if (ftStatus == FT_OK) {
for (int i = 0; i < numDevs; i++) {  
   printf("Dev %d:\n",i);  
      printf("  Flags=0x%x\n",devInfo[i].Flags);
      printf("  Type=0x%x\n",devInfo[i].Type);
      printf("  ID=0x%x\n",devInfo[i].ID);
      printf("  LocId=0x%x\n",devInfo[i].LocId);
      printf("  SerialNumber=%s\n",devInfo[i].SerialNumber);
      printf("  Description=%s\n",devInfo[i].Description);
      printf("  ftHandle=0x%x\n",devInfo[i].ftHandle);
   }
}