FTD2XX_NET.FTDI.ReadEEPROMLocation C# (CSharp) Method

ReadEEPROMLocation() public method

Reads an individual word value from a specified location in the device's EEPROM.
public ReadEEPROMLocation ( UInt32 Address, UInt16 &EEValue ) : FT_STATUS
Address System.UInt32 The EEPROM location to read data from
EEValue System.UInt16 The WORD value read from the EEPROM location specified in the Address paramter
return FT_STATUS
        public FT_STATUS ReadEEPROMLocation(UInt32 Address, ref UInt16 EEValue)
        {
            // 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_ReadEE != IntPtr.Zero)
            {
                tFT_ReadEE FT_ReadEE = (tFT_ReadEE)Marshal.GetDelegateForFunctionPointer(pFT_ReadEE, typeof(tFT_ReadEE));

                if (ftHandle != IntPtr.Zero)
                {
                    // Call FT_ReadEE
                    ftStatus = FT_ReadEE(ftHandle, Address, ref EEValue);
                }
            }
            else
            {
                if (pFT_ReadEE == IntPtr.Zero)
                {
                    LogB.Debug("FTD2XX: Failed to load function FT_ReadEE.");
                }
            }
            return ftStatus;
        }