private void SendVendorSetup(byte requestType, CrazyRequest request, byte value, byte[] data = null, short index = 0) { short dataLen = data != null ? (short) data.Length : (short)0; var setup = new UsbSetupPacket(requestType, (byte) request, value, index, dataLen); int len; if (data == null) { if (_device.ControlTransfer(ref setup, IntPtr.Zero, 0, out len) == false) { throw new Exception("Unable to do control transfer"); } } else { if (_device.ControlTransfer(ref setup, data, dataLen, out len) == false) { throw new Exception("Unable to do control transfer"); } } }
private void SendVendorSetup(CrazyRequest request, byte value, byte[] data = null, short index = 0) { SendVendorSetup(0x40, request, value, data, index); }