1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

add turnout, sensor and output states to 's'tatus message (#108)

* add support for FireBox_Mk1, reduce heartbeat, separate eStop time

* make match master

* make match master

* Update defines.h

* FIX: return WiThrottle speedstep, not DCC speedstep, in response to speed change request.

Should close #104

* use int, not byte for witSpeed

* add turnout, sensor and output states to 's'tatus message
This commit is contained in:
mstevetodd
2020-12-27 10:20:11 -05:00
committed by GitHub
parent 5f21716055
commit 9d92fd9451
3 changed files with 13 additions and 4 deletions

View File

@@ -445,9 +445,11 @@ void DCCEXParser::parse(Print *stream, byte *com, bool blocking)
case 's': // <s>
StringFormatter::send(stream, F("<p%d>"), DCCWaveform::mainTrack.getPowerMode() == POWERMODE::ON);
StringFormatter::send(stream, F("<iDCC-EX V-%S / %S / %S G-%S>"), F(VERSION), F(ARDUINO_TYPE), DCC::getMotorShieldName(), F(GITHUB_SHA));
parseT(stream, 0, p); //send all Turnout states
Output::printAll(stream); //send all Output states
Sensor::printAll(stream); //send all Sensor states
// TODO Send stats of speed reminders table
// TODO send status of turnouts etc etc
return;
return;
case 'E': // STORE EPROM <E>
EEStore::store();
@@ -589,7 +591,7 @@ bool DCCEXParser::parseT(Print *stream, int params, int p[])
{
switch (params)
{
case 0: // <T> show all turnouts
case 0: // <T> list all turnout states
{
bool gotOne = false;
for (Turnout *tt = Turnout::firstTurnout; tt != NULL; tt = tt->nextTurnout)
@@ -644,7 +646,7 @@ bool DCCEXParser::parseS(Print *stream, int params, int p[])
StringFormatter::send(stream, F("<O>"));
return true;
case 0: // <S> lit sensor states
case 0: // <S> list sensor states
if (Sensor::firstSensor == NULL)
return false;
for (Sensor *tt = Sensor::firstSensor; tt != NULL; tt = tt->nextSensor)