1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-26 17:46:14 +01:00

Fix T commands (#59)

Fix <H ..> response giving 128 instead of 1 for active status
This commit is contained in:
Asbelos 2020-11-18 12:34:02 +00:00 committed by GitHub
parent 9ee5dc1600
commit 258113c580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -515,7 +515,7 @@ bool DCCEXParser::parseT(Print *stream, int params, int p[])
for (Turnout *tt = Turnout::firstTurnout; tt != NULL; tt = tt->nextTurnout) for (Turnout *tt = Turnout::firstTurnout; tt != NULL; tt = tt->nextTurnout)
{ {
gotOne = true; gotOne = true;
StringFormatter::send(stream, F("<H %d %d>"), tt->data.id, tt->data.tStatus & STATUS_ACTIVE); StringFormatter::send(stream, F("<H %d %d>"), tt->data.id, (tt->data.tStatus & STATUS_ACTIVE)!=0);
} }
return gotOne; // will <X> if none found return gotOne; // will <X> if none found
} }
@ -532,7 +532,7 @@ bool DCCEXParser::parseT(Print *stream, int params, int p[])
if (!tt) if (!tt)
return false; return false;
tt->activate(p[1]); tt->activate(p[1]);
StringFormatter::send(stream, F("<H %d %d>"), tt->data.id, tt->data.tStatus & STATUS_ACTIVE); StringFormatter::send(stream, F("<H %d %d>"), tt->data.id, (tt->data.tStatus & STATUS_ACTIVE)!=0);
} }
return true; return true;