C# Class LibUsbDotNet.Main.UsbTransferQueue

Helper class for maintaining a user defined number of outstanding aync transfers on an endpoint.
Show file Open project: arvydas/BlinkStickDotNet Class Usage Examples

Public Properties

Property Type Description
BufferSize int
EndpointBase UsbEndpointBase
IsoPacketSize int
MaxOutstandingIO int
Timeout int

Public Methods

Method Description
Free ( ) : void

Cancels and frees all oustanding transfers.

Transfer ( Handle &handle ) : ErrorCode

Submits transfers until MaxOutstandingIO is reached then waits for the oldest transfer to complete.

UsbTransferQueue ( UsbEndpointBase endpointBase, int maxOutstandingIO, int bufferSize, int timeout, int isoPacketSize ) : System

Creates a new transfer queue instance.

this ( int index ) : byte[]

Gets the transfer data buffer at the specified index.

Private Methods

Method Description
IncWithRoll ( int &incField, int rollOverValue ) : void
free ( UsbTransferQueue transferParam ) : void
transfer ( UsbTransferQueue transferParam, Handle &handle ) : ErrorCode

Method Details

Free() public method

Cancels and frees all oustanding transfers.
public Free ( ) : void
return void

Transfer() public method

Submits transfers until MaxOutstandingIO is reached then waits for the oldest transfer to complete.
public Transfer ( Handle &handle ) : ErrorCode
handle Handle The queue handle to the that completed.
return ErrorCode

UsbTransferQueue() public method

Creates a new transfer queue instance.
public UsbTransferQueue ( UsbEndpointBase endpointBase, int maxOutstandingIO, int bufferSize, int timeout, int isoPacketSize ) : System
endpointBase UsbEndpointBase The endpoint to transfer data to/from.
maxOutstandingIO int The number of transfers to before waiting for a completion.
bufferSize int The size of each data buffer.
timeout int The maximum time to wait for each transfer.
isoPacketSize int For isochronous use only. The iso packet size. If 0, the endpoints max packet size is used.
return System

this() public method

Gets the transfer data buffer at the specified index.
public this ( int index ) : byte[]
index int The index of the buffer to retrieve.
return byte[]

Property Details

BufferSize public property

Size (in bytes) of each data buffer in this transfer queue.
public int BufferSize
return int

EndpointBase public property

Endpoint for I/O operations.
public UsbEndpointBase,LibUsbDotNet.Main EndpointBase
return UsbEndpointBase

IsoPacketSize public property

For isochronous use only. The iso packet size.
public int IsoPacketSize
return int

MaxOutstandingIO public property

Maximum outstanding I/O operations before waiting for a completion. This is also the number of data buffers allocated for this transfer queue.
public int MaxOutstandingIO
return int

Timeout public property

Time (in milliseconds) to wait for a transfer to complete before returning ErrorCode.IoTimedOut.
public int Timeout
return int