Table of Contents

Interface ITransport

Namespace
CommandStation.Transport
Assembly
CommandStation.Abstractions.dll

A protocol-agnostic byte pipe to a command station. Implementations may use any medium (UDP, TCP, serial, …) and deliver received bytes in arbitrary chunk sizes.

public interface ITransport

Properties

IsConnected

bool IsConnected { get; }

Property Value

bool

Methods

ConnectAsync()

Opens the underlying connection and begins receiving.

Task ConnectAsync()

Returns

Task

DisconnectAsync()

Closes the underlying connection.

Task DisconnectAsync()

Returns

Task

SendAsync(ReadOnlyMemory<byte>)

Sends the given bytes to the command station.

Task SendAsync(ReadOnlyMemory<byte> data)

Parameters

data ReadOnlyMemory<byte>

Returns

Task

Events

OnBytesReceived

event EventHandler<BytesReceivedEventArgs>? OnBytesReceived

Event Type

EventHandler<BytesReceivedEventArgs>

OnConnectionChanged

event EventHandler<ConnectionChangedEventArgs>? OnConnectionChanged

Event Type

EventHandler<ConnectionChangedEventArgs>