Skip to main content

Pipe Class

Package: GHIElectronics.Endpoint.Devices.UsbHost
Namespace: GHIElectronics.Endpoint.Devices.UsbHost

A USB communication pipe.

public class Pipe : IDisposable

Properties​

Endpoint​

public Endpoint Endpoint { get; }

Endpoint associated with this pipe.

Returns Endpoint

TransferTimeout​

public int TransferTimeout { get; set; }

The timeout for transfer operations in milliseconds (0: none). Defaults to 500ms.

Returns int

Methods​

Dispose()​

public void Dispose()

Closes the pipe.

Transfer(byte[] buffer, int offset, int count)​

public int Transfer(byte[] buffer, int offset, int count)

Transfers data to/from the endpoint: an IN endpoint (address 0x80 and up) fills the buffer, an OUT endpoint sends it.

ParameterTypeDescription
bufferbyte[]The transfer buffer.
offsetintThe offset into the buffer.
countintThe amount to transfer starting at offset from the buffer.

Returns int: The number of bytes successfully transferred.

Transfer(byte[] buffer)​

public int Transfer(byte[] buffer)

Transfers data to/from the endpoint.

ParameterTypeDescription
bufferbyte[]The transfer buffer.

Returns int: The number of bytes successfully transferred.