From 133c65bc4246236889eccffa18e73820c433eb8a Mon Sep 17 00:00:00 2001 From: Neil McKechnie Date: Fri, 20 Aug 2021 15:43:03 +0100 Subject: [PATCH] Report Turnout configuration in old and new formats. JMRI currently isn't aware of the newer types of turnout in DCC++EX, so when it receives the definitions of turnouts it barfs on them. It still knows a turnout exists, but isn't able to display its full configuration. For DCC Accessory turnouts, the configuration message has changed so that it includes the DCC string (to distinguish them from other types of turnout). To enable current and older versions of JMRI to continue working with DCC turnouts, CS now reports the old and new formats, i.e. and . It currently accepts the first one and ignores the second one, but in the fullness of time it might accept the second one too. --- Turnouts.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Turnouts.h b/Turnouts.h index 32a8a94..0a05dca 100644 --- a/Turnouts.h +++ b/Turnouts.h @@ -344,6 +344,10 @@ public: StringFormatter::send(stream, F("\n"), _turnoutData.id, (((_dccTurnoutData.address-1) >> 2)+1), ((_dccTurnoutData.address-1) & 3), _turnoutData.closed ^ useLegacyTurnoutBehaviour); + // Also report using classic DCC++ syntax for DCC accessory turnouts + StringFormatter::send(stream, F("\n"), _turnoutData.id, + (((_dccTurnoutData.address-1) >> 2)+1), ((_dccTurnoutData.address-1) & 3), + _turnoutData.closed ^ useLegacyTurnoutBehaviour); } // Load a DCC turnout definition from EEPROM. The common Turnout data has already been read at this point.