public FT_STATUS SetEventNotification(UInt32 eventmask, EventWaitHandle eventhandle)
{
// Initialise ftStatus to something other than FT_OK
FT_STATUS ftStatus = FT_STATUS.FT_OTHER_ERROR;
// If the DLL hasn't been loaded, just return here
if (hFTD2XXDLL == IntPtr.Zero)
return ftStatus;
// Check for our required function pointers being set up
if (pFT_SetEventNotification != IntPtr.Zero)
{
tFT_SetEventNotification FT_SetEventNotification = (tFT_SetEventNotification)Marshal.GetDelegateForFunctionPointer(pFT_SetEventNotification, typeof(tFT_SetEventNotification));
if (ftHandle != IntPtr.Zero)
{
// Call FT_SetSetEventNotification
ftStatus = FT_SetEventNotification(ftHandle, eventmask, eventhandle.SafeWaitHandle);
}
}
else
{
if (pFT_SetEventNotification == IntPtr.Zero)
{
LogB.Debug("FTD2XX: Failed to load function FT_SetEventNotification.");
}
}
return ftStatus;
}