bool SendUsbControl(byte interfaceNum, byte dir, byte type, byte recipient, byte request, ushort value, ushort index, byte[] Buffer, uint BufferLength, out uint LengthTransferred) { bool retVal = false; WINUSB_SETUP_PACKET packet; packet.RequestType = (byte)((dir << 7) | (type << 5) | (recipient)); packet.Request = request; packet.Value = value; packet.Index = index; packet.Length = 0; LengthTransferred = 0; if (usb.ClaimInterface(interfaceNum, false)) { if (usb.ControlTransfer(packet, Buffer, BufferLength, out LengthTransferred, IntPtr.Zero)) { retVal = true; } usb.ReleaseInterface(interfaceNum, false); } return(retVal); }