LibUsbDotNet 2.2.8
BulkTransfer Method (deviceHandle, endpoint, data, length, actualLength, timeout)
Library ReferenceMonoLibUsbMonoUsbApiBulkTransfer(MonoUsbDeviceHandle, Byte, Object, Int32, Int32%, Int32)
LibUsbDotNet on SourceForge
Perform a USB bulk transfer.
Declaration Syntax
C#Visual BasicVisual C++
public static int BulkTransfer(
	MonoUsbDeviceHandle deviceHandle,
	byte endpoint,
	Object data,
	int length,
	out int actualLength,
	int timeout
)
Public Shared Function BulkTransfer ( _
	deviceHandle As MonoUsbDeviceHandle, _
	endpoint As Byte, _
	data As Object, _
	length As Integer, _
	<OutAttribute> ByRef actualLength As Integer, _
	timeout As Integer _
) As Integer
public:
static int BulkTransfer(
	[InAttribute] MonoUsbDeviceHandle^ deviceHandle, 
	unsigned char endpoint, 
	Object^ data, 
	int length, 
	[OutAttribute] int% actualLength, 
	int timeout
)
Parameters
deviceHandle (MonoUsbDeviceHandle)
A handle for the device to communicate with.
endpoint (Byte)
The address of a valid endpoint to communicate with.
data (Object)

A suitably-sized data buffer for either input or output (depending on endpoint).

This value can be:
length (Int32)
For bulk writes, the number of bytes from data to be sent. for bulk reads, the maximum number of bytes to receive into the data buffer.
actualLength (Int32%)
Output location for the number of bytes actually transferred.
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
Remarks

The direction of the transfer is inferred from the direction bits of the endpoint address.

For bulk reads, the length field indicates the maximum length of data you are expecting to receive. If less data arrives than expected, this function will return that data, so be sure to check the transferred output parameter.

You should also check the transferred parameter for bulk writes. Not all of the data may have been written. Also check transferred when dealing with a timeout error code. libusb may have to split your transfer into a number of chunks to satisfy underlying O/S requirements, meaning that the timeout may expire after the first few chunks have completed. libusb is careful not to lose any data that may have been transferred; do not assume that timeout conditions indicate a complete lack of I/O.

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)