LibUsbDotNet 2.2.8
ControlTransfer Method (deviceHandle, requestType, request, value, index, pData, dataLength, timeout)
Library ReferenceMonoLibUsbMonoUsbApiControlTransfer(MonoUsbDeviceHandle, Byte, Byte, Int16, Int16, IntPtr, 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,
	IntPtr pData,
	short dataLength,
	int timeout
)
Public Shared Function ControlTransfer ( _
	deviceHandle As MonoUsbDeviceHandle, _
	requestType As Byte, _
	request As Byte, _
	value As Short, _
	index As Short, _
	pData As IntPtr, _
	dataLength As Short, _
	timeout As Integer _
) As Integer
public:
static int ControlTransfer(
	[InAttribute] MonoUsbDeviceHandle^ deviceHandle, 
	unsigned char requestType, 
	unsigned char request, 
	short value, 
	short index, 
	IntPtr pData, 
	short dataLength, 
	int timeout
)
Parameters
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.
pData (IntPtr)
A suitably-sized data buffer for either input or output (depending on direction bits within bmRequestType).
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
Remarks

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: 2.2.8.104 (2.2.8.104)