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

Base class for async transfer context.
Наследование: IDisposable, IAsyncResult
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
mHasWaitBeenCalled bool
mIsoPacketSize int
mOriginalCount int
mOriginalOffset int
mTimeout int
mTransferCancelEvent System.Threading.ManualResetEvent
mTransferCompleteEvent System.Threading.ManualResetEvent
mTransferLOCK object

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

Метод Описание
Cancel ( ) : ErrorCode

Cancels a pending transfer that was previously submitted with Submit.

Dispose ( ) : void

Cancels any pending transfer and frees resources.

Fill ( IntPtr buffer, int offset, int count, int timeout ) : void

Fills the transfer with the data to Submit.

Fill ( IntPtr buffer, int offset, int count, int timeout, int isoPacketSize ) : void

Fills the transfer with the data to Submit an isochronous transfer.

Fill ( object buffer, int offset, int count, int timeout ) : void

Fills the transfer with the data to Submit.

Fill ( object buffer, int offset, int count, int timeout, int isoPacketSize ) : void

Fills the transfer with the data to Submit an isochronous transfer.

IncrementTransfer ( int amount ) : bool

Increments the internal counters to the next transfer batch (for transfers greater than UsbEndpointBase.MaxReadWrite)

Reset ( ) : void

Resets the transfer to its orignal state.

Prepares a UsbTransfer to be resubmitted.

Submit ( ) : ErrorCode

Submits the transfer.

This functions submits the USB transfer and return immediately.

Wait ( int &transferredCount ) : ErrorCode

Wait for the transfer to complete, timeout, or get cancelled.

Wait ( int &transferredCount, bool cancel ) : ErrorCode

Wait for the transfer to complete, timeout, or get cancelled.

Защищенные методы

Метод Описание
UsbTransfer ( UsbEndpointBase endpointBase ) : System

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

Метод Описание
SyncTransfer ( UsbTransfer transferContext, IntPtr buffer, int offset, int length, int timeout, int &transferLength ) : ErrorCode
SyncTransfer ( UsbTransfer transferContext, IntPtr buffer, int offset, int length, int timeout, int isoPacketSize, int &transferLength ) : ErrorCode

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

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

Cancels a pending transfer that was previously submitted with Submit.
public Cancel ( ) : ErrorCode
Результат ErrorCode

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

Cancels any pending transfer and frees resources.
public Dispose ( ) : void
Результат void

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

Fills the transfer with the data to Submit.
public Fill ( IntPtr buffer, int offset, int count, int timeout ) : void
buffer System.IntPtr The buffer.
offset int The offset on the buffer where the transfer should read/write.
count int The number of bytes to transfer.
timeout int Time (milliseconds) to wait before the transfer times out.
Результат void

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

Fills the transfer with the data to Submit an isochronous transfer.
public Fill ( IntPtr buffer, int offset, int count, int timeout, int isoPacketSize ) : void
buffer System.IntPtr The buffer.
offset int The offset on the buffer where the transfer should read/write.
count int The number of bytes to transfer.
timeout int Time (milliseconds) to wait before the transfer times out.
isoPacketSize int Size of each isochronous packet.
Результат void

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

Fills the transfer with the data to Submit.
public Fill ( object buffer, int offset, int count, int timeout ) : void
buffer object The buffer; See for more details.
offset int The offset on the buffer where the transfer should read/write.
count int The number of bytes to transfer.
timeout int Time (milliseconds) to wait before the transfer times out.
Результат void

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

Fills the transfer with the data to Submit an isochronous transfer.
public Fill ( object buffer, int offset, int count, int timeout, int isoPacketSize ) : void
buffer object The buffer; See for more details.
offset int The offset on the buffer where the transfer should read/write.
count int The number of bytes to transfer.
timeout int Time (milliseconds) to wait before the transfer times out.
isoPacketSize int Size of each isochronous packet.
Результат void

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

Increments the internal counters to the next transfer batch (for transfers greater than UsbEndpointBase.MaxReadWrite)
public IncrementTransfer ( int amount ) : bool
amount int This will usually be the total transferred on the previous batch.
Результат bool

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

Resets the transfer to its orignal state.
Prepares a UsbTransfer to be resubmitted.
public Reset ( ) : void
Результат void

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

Submits the transfer.
This functions submits the USB transfer and return immediately.
public abstract Submit ( ) : ErrorCode
Результат ErrorCode

UsbTransfer() защищенный Метод

protected UsbTransfer ( UsbEndpointBase endpointBase ) : System
endpointBase UsbEndpointBase
Результат System

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

Wait for the transfer to complete, timeout, or get cancelled.
public Wait ( int &transferredCount ) : ErrorCode
transferredCount int The number of bytes transferred on .
Результат ErrorCode

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

Wait for the transfer to complete, timeout, or get cancelled.
public abstract Wait ( int &transferredCount, bool cancel ) : ErrorCode
transferredCount int The number of bytes transferred on .
cancel bool If true, the transfer is cancelled if it does not complete within the time specified in .
Результат ErrorCode

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

mHasWaitBeenCalled защищенное свойство

protected bool mHasWaitBeenCalled
Результат bool

mIsoPacketSize защищенное свойство

protected int mIsoPacketSize
Результат int

mOriginalCount защищенное свойство

protected int mOriginalCount
Результат int

mOriginalOffset защищенное свойство

protected int mOriginalOffset
Результат int

mTimeout защищенное свойство

protected int mTimeout
Результат int

mTransferCancelEvent защищенное свойство

protected ManualResetEvent,System.Threading mTransferCancelEvent
Результат System.Threading.ManualResetEvent

mTransferCompleteEvent защищенное свойство

protected ManualResetEvent,System.Threading mTransferCompleteEvent
Результат System.Threading.ManualResetEvent

mTransferLOCK защищенное свойство

protected object mTransferLOCK
Результат object