/// <summary> /// Attempts to read data from a bulk IN endpoint. /// </summary> /// /// <param name="pipeId"></param> /// <param name="bytesToRead"> Number of bytes to read. </param> /// <param name="buffer"></param> /// <param name="bytesRead"> Number of bytes read. </param> /// <param name="success"> Success or failure status. </param> /// internal void ReadViaBulkTransfer(Byte pipeId, UInt32 bytesToRead, ref Byte[] buffer, ref UInt32 bytesRead, out Boolean success) { // *** winusb function // summary // Attempts to read data from a device interface. // parameters // Device handle returned by WinUsb_Initialize. // Endpoint address. // Buffer to store the data. // Maximum number of bytes to return. // Number of bytes read. // Null pointer for non-overlapped. // Returns True on success. // *** success = WinUsbDeviceApi.WinUsb_ReadPipe(DeviceInfo.WinUsbHandle, pipeId, buffer, bytesToRead, ref bytesRead, IntPtr.Zero); //if (!(success)) CloseDeviceHandle(); }