Library

class NullStream : public Stream

TBA.

Public Functions

inline NullStream()

TBA.

inline int available()

TBA.

inline void flush()

TBA.

inline int peek()

TBA.

inline int read()

TBA.

inline size_t write(uint8_t c)

TBA.

Parameters:

c – TBA

inline size_t write(const uint8_t *buffer, size_t size)

TBA.

Parameters:
  • buffer – TBA

  • size – TBA

class WiThrottleProtocol

TBA.

WiThrottleProtocol

Public Functions

WiThrottleProtocol(bool server = false)

TBA.

void setDelegate(WiThrottleProtocolDelegate *delegate)

TBA.

Parameters:

delegate – TBA

void setLogStream(Stream *console)

TBA.

Parameters:

console – TBA

void setLogLevel(int level)

TBA.

Parameters:

level – 0 = off 1 = basic 2 = high

void setCommandsNeedLeadingCrLf(bool needed)

TBA.

Parameters:

needed – TBA

void connect(Stream *stream)

TBA.

Parameters:

stream – TBA

void connect(Stream *stream, int delayBetweenCommandsSent)

TBA.

Parameters:
  • stream – TBA

  • delayBetweenCommandsSent – TBA

void disconnect()

TBA.

void setDeviceName(String deviceName)

TBA.

Parameters:

deviceName – TBA

void setDeviceID(String deviceId)

TBA.

Parameters:

deviceId – TBA

bool check()

TBA.

void sendCommand(String cmd)

Send command to the Command Station.

Parameters:

cmd – Command to send

double getCurrentFastTime()

Get the current Fast Time value.

float getFastTimeRate()

Get the current Fast Time rate.

void requireHeartbeat(bool needed = true)

TBA.

Parameters:

needed – TBA

bool addLocomotive(String address)

TBA.

Parameters:

address – TBA

bool stealLocomotive(String address)

TBA.

Parameters:

address – TBA

bool releaseLocomotive(String address = "*")

TBA.

Parameters:

address – TBA

String getLeadLocomotive()

TBA.

String getLocomotiveAtPosition(int position)

TBA.

Parameters:

position – TBA

int getNumberOfLocomotives()

TBA.

bool addLocomotive(char multiThrottle, String address)

Add a specfied loco to a specified throttle. Will be added to the end of the consist of one or more locos are currently assigned to that Throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – Address of the loco to add.

bool stealLocomotive(char multiThrottle, String address)

Steal a specified loco. Only relevant to DigiTrax system.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – Address of the Loco to steal

bool releaseLocomotive(char multiThrottle, String address = "*")

Release one or all locos from a specied throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – Address of the loco to release. Default is to release all locos from the Throttle

String getLeadLocomotive(char multiThrottle)

Get the address of the loco in the lead positon, currently assigned to a specified Throttle.

Parameters:

multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

String getLocomotiveAtPosition(char multiThrottle, int position)

Get the address of the loco at a specified positon, currently assigned to a specified Throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • position – Postion of the loco to retrieve

int getNumberOfLocomotives(char multiThrottle)

Get the number of locos currently assigned to a specified Throttle.

Parameters:

multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

void setFunction(int funcnum, bool pressed)

Set a Function on the default (first) Throttle.

Parameters:
  • funcnum – Function Number

  • pressed – TBA

void setFunction(char multiThrottle, int funcnum, bool pressed)

Set a Function on the a specified Throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • funcnum – Function Number

  • pressed – TBA

void setFunction(char multiThrottle, String address, int funcnum, bool pressed)

Set a Function on a specified Loco only, on a specified Throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – DCC Address of the loco to set

  • funcnum – Function Number

  • pressed – TBA

bool setSpeed(int speed)

Set the speed of the default (first) Throttle.

Parameters:

speed – Speed 0-126

int getSpeed()

Get the speed of the default (first) Throttle.

bool setDirection(Direction direction)

Set the direction of the default (first) Throttle.

Parameters:

direction – Direction. One of - Reverse = 0, Forward = 1

Direction getDirection()

Get the direction of the default (first) Throttle.

