28#ifndef _WITHROTTLE_DEFS_HXX_
29#define _WITHROTTLE_DEFS_HXX_
140 static constexpr const int DEFAULT_PORT = 12090;
163 init.append(
"\n\nRL0");
164 init.append(2,
'\n');
166 init.append(2,
'\n');
167 init.append(
"PTT\n\n");
168 init.append(
"PRT\n\n");
169 init.append(
"RCC0\n\n");
171 init.append(2,
'\n');
185 string status(
"MTA");
187 status.append(
"<;>F");
188 status.append(1, state ?
'1' :
'0');
191 status.append(1,
'0' + number);
195 status.append(1,
'0' + (number / 10));
196 status.append(1,
'0' + (number % 10));
198 status.append(
"\n\n");
210 string status(
"MT+");
212 status.append(
"<;>\n\n");
213 for (
int i = 0; i <=28; ++i)
218 status.append(
"MTA");
220 status.append(
"<;>V0\n\nMTA");
222 status.append(
"<;>R1\n\nMTA");
224 status.append(
"<;>S1\n\n");
226 string status(
"TL6915\n\nTF00\n\nTF01\n\nTF02\n\nTF03\n\nTF04\n\nTF05\n\n");
227 status.append(
"TF06\n\nTF07\n\nTF08\n\nTF09\n\nTF010\n\nTF011\n\nTF012\n\n");
228 status.append(
"TF013\n\nTF014\n\nTF015\n\nTF016\n\nTF017\n\nTF018\n\n");
229 status.append(
"TF019\n\nTF020\n\nTF021\n\nTF022\n\nTF023\n\nTF024\n\n");
230 status.append(
"TF025\n\nTF026\n\nTF027\n\nTF028\n\nTV0\n\nTR1\n\nTs1\n\n");
Interface for a single throttle for running a train node.
uint16_t get_fn(uint32_t address) override
Command from the throttle.
CommandMultiType commandMultiType
type of multi throttle command
CommandType commandType
type of command
CommandType id_type
type of the dispatcher criteria
string train
The train description.
CommandSubType commandSubType
type of throttle command
string payload
the command payload
The interface definitions for WiThrottle.
static constexpr const char * TRACK_POWER_ON
Track power off string.
static string get_init_string()
Get the init command string.
static string get_function_status_string(const char *loco, int number, bool state)
Get the function status string.
static constexpr const char * HEARTBEAT_TIMEOUT
Heartbeat timeout string.
static constexpr const char * TRACK_POWER_OFF
Track power on string.
static string get_loco_status_string(openlcb::TractionThrottle *throttle, const char *loco)
Get the locomotive status command string.
static constexpr const char * TRACK_POWER_UNKNOWN
Track power unknown string.
static constexpr const char * PROTOCOL_VERSION
Protocol version string.
uint16_t address
14-bit DCC address
uint16_t addressType
true if long address, else short address
uint16_t inUse
reserved bit space
string name
display name of entry
LocoAddress address
locomotive adress
CommandType
type of command.
@ SET_ID
set the device id
@ SET_NAME
set the device name
@ SECONDARY
secondary throttle
@ TYPE_MASK
exact mask for dispatcher
@ HEARTBEAT
send hardbeat or set heartbeat on/off
@ HEX_PACKET
hex packet for command station
@ PANEL
send panel command
@ ROSTER
send roster command
@ PRIMARY
primary throttle
CommandSubType
type of throttle command.
@ SUBTYPE_MASK
exact mask for dispatcher
@ ADDR_ROSTER
set address from roster entry
@ QUERY
query about current speed, direction, etc...
@ IDLE
idle, set speed to 0
@ SS_MODE
set speed step mode
@ VELOCITY
velocity command
@ CONSIST_LEAD
consist lead from roster entry
@ ADDR_LONG
set long address
@ ADDR_SHORT
set short address
@ DISPATCH
dispatch a loco
CommandMultiType
type of multi throttle command.
@ REMOVE
remove a locomotive from the throttle
@ ADD
Add a locomotive to the throttle.
ServerState
Server state machine commands.
@ STATE_SUBCOMMAND
look for sub-command
@ STATE_MULTI_TYPE
look for the multi-throttle type
@ STATE_COMMAND
look for command
@ STATE_TRAIN
look for the train
@ STATE_PAYLOAD
look for data
@ STATE_NEXT
look for next command