FTD2XX_NET.FTDI.GetTxBytesWaiting C# (CSharp) Method

GetTxBytesWaiting() public method

Gets the number of bytes waiting in the transmit buffer.
public GetTxBytesWaiting ( UInt32 &TxQueue ) : FT_STATUS
TxQueue System.UInt32 The number of bytes waiting to be sent.
return FT_STATUS
        public FT_STATUS GetTxBytesWaiting(ref UInt32 TxQueue)
        {
            // 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_GetStatus != IntPtr.Zero)
            {
                tFT_GetStatus FT_GetStatus = (tFT_GetStatus)Marshal.GetDelegateForFunctionPointer(pFT_GetStatus, typeof(tFT_GetStatus));

                UInt32 RxQueue = 0;
                UInt32 EventStatus = 0;

                if (ftHandle != IntPtr.Zero)
                {
                    // Call FT_GetStatus
                    ftStatus = FT_GetStatus(ftHandle, ref RxQueue, ref TxQueue, ref EventStatus);
                }
            }
            else
            {
                if (pFT_GetStatus == IntPtr.Zero)
                {
                    LogB.Debug("FTD2XX: Failed to load function FT_GetStatus.");
                }
            }
            return ftStatus;
        }