Your browser does not allow scripts
Please click here to view a static table of contents without scripts
I2C_OpenEx
Return to Introduction  Previous page  Next page
Open the specified device and return a handle that will be used for subsequent accesses. The device must be specified by its device description and location.

FTC_STATUS
I2C_OpenEx
(LPSTR lpDeviceName, DWORD dwLocationID, FTC_HANDLE *pftHandle)




Parameters
lpDeviceName
Pointer to a NULL terminated string that contains the name of the specified FT2232C device to be opened.
dwLocationID
Specifies the location identifier of the specified FT2232C device to be opened.
*pftHandle
Pointer to a variable of type FTC_HANDLE where the handle to the open device will be returned. This handle must then be used in all subsequent calls to access this device.




Return Value
FTC_SUCCESS if successful, otherwise the return value is one of the following FTC error codes:

   FTC_NULL_DEVICE_NAME_BUFFER_POINTER
   FTC_INVALID_DEVICE_NAME
   FTC_INVALID_LOCATION_ID
   FTC_DEVICE_NOT_FOUND
   FTC_DEVICE_IN_USE
   FTC_FAILED_TO_SYNCHRONIZE_DEVICE_MPSSE
   FTC_
FAILED_TO_COMPLETE_COMMAND
   FTC_IO_ERROR
   FTC_INSUFFICIENT_RESOURCES



Remarks
The device name and location ID parameters are returned from the I2C_GetDeviceNameLocID function.

Please note that Windows CE does not support location IDs. In the Windows CE FTCI2C DLL, devices can be identified by serial number using the lpDeviceName. dwLocationID is unused in this case.



Example

FTC_STATUS Status = FTC_SUCCESS;
char szDeviceName[100];
DWORD dwLocationID = 0;
FTC_HANDLE ftHandle;

Status = I2C_OpenEx(szDeviceName, dwLocationID, &ftHandle);