C# Класс LibUsbDotNet.Main.UsbEndpointBase

Endpoint members common to Read, Write, Bulk, and Interrupt T:LibUsbDotNet.Main.EndpointType.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
MaxReadWrite int

Private Properties

Свойство Тип Описание
CreateTransferContext UsbTransfer
DisposeAndRemoveFromList void
ReadPipe int
UsbEndpointBase System
WritePipe int

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

Abort() публичный Метод

Aborts pending IO operation on this enpoint of one exists.
public Abort ( ) : bool
Результат bool

Dispose() публичный Метод

Frees resources associated with the endpoint. Once disposed this UsbEndpointBase cannot be used.
public Dispose ( ) : void
Результат void

Flush() публичный Метод

Discards any data that is cached in this endpoint.
public Flush ( ) : bool
Результат bool

LookupEndpointInfo() публичный статический Метод

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.
Результат bool

NewAsyncTransfer() публичный Метод

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
Результат UsbTransfer

Reset() публичный Метод

Resets the data toggle and clears the stall condition on an enpoint.
public Reset ( ) : bool
Результат bool

SubmitAsyncTransfer() публичный Метод

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.
Результат ErrorCode

SubmitAsyncTransfer() публичный Метод

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.
Результат ErrorCode

Transfer() публичный Метод

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.
Результат ErrorCode

Transfer() публичный Метод

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.
Результат ErrorCode

Описание свойств

MaxReadWrite публичное статическое свойство

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
Результат int