LibUsbDotNet 2.2.8
ControlTransfer Method (deviceHandle, requestType, request, value, index, data, dataLength, timeout)
Library ReferenceMonoLibUsbMonoUsbApiControlTransfer(MonoUsbDeviceHandle, Byte, Byte, Int16, Int16, Object, Int16, Int32)
LibUsbDotNet on SourceForge
Perform a USB control transfer.
Declaration Syntax
C#Visual BasicVisual C++
public static int ControlTransfer(
	MonoUsbDeviceHandle deviceHandle,
	byte requestType,
	byte request,
	short value,
	short index,
	Object data,
	short dataLength,
	int timeout
Public Shared Function ControlTransfer ( _
	deviceHandle As MonoUsbDeviceHandle, _
	requestType As Byte, _
	request As Byte, _
	value As Short, _
	index As Short, _
	data As Object, _
	dataLength As Short, _
	timeout As Integer _
) As Integer
static int ControlTransfer(
	[InAttribute] MonoUsbDeviceHandle^ deviceHandle, 
	unsigned char requestType, 
	unsigned char request, 
	short value, 
	short index, 
	Object^ data, 
	short dataLength, 
	int timeout
deviceHandle (MonoUsbDeviceHandle)
A handle for the device to communicate with.
requestType (Byte)
The request type field for the setup packet.
request (Byte)
The request field for the setup packet.
value (Int16)
The value field for the setup packet
index (Int16)
The index field for the setup packet.
data (Object)

A suitably-sized data buffer for either input or output (depending on direction bits within bmRequestType).

This value can be:
dataLength (Int16)
The length field for the setup packet. The data buffer should be at least this size.
timeout (Int32)
timeout (in milliseconds) that this function should wait before giving up due to no response being received. For an unlimited timeout, use value 0.
Return Value
  • on success, the number of bytes actually transferred
  • ErrorTimeout if the transfer timed out
  • ErrorPipe if the control request was not supported by the device.
  • ErrorNoDevice if the device has been disconnected
  • another MonoUsbError code on other failures

The direction of the transfer is inferred from the bmRequestType field of the setup packet.

The wValue, wIndex and wLength fields values should be given in host-endian byte order.

Note: Member documentation was originally generated using the Libusb-1.0 API documentation: Synchronous device I/O

Assembly: LibUsbDotNet (Module: LibUsbDotNet) Version: (