3
« on: October 05, 2020, 04:01:09 pm »
Hi all,
I'd like to use the callback notification provided by the D3xx driver. According to the AN_379 programmers guide example starting at page 61, there is a definition:
USER_CONTEXT UserContext = {0};
on page 67. This seems to be a structure containing the ftHandle and other fields since later on the page there is:
UserContext.m_ftHandle = ftHandle;
ftStatus = FT_SetNotificationCallback(ftHandle, NotificationCallback, &UserContext);
Further down on page 68 a pointer type of it PUSER_CONTEXT is used to cast the void pointer from the callback function and access the fields:
PUSER_CONTEXT pUserContext = (PUSER_CONTEXT)pvCallbackContext;
ULONG ulBytesTransferred = 0;
DEBUG(_T("\n\tReading %d bytes!\n"), pInfo->ulRecvNotificationLength);
FT_STATUS ftStatus = FT_ReadPipe( pUserContext->m_ftHandle, pInfo->ucEndpointNo, &pUserContext->m_ucRecvBuffer[pUserContext->m_ulCurrentRecvData], pInfo->ulRecvNotificationLength, &ulBytesTransferred, NULL );
The field name m_ftHandle sugests that this context structure is an FTDI defined type but I can not find this definition eg. in FTD3XX.h or so. Anybody here who has seen this type beeing defined somewhere?