Table of Contents

Interface ILocoControl

Namespace
CommandStation
Assembly
CommandStation.Abstractions.dll

Driving a locomotive: speed, direction, functions, and locomotive status notifications.

public interface ILocoControl

Methods

DriveAsync(ushort, DccSpeedMode, DrivingDirection, ushort)

Task DriveAsync(ushort locoAddress, DccSpeedMode speedMode, DrivingDirection direction, ushort speed)

Parameters

locoAddress ushort
speedMode DccSpeedMode
direction DrivingDirection
speed ushort

Returns

Task

EmergencyStopAsync(ushort)

Task EmergencyStopAsync(ushort locoAddress)

Parameters

locoAddress ushort

Returns

Task

PurgeAsync(ushort)

Task PurgeAsync(ushort locoAddress)

Parameters

locoAddress ushort

Returns

Task

RequestLocoInfoAsync(ushort)

Task RequestLocoInfoAsync(ushort locoAddress)

Parameters

locoAddress ushort

Returns

Task

SetFunctionAsync(ushort, ushort, FunctionToggleType)

Task SetFunctionAsync(ushort locoAddress, ushort functionIndex, FunctionToggleType toggleType)

Parameters

locoAddress ushort
functionIndex ushort
toggleType FunctionToggleType

Returns

Task

Events

LocoInfoReceived

event EventHandler<LocoInfoData>? LocoInfoReceived

Event Type

EventHandler<LocoInfoData>