C# Class LibUsbDotNet.Main.UsbEndpointBase

Endpoint members common to Read, Write, Bulk, and Interrupt T:LibUsbDotNet.Main.EndpointType.
Inheritance: IDisposable
Datei anzeigen Open project: arvydas/BlinkStickDotNet Class Usage Examples

Public Properties

Property Type Description
MaxReadWrite int

Private Properties

Property Type Description
CreateTransferContext UsbTransfer
DisposeAndRemoveFromList void
ReadPipe int
UsbEndpointBase System
WritePipe int

Public Methods

Method Description
Abort ( ) : bool

Aborts pending IO operation on this enpoint of one exists.

Dispose ( ) : void

Frees resources associated with the endpoint. Once disposed this UsbEndpointBase cannot be used.

Flush ( ) : bool

Discards any data that is cached in this endpoint.

LookupEndpointInfo ( UsbConfigInfo currentConfigInfo, byte endpointAddress, UsbInterfaceInfo &usbInterfaceInfo, UsbEndpointInfo &usbEndpointInfo ) : bool

Looks up endpoint/interface information in a configuration.

NewAsyncTransfer ( ) : UsbTransfer

Creates a UsbTransfer context for asynchronous transfers.

This method returns a new, empty transfer context. Unlike SubmitAsyncTransfer, this context is not filled and submitted.

This is a non-blocking asynchronous transfer function. This function returns immediately after the context created.
Reset ( ) : bool

Resets the data toggle and clears the stall condition on an enpoint.

SubmitAsyncTransfer ( IntPtr buffer, int offset, int length, int timeout, UsbTransfer &transferContext ) : ErrorCode

Creates, fills and submits an asynchronous UsbTransfer context.

This is a non-blocking asynchronous transfer function. This function returns immediately after the context is created and submitted.

SubmitAsyncTransfer ( object buffer, int offset, int length, int timeout, UsbTransfer &transferContext ) : ErrorCode

Creates, fills and submits an asynchronous UsbTransfer context.

This is a non-blocking asynchronous transfer function. This function returns immediately after the context is created and submitted.

Transfer ( IntPtr buffer, int offset, int length, int timeout, int &transferLength ) : ErrorCode

Synchronous bulk/interrupt transfer function.

Transfer ( object buffer, int offset, int length, int timeout, int &transferLength ) : ErrorCode

Synchronous bulk/interrupt transfer function.

Private Methods

Method Description
CreateTransferContext ( ) : UsbTransfer
DisposeAndRemoveFromList ( ) : void
ReadPipe ( IntPtr pBuffer, int bufferLength, int &lengthTransferred, int isoPacketSize, IntPtr pOverlapped ) : int
UsbEndpointBase ( UsbDevice usbDevice, byte epNum, EndpointType endpointType ) : System
WritePipe ( IntPtr pBuffer, int bufferLength, int &lengthTransferred, int isoPacketSize, IntPtr pOverlapped ) : int

Method Details

Abort() public method

Aborts pending IO operation on this enpoint of one exists.
public Abort ( ) : bool
return bool

Dispose() public method

Frees resources associated with the endpoint. Once disposed this UsbEndpointBase cannot be used.
public Dispose ( ) : void
return void

Flush() public method

Discards any data that is cached in this endpoint.
public Flush ( ) : bool
return bool

LookupEndpointInfo() public static method

Looks up endpoint/interface information in a configuration.
public static LookupEndpointInfo ( UsbConfigInfo currentConfigInfo, byte endpointAddress, UsbInterfaceInfo &usbInterfaceInfo, UsbEndpointInfo &usbEndpointInfo ) : bool
currentConfigInfo LibUsbDotNet.Info.UsbConfigInfo The config to seach.
endpointAddress byte The endpoint address to look for.
usbInterfaceInfo LibUsbDotNet.Info.UsbInterfaceInfo On success, the class for this endpoint.
usbEndpointInfo LibUsbDotNet.Info.UsbEndpointInfo On success, the class for this endpoint.
return bool

NewAsyncTransfer() public method

Creates a UsbTransfer context for asynchronous transfers.

This method returns a new, empty transfer context. Unlike SubmitAsyncTransfer, this context is not filled and submitted.

This is a non-blocking asynchronous transfer function. This function returns immediately after the context created.
public NewAsyncTransfer ( ) : UsbTransfer
return UsbTransfer

Reset() public method

Resets the data toggle and clears the stall condition on an enpoint.
public Reset ( ) : bool
return bool

SubmitAsyncTransfer() public method

Creates, fills and submits an asynchronous UsbTransfer context.
This is a non-blocking asynchronous transfer function. This function returns immediately after the context is created and submitted.
public SubmitAsyncTransfer ( IntPtr buffer, int offset, int length, int timeout, UsbTransfer &transferContext ) : ErrorCode
buffer System.IntPtr A caller-allocated buffer for the data that is transferred.
offset int Position in buffer that transferring begins.
length int Number of bytes, starting from thr offset parameter to transfer.
timeout int Maximum time to wait for the transfer to complete.
transferContext UsbTransfer On , a new transfer context.
return ErrorCode

SubmitAsyncTransfer() public method

Creates, fills and submits an asynchronous UsbTransfer context.
This is a non-blocking asynchronous transfer function. This function returns immediately after the context is created and submitted.
public SubmitAsyncTransfer ( object buffer, int offset, int length, int timeout, UsbTransfer &transferContext ) : ErrorCode
buffer object A caller-allocated buffer for the data that is transferred.
offset int Position in buffer that transferring begins.
length int Number of bytes, starting from thr offset parameter to transfer.
timeout int Maximum time to wait for the transfer to complete.
transferContext UsbTransfer On , a new transfer context.
return ErrorCode

Transfer() public method

Synchronous bulk/interrupt transfer function.
public Transfer ( IntPtr buffer, int offset, int length, int timeout, int &transferLength ) : ErrorCode
buffer System.IntPtr An to a caller-allocated buffer.
offset int Position in buffer that transferring begins.
length int Number of bytes, starting from thr offset parameter to transfer.
timeout int Maximum time to wait for the transfer to complete.
transferLength int Number of bytes actually transferred.
return ErrorCode

Transfer() public method

Synchronous bulk/interrupt transfer function.
public Transfer ( object buffer, int offset, int length, int timeout, int &transferLength ) : ErrorCode
buffer object A caller-allocated buffer for the transfer data. This object is pinned using .
offset int Position in buffer that transferring begins.
length int Number of bytes, starting from thr offset parameter to transfer.
timeout int Maximum time to wait for the transfer to complete.
transferLength int Number of bytes actually transferred.
return ErrorCode

Property Details

MaxReadWrite public_oe static_oe property

The maximum transfer payload size for all usb endpoints.
Transfers greater than this amount are automatically split into multiple transfers. This applies to all endpoint transfer methods (reads and writes). The default is 4megs (4,194,304 bytes)
public static int MaxReadWrite
return int