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

add checks for broken cab ID

This commit is contained in:
Harald Barth
2023-05-08 00:19:59 +02:00
parent df7b890758
commit 3759fc2a1a
2 changed files with 6 additions and 0 deletions

View File

@@ -286,6 +286,8 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
if (direction < 0 || direction > 1)
break; // invalid direction code
if (cab > 10239 || cab < 0)
break; // beyond DCC range
DCC::setThrottle(cab, tspeed, direction);
if (params == 4) // send obsolete format T response