diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index c3895f7..9e2cf5f 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -503,8 +503,10 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) return; case 'c': // SEND METER RESPONSES - // No longer supported because of multiple tracks See and - break; + // No longer useful because of multiple tracks See and + if (params>0) break; + TrackManager::reportObsoleteCurrent(stream); + return; case 'Q': // SENSORS Sensor::printAll(stream); diff --git a/TrackManager.cpp b/TrackManager.cpp index 8521889..33d1d8a 100644 --- a/TrackManager.cpp +++ b/TrackManager.cpp @@ -424,6 +424,15 @@ POWERMODE TrackManager::getProgPower() { return POWERMODE::OFF; } +void TrackManager::reportObsoleteCurrent(Print* stream) { + // This function is for backward JMRI compatibility only + // It reports the first track only, as main, regardless of track settings. + // + int maxCurrent=track[0]->raw2mA(track[0]->getRawCurrentTripValue()); + StringFormatter::send(stream, F("\n"), + track[0]->raw2mA(track[0]->getCurrentRaw(false)), maxCurrent, maxCurrent); +} + void TrackManager::reportCurrent(Print* stream) { StringFormatter::send(stream,F("