bool setSpeed(char multiThrottle, int speed)

Set the speed of the a specified Throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • speed – Speed 0-126

bool setSpeed(char multiThrottle, int speed, bool forceSend)

Set the speed of the a specified Throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • speed – Speed 0-126

  • forceSend – Option to force the command to be sent, even if the protocol thinks it is at that speed

int getSpeed(char multiThrottle)

Get the speed of the a specified Throttle.

Parameters:

multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

bool setDirection(char multiThrottle, Direction direction)

Set the direction of the a specified Throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • direction – Direction. One of - Reverse = 0, Forward = 1

bool setDirection(char multiThrottle, Direction direction, bool forceSend)

Set the direction of the a specified Throttle, with the option to force the send.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • direction – Direction. One of - Reverse = 0, Forward = 1

  • forceSend – Option to force the command to be sent, even if the protocol thinks it is in that Direction

bool setDirection(char multiThrottle, String address, Direction direction)

Set the direction of a specific locomotive on a specified Throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – DCC Address of the loco to set

  • direction – Direction. One of - Reverse = 0, Forward = 1

bool setDirection(char multiThrottle, String address, Direction direction, bool ForceSend)

et the direction of a specific locomotive on a specified Throttle, with the option to force the send

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – DCC Address of the loco to set

  • direction – Direction. One of - Reverse = 0, Forward = 1

  • ForceSend – Option to force the command to be sent, even if the protocol thinks it is in that Direction

Direction getDirection(char multiThrottle)

Get the direction of a specific throttle.

Parameters:

multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

Direction getDirection(char multiThrottle, String address)

Get the direction of a specific locomotives on a specific throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – DCC Address of the loco to get

void emergencyStop(char multiThrottle)

Emergency Stop all locomotives on a specific throttle.

Parameters:

multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

void emergencyStop(char multiThrottle, String address)

Emergency Stop a specific locomotives on a specific throttle.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – DCC Address of the loco to stop

void setTrackPower(TrackPower state)

Set the state of a Track Power.

Parameters:

state – State required. One of - PowerOff = 0, PowerOn = 1

void emergencyStop()

Emergency Stop all locomotives on the default (first) throttle.

bool setTurnout(String address, TurnoutAction action)

Set the state of a Turnout/Point.

Parameters:
  • address – Identifier of the Turnout/Point

  • action – Action to perform on the Turnout/Point. one of - TurnoutClose = 0, TurnoutThrow = 1, TurnoutToggle = 2

bool setRoute(String address)

Set (activate) a Route.

Parameters:

address – Identifier of the Route to activate

int getMultiThrottleIndex(char multiThrottle)

Get the Throttle index number from a char Throttle Id. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

Parameters:

multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

long getLastServerResponseTime()

Get the last time that the server sent a resonse to the client.

Public Members

bool clockChanged

TBA.

String currentDeviceName

TBA.

bool heartbeatChanged

Recrdes if the server heatbeat value has changed.

std::vector<String> locomotives[6]

Used to record the locos in a consist (on each Throttle)

std::vector<Direction> locomotivesFacing[6]

Used to record the direction the locos in a consist (on each Throttle) are facing.

Private Functions

bool processCommand(char *c, int len)

Process an incoming command from the Command Station.

bool processLocomotiveAction(char multiThrottle, char *c, int len)

Process an incoming command from the Command Station - specific to locomotives.

Parameters:
  • multithrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • c – Command to process

  • len – length of the command

bool processFastTime(char *c, int len)

Process an incoming fast time command from the Command Station.

Parameters:
  • c – Command/information to process

  • len – length of the command/information

bool processHeartbeat(char *c, int len)

Process an incoming Heartbeat command from the Command Station.

Parameters:
  • c – Information to process

  • len – length of the command/information

bool processRosterFunctionList(char multiThrottle, char *c, int len)

Process an incoming Roster command from the Command Station.

Parameters:
  • multithrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • c – Command to process

  • len – length of the command

void processProtocolVersion(char *c, int len)

Process an incoming Protocol information from the Command Station.

