FT_STATUS
|
FT_GetDeviceInfoDetail
|
(DWORD dwIndex, LPDWORD lpdwFlags, LPDWORD lpdwType, LPDWORD lpdwID, LPDWORD lpdwLocId, PCHAR pcSerialNumber, PCHAR pcDescription, FT_HANDLE *ftHandle)
|
Parameters
dwIndex
|
Index of the entry in the device info list.
|
lpdwFlags
|
Pointer to unsigned long to store the flag value.
|
lpdwType
|
Pointer to unsigned long to store device type.
|
lpdwID
|
Pointer to unsigned long to store device ID.
|
lpdwLocId
|
Pointer to unsigned long to store the device location ID.
|
pcSerialNumber
|
Pointer to buffer to store device serial number as a null-terminated string.
|
pcDescription
|
Pointer to buffer to store device description as a null-terminated string.
|
*ftHandle
|
Pointer to a variable of type FT_HANDLE where the handle will be stored.
|
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.
The index value is zero-based.
The flag value is a 4-byte bit map containing miscellaneous data. Bit 0 (least significant bit) of this number indicates if the port is open (1) or closed (0). The remaining bits (1 - 31) are reserved at this time.
Location ID information is not returned for devices that are open when FT_CreateDeviceInfoList is called.
To return the whole device info list as an array of FT_DEVICE_LIST_INFO_NODE structures, use FT_GetDeviceInfoList.
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_GetDeviceInfoDetail.
FT_STATUS ftStatus;
FT_HANDLE ftHandleTemp;
DWORD numDevs;
DWORD Flags;
DWORD ID;
DWORD Type;
DWORD LocId;
char SerialNumber[16];
char Description[64];
//
// create the device information list
//
ftStatus = FT_CreateDeviceInfoList(&numDevs);
if (ftStatus == FT_OK) {
printf("Number of devices is %d\n",numDevs);
}
//
// get information for device 0
//
ftStatus = FT_GetDeviceInfoDetail(0, &Flags, &Type, &ID, &LocId, SerialNumber, Description, &ftHandleTemp);
if (ftStatus == FT_OK) {
printf("Dev 0:\n");
printf(" Flags=0x%x\n",Flags);
printf(" Type=0x%x\n",Type);
printf(" ID=0x%x\n",ID);
printf(" LocId=0x%x\n",LocId);
printf(" SerialNumber=%s\n",SerialNumber);
printf(" Description=%s\n",Description);
printf(" ftHandle=0x%x\n",ftHandleTemp);
}