/// <summary>
        /// Performs a discovery of currently connected Fingerprint Scanner devices
        /// Use the resulting array of FingerPrintDevice to start operating the devices.
        /// </summary>
        /// <returns></returns>
        public FingerprintDevice[] DiscoverDevices()
        {
            if (!IsInitialized)
            {
                Initialize();
            }

            var result = new List <FingerprintDevice>();

            ReleaseDeviceDiscoveryResults();
            var dicoveredDevicePtrs = Interop.fp_discover_devs_pointers(out var deviceDiscoveryResultsPtr); // This returns the array of pointrs

            DeviceDicoveryResultsPtr = deviceDiscoveryResultsPtr;

            foreach (var devicePtr in dicoveredDevicePtrs)
            {
                var deviceStruct = devicePtr.DereferencePtr <Interop.fp_dscv_dev>();
                var driverStruct = Interop.fp_dscv_dev_get_driver_struct(ref deviceStruct);

                var managedDevice = new FingerprintDevice
                {
                    DiscoveredDevice    = deviceStruct,
                    DiscoveredDevicePtr = devicePtr,
                    Driver = driverStruct,
                };

                result.Add(managedDevice);
            }

            return(result.ToArray());
        }
        /// <summary>
        /// Performs a discovery of currently connected Fingerprint Scanner devices
        /// Use the resulting array of FingerPrintDevice to start operating the devices.
        /// </summary>
        /// <returns></returns>
        public FingerprintDevice[] DiscoverDevices()
        {
            if (!IsInitialized) this.Initialize();

            var result = new List<FingerprintDevice>();

            this.ReleaseDeviceDiscoveryResults();
            var deviceDiscoveryResultsPtr = IntPtr.Zero; // This will point to an array of pointers
            var dicoveredDevicePtrs = Interop.fp_discover_devs_pointers(out deviceDiscoveryResultsPtr); // This returns the array of pointrs
            this.DeviceDicoveryResultsPtr = deviceDiscoveryResultsPtr;

            foreach (var devicePtr in dicoveredDevicePtrs)
            {
                var deviceStruct = devicePtr.DereferencePtr<Interop.fp_dscv_dev>();
                var driverStruct = Interop.fp_dscv_dev_get_driver_struct(ref deviceStruct);

                var managedDevice = new FingerprintDevice();
                managedDevice.DiscoveredDevice = deviceStruct;
                managedDevice.DiscoveredDevicePtr = devicePtr;
                managedDevice.Driver = driverStruct;

                result.Add(managedDevice);
            }

            return result.ToArray();

        }