Parameters:
  • c – Protocol information to process

  • len – length of the command/information

void processServerType(char *c, int len)

Process an incoming Server Type information from the Command Station.

Parameters:
  • c – Information to process

  • len – length of the information

void processServerDescription(char *c, int len)

Process an incoming Server Description information from the Command Station.

Parameters:
  • c – Information to process

  • len – length of the information

void processMessage(char *c, int len)

Process an incoming Broadcast Message from the Command Station.

Parameters:
  • c – Message to process

  • len – length of the message

void processAlert(char *c, int len)

Process an incoming Broadcast Alert from the Command Station.

Parameters:
  • c – Alert message to process

  • len – length of the Alert message

void processWebPort(char *c, int len)

Process an incoming Web Port information from the Command Station. The port that serves HTTP. This can be used to retrieve loco images.

Parameters:
  • c – Message to process

  • len – length of the message

void processRosterList(char *c, int len)

Process an incoming Roster List from the Command Station. This is the complete list of all the locos in the Roster.

Parameters:
  • c – Roster list to process

  • len – length of the list

void processTurnoutList(char *c, int len)

Process an incoming Turnout/Points List from the Command Station. This is the complete list of all the locos in the Roster.

Parameters:
  • c – Turnout/Points list to process

  • len – length of the list

void processRouteList(char *c, int len)

Process an incoming Routes List from the Command Station. This is the complete list of all the locos in the Roster.

Parameters:
  • c – Routes list to process

  • len – length of the list

void processTrackPower(char *c, int len)

Process an incoming Track Power information from the Command Station.

Parameters:
  • c – Information to process

  • len – length of the information

void processFunctionState(char multiThrottle, const String &functionData)

TBA.

Parameters:
  • multithrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • functionData – TBA

void processRosterFunctionListEntries(char multiThrottle, const String &s)

TBA.

Parameters:
  • multithrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • s – TBA

void processSpeedSteps(char multiThrottle, const String &speedStepData)

TBA.

Parameters:
  • multithrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • speedStepData – TBA

void processDirection(char multiThrottle, const String &directionStr)

Process an incoming Direction command from the Command Station for a specific multiThrottle.

Parameters:
  • multithrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • directionStr – TBA

void processSpeed(char multiThrottle, const String &speedData)

Process an incoming Speed command from the Command Station for a specific multiThrottle.

Parameters:

speedData – TBA

void processAddRemove(char multiThrottle, char *c, int len)

Process an incoming command from the Command Station to add or remove on or more locomotives from a specified multiThrottle.

Parameters:
  • multithrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • c – Command to process

  • len – length of the command

void processStealNeeded(char multiThrottle, char *c, int len)

Process an incoming command from the Command Station to to advice that a steal command is required to aquire a locomotive. Specific the DigiTrack Command Stations only.

Parameters:
  • multithrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • c – Command to process

  • len – length of the command

void processTurnoutAction(char *c, int len)

TBA.

Parameters:
  • c – Command to process

  • len – length of the command

void processRouteAction(char *c, int len)

TBA.

Parameters:
  • c – Command to process

  • len – length of the command

bool checkFastTime()

TBA.

Outbound Commands ^^^^^^^^^^^^^^^^^

bool checkHeartbeat()

TBA

void sendDelayedCommand(String cmd)

TBA.

Parameters:

cmd – TBA

void setCurrentFastTime(const String &s)

TBA.

Parameters:

s – TBA

void resetChangeFlags()
void init()

Private Members

bool server
Stream *stream
int logLevel = 1
Stream *console
NullStream nullStream
String outboundBuffer
double outboundCmdsTimeLastSent
int outboundCmdsMininumDelay
bool commandsNeedLeadingCrLf = false
WiThrottleProtocolDelegate *delegate = NULL
char inputbuffer[32767]
ssize_t nextChar
unsigned long heartbeatTimer
int heartbeatPeriod
unsigned long timeLastLocoAcquired
unsigned long fastTimeTimer
double currentFastTime
float currentFastTimeRate
bool locomotiveSelected[MAX_WIT_THROTTLES] = {false, false, false, false, false, false}
String currentAddress[MAX_WIT_THROTTLES]
int currentSpeed[MAX_WIT_THROTTLES]
int speedSteps[MAX_WIT_THROTTLES]
Direction currentDirection[MAX_WIT_THROTTLES]
String mostRecentTurnout
TurnoutState mostRecentTurnoutState
long lastServerResponseTime
class WiThrottleProtocolDelegate

Class for the Delegate methods.

Public Functions

inline virtual void receivedVersion(String version)

Delegate method to receive the WiThrottle version.

Parameters:

version – Version Number

inline virtual void receivedServerType(String type)

Delegate method to receive the Server Type.

Parameters:

type – Server Type

inline virtual void receivedServerDescription(String description)

Delegate method to receive the Server Decription.

Parameters:

description – Server Description

inline virtual void receivedMessage(String message)

Delegate method to receive a message from the Withrottle Server.

Parameters:

message – Message Content

inline virtual void receivedAlert(String alert)

Delegate method to receive a broadcast Alert from the Withrottle Server.

Parameters:

alert – Broadcast Alert content

inline virtual void receivedRosterEntries(int rosterSize)

Delegate method to receive the total number of Roster Entries from the Withrottle Server.

Parameters:

rosterSize – total number of Roster Entries from the Withrottle Server

inline virtual void receivedRosterEntry(int index, String name, int address, char length)

Delegate method to receive the a single Roster Entry from the Withrottle Server.

Parameters:
  • index – sequence number

  • name – Roster entry name

  • address – DCC Address

  • length – S|L Short or Long address

inline virtual void receivedTurnoutEntries(int turnoutListSize)

Delegate method to receive the total number of Turnouts/Points Entries from the Withrottle Server.

Parameters:

turnoutListSize – total number of Turnout/Point Entries in the Withrottle Server

inline virtual void receivedTurnoutEntry(int index, String sysName, String userName, int state)

Delegate method to receive the a single Turnout/Point Entry from the Withrottle Server.

Parameters:
  • index – sequence number

  • sysName – Turnout/Point system name

  • userName – Turnout/Point entry name

  • state – current state of the Turnout/Point

inline virtual void receivedRouteEntries(int routeListSize)

Delegate method to receive the total number of Routes Entries from the Withrottle Server.

Parameters:

routeListSize – total number of Route Entries in the Withrottle Server

inline virtual void receivedRouteEntry(int index, String sysName, String userName, int state)

Delegate method to receive a single Route Entry from the Withrottle Server.

Parameters:
  • index – sequence number

  • sysName – Route system name

  • userName – Route entry name

  • state – current state of the Route

inline virtual void fastTimeChanged(uint32_t time)

Delegate method to receive.

Parameters:

time – TBA

inline virtual void fastTimeRateChanged(double rate)

Delegate method to receive.

Parameters:

rate – Rate of the fast time cloce

inline virtual void heartbeatConfig(int seconds)

Delegate method to receive the the Server heartbeat configurtio from the Withrottle Server.

Parameters:

seconds – Number of seconds betwean heartbeats

inline virtual void receivedFunctionState(uint8_t func, bool state)

Delegate method to receive from the Withrottle Server.

Parameters:
  • func – TBA

  • state – TBA

inline virtual void receivedRosterFunctionList(String functions[MAX_FUNCTIONS])

Delegate method to receive from the Withrottle Server.

Parameters:

functions – TBA

inline virtual void receivedFunctionStateMultiThrottle(char multiThrottle, uint8_t func, bool state)

Delegate method to receive from the Withrottle Server.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • func – TBA

  • state – TBA

inline virtual void receivedRosterFunctionListMultiThrottle(char multiThrottle, String functions[MAX_FUNCTIONS])

Delegate method to receive from the Withrottle Server.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • functions – TBA

inline virtual void receivedSpeed(int speed)

Delegate method to receive the speed for the default (first) throttle from the Withrottle Server.

Parameters:

speed – TBA

inline virtual void receivedDirection(Direction dir)

Delegate method to receive the direction for the default (first) throttle from the Withrottle Server.

Parameters:

dir – TBA

inline virtual void receivedSpeedSteps(int steps)

Delegate method to receive the number of speed steps for the default (first) throttle from the Withrottle Server.

Parameters:

steps – 28 or 128

inline virtual void receivedSpeedMultiThrottle(char multiThrottle, int speed)

Delegate method to receive the speed for a specific throttle from the Withrottle Server.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • speed – TBA

inline virtual void receivedDirectionMultiThrottle(char multiThrottle, Direction dir)

Delegate method to receive the direction for a specific throttle from the Withrottle Server.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • dir – TBA

inline virtual void receivedSpeedStepsMultiThrottle(char multiThrottle, int steps)

Delegate method to receive the speed steps for a specific throttle from the Withrottle Server.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • steps – 28 or 128

inline virtual void receivedWebPort(int port)

Delegate method to receive from the Withrottle Server.

Parameters:

port – TBA

inline virtual void receivedTrackPower(TrackPower state)

Delegate method to receive from the Withrottle Server.

Parameters:

state – TBA

inline virtual void addressAdded(String address, String entry)

Delegate method to receive from the Withrottle Server.

Parameters:
  • address – DCC Address

  • entry – TBA

inline virtual void addressRemoved(String address, String command)

Delegate method to receive from the Withrottle Server.

Parameters:
  • address – DCC Address

  • command – TBA

inline virtual void addressStealNeeded(String address, String entry)

Delegate method to receive from the Withrottle Server.

Parameters:
  • address – DCC Address

  • entry – TBA

inline virtual void addressAddedMultiThrottle(char multiThrottle, String address, String entry)

Delegate method to receive from the Withrottle Server.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – DCC Address

  • entry – TBA

inline virtual void addressRemovedMultiThrottle(char multiThrottle, String address, String command)

Delegate method to receive from the Withrottle Server.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – DCC Address

  • command – TBA

inline virtual void addressStealNeededMultiThrottle(char multiThrottle, String address, String entry)

Delegate method to receive from the Withrottle Server.

Parameters:
  • multiThrottle – Which Throttle. Supported multiThrottle codes are ‘T’ ‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ only.

  • address – DCC Address

  • entry – TBA

inline virtual void receivedTurnoutAction(String systemName, TurnoutState state)

Delegate method to receive from the Withrottle Server.

Parameters:
  • systemName – System name of the Turnout/Point

  • state – TBA

inline virtual void receivedRouteAction(String systemName, RouteState state)

Delegate method to receive from the Withrottle Server.

Parameters:
  • systemName – System name of the Route

  • state – TBA

file WiThrottleProtocol.cpp
#include <vector>
#include “WiThrottleProtocol.h

Variables

static const int MIN_SPEED = 0
static const int MAX_SPEED = 126
static const char *rosterSegmentDesc[] = {"Name", "Address", "Length"}
file WiThrottleProtocol.h
#include “Arduino.h”
#include <vector>

Defines

PROPERTY_SEPARATOR
ENTRY_SEPARATOR
SEGMENT_SEPARATOR
NEWLINE
CR
DEFAULT_MULTITHROTTLE
ALL_LOCOS_ON_THROTTLE
MAX_WIT_THROTTLES
MAX_FUNCTIONS

Enums

enum Direction

Loco/Throttle Direction options.

Values:

enumerator Reverse
enumerator Forward
enum TrackPower

Track Power options.

Values:

enumerator PowerOff
enumerator PowerOn
enumerator PowerUnknown
enum TurnoutState

Turnout/Point state options.

Values:

enumerator TurnoutClosed
enumerator TurnoutThrown
enumerator TurnoutUnknown
enumerator TurnoutInconsistent
enum TurnoutAction

Turnout/Point action options.

Values:

enumerator TurnoutClose
enumerator TurnoutThrow
enumerator TurnoutToggle
enum RouteState

Route states.

Values:

enumerator RouteActive
enumerator RouteInactive
enumerator RouteInconsistent
dir /home/runner/work/WiThrottleProtocol/WiThrottleProtocol/src