mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 21:01:25 +01:00
send some answer to loco enquire even if no locos are found
This commit is contained in:
parent
64a6412ce2
commit
76137ff24c
@ -219,7 +219,7 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'N': // Heartbeat (2), only send if connection completed by 'HU' message
|
case 'N': // Heartbeat (2), only send if connection completed by 'HU' message
|
||||||
StringFormatter::send(stream, F("*%d\n"), initSent ? HEARTBEAT_SECONDS : HEARBEAT_SECONDS/2); // return timeout value
|
StringFormatter::send(stream, F("*%d\n"), initSent ? HEARTBEAT_SECONDS : HEARTBEAT_SECONDS/2); // return timeout value
|
||||||
break;
|
break;
|
||||||
case 'M': // multithrottle
|
case 'M': // multithrottle
|
||||||
multithrottle(stream, cmd);
|
multithrottle(stream, cmd);
|
||||||
@ -242,7 +242,7 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) {
|
|||||||
|
|
||||||
|
|
||||||
// set heartbeat to 5 seconds because we need to sync the metadata (1 second is too short!)
|
// set heartbeat to 5 seconds because we need to sync the metadata (1 second is too short!)
|
||||||
StringFormatter::send(stream,F("*%d\n"), HEARBEAT_SECONDS/2);
|
StringFormatter::send(stream,F("*%d\n"), HEARTBEAT_SECONDS/2);
|
||||||
initSent = true;
|
initSent = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -417,9 +417,13 @@ void WiThrottle::locoAction(RingStream * stream, byte* aval, char throttleChar,
|
|||||||
case 'q':
|
case 'q':
|
||||||
if (aval[1]=='V' || aval[1]=='R' ) { //qV or qR
|
if (aval[1]=='V' || aval[1]=='R' ) { //qV or qR
|
||||||
// just flag the loco for broadcast and it will happen.
|
// just flag the loco for broadcast and it will happen.
|
||||||
|
bool foundone = false;
|
||||||
LOOPLOCOS(throttleChar, cab) {
|
LOOPLOCOS(throttleChar, cab) {
|
||||||
|
foundone = true;
|
||||||
myLocos[loco].broadcastPending=true;
|
myLocos[loco].broadcastPending=true;
|
||||||
}
|
}
|
||||||
|
if (!foundone)
|
||||||
|
StringFormatter::send(stream,F("HMCS loco list empty\n"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
|
Loading…
Reference in New Issue
Block a user