FTD2XX_NET.FTDI.Rescan C# (CSharp) Method

Rescan() public method

Causes the system to check for USB hardware changes. This is equivalent to clicking on the "Scan for hardware changes" button in the Device Manager.
public Rescan ( ) : FT_STATUS
return FT_STATUS
        public FT_STATUS Rescan()
        {
            // 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_Rescan != IntPtr.Zero)
            {
                tFT_Rescan FT_Rescan = (tFT_Rescan)Marshal.GetDelegateForFunctionPointer(pFT_Rescan, typeof(tFT_Rescan));

                // Call FT_Rescan
                ftStatus = FT_Rescan();
            }
            else
            {
                if (pFT_Rescan == IntPtr.Zero)
                {
                    LogB.Debug("FTD2XX: Failed to load function FT_Rescan.");
                }
            }
            return ftStatus;
        }