QuickUsbReadData (quickusb)
Last changed: eggie5-149.63.77.160

.
Summary
Preforms a bulk USB read

C# Signature:

DllImport("quickusb.dll", CharSet = CharSet.Ansi)]
static extern int QuickUsbReadData(IntPtr Handle, byte[] outData, out int length);

Notes:

Tips & Tricks:

Please add some!

Sample Code:

    /// <summary>
    /// Read block from QuickUSB module
    /// </summary>
    /// <param name="data">predeclared byte array to fill with USB data</param>
    public bool Read(out byte[] data, int length)
    {
        try
        {
        if (IsOpen)
        {

            byte[] readData = new byte[length];



            int len = readData.Length;

            int result = QuickUsbReadData(handle, readData, out len);
            if (result == 0)
            {
            LastError = "USB Connection is not open";
            //IsOpen = false;
            Close();
            data = readData;
            return false;
            }

            data = readData;
            return true;
        }
        else {
            LastError = "Device not open";
            data = new byte[length];
            return false;
        }
        }
        catch (DllNotFoundException)
        {
        LastError = "Cannot find the QuickUSB dll library. Please install QuickUsb Drivers.";
        data = new byte[length];
        return false;
        }

    }