Your browser does not allow scripts
Please click here to view a static table of contents without scripts
FT_Open
Return to Introduction  Previous page  Next page
Open the device and return a handle which will be used for subsequent accesses.

FT_STATUS
FT_Open
(int iDevice, FT_HANDLE *ftHandle)




Parameters
iDevice
Must be 0 if only one device is attached. For multiple devices 1, 2 etc.
ftHandle
Pointer to a variable of type FT_HANDLE where the handle will be stored. This handle must be used to access the device.




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



Remarks
Although this function can be used to open multiple devices by setting iDevice to 0, 1, 2 etc. there is no ability to open a specific device. To open named devices, use the function FT_OpenEx.



Example
This sample shows how to open a device.

FT_HANDLE ftHandle;
FT_STATUS ftStatus;

ftStatus = FT_Open(0,&ftHandle);
if (ftStatus == FT_OK) {
    // FT_Open OK, use ftHandle to access device
}
else {
    // FT_Open failed
}