Skip to main content

Pipe Class

NuGet: GHIElectronics.TinyCLR.Devices.UsbHost
Assembly: GHIElectronics.TinyCLR.Devices.UsbHost
Namespace: GHIElectronics.TinyCLR.Devices.UsbHost

A USB communication pipe.

public class Pipe : IDisposable

Properties​

Endpoint​

public Descriptors.Endpoint Endpoint { get; set; }

Endpoint associated with this pipe.

Methods​

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.

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

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

Transfers data to/from the endpoint.

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.

Dispose()​

public void Dispose()

Disconnects and disposes the device.

Dispose(bool disposing)​

protected virtual void Dispose(bool disposing)

Disconnects and disposes the device.

ParameterTypeDescription
disposingboolWhether or not this is called from Dispose.