Skip to main content

Pipe Class

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

A USB communication pipe.

class Pipe(IDisposable): ...

Properties​

Endpoint​

Endpoint: Endpoint # @property

Endpoint associated with this pipe.

Returns Endpoint

TransferTimeout​

TransferTimeout: int # @property / @setter

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

Returns int

Methods​

Dispose()​

def Dispose(self) -> None:

Closes the pipe.

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

def Transfer(self, buffer: list[int], offset: int, count: int) -> int:

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)​

def Transfer(self, buffer: list[int]) -> int:

Transfers data to/from the endpoint.

ParameterTypeDescription
bufferbyte[]The transfer buffer.

Returns int: The number of bytes successfully transferred.