Alloc Method (numIsoPackets)

LibUsbDotNet

LibUsbDotNet 2.2.8 Alloc Method (numIsoPackets)
Library ReferenceMonoLibUsb.TransferMonoUsbTransferAlloc(Int32)
LibUsbDotNet on SourceForge
Allocate a libusb transfer with a specified number of isochronous packet descriptors
Declaration Syntax
C# Visual Basic Visual C++
public static MonoUsbTransfer Alloc(
	int numIsoPackets
)
Public Shared Function Alloc ( _
	numIsoPackets As Integer _
) As MonoUsbTransfer
public:
static MonoUsbTransfer Alloc(
	int numIsoPackets
)
Parameters
numIsoPackets (Int32)
number of isochronous packet descriptors to allocate.
Return Value
A newly allocated MonoUsbTransfer.
Remarks

The returned transfer is pre-initialized for you. When the new transfer is no longer needed, it should be freed with Free()()()().

Transfers intended for non-isochronous endpoints (e.g. control, bulk, interrupt) should specify an iso_packets count of zero.

For transfers intended for isochronous endpoints, specify an appropriate number of packet descriptors to be allocated as part of the transfer. The returned transfer is not specially initialized for isochronous I/O; you are still required to set the NumIsoPackets and Type fields accordingly.

It is safe to allocate a transfer with some isochronous packets and then use it on a non-isochronous endpoint. If you do this, ensure that at time of submission, NumIsoPackets is 0 and that type is set appropriately.

Note:Alloc(Int32) is roughly equivalent to libusb_alloc_transfer().
Exceptions
Exception Condition
OutOfMemoryException If the transfer was not allocated.

Assembly: LibUsbDotNet (Module: LibUsbDotNet) Version: 2.2.8.104 (2.2.8.104)