From e7f82bdf9269245e80e31cdbb4342440a9c4bf7f Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 4 Feb 2024 12:44:16 +0100 Subject: [PATCH 1/3] WiThrottle sendIntro after initial N message as well --- WiThrottle.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/WiThrottle.cpp b/WiThrottle.cpp index 244dfd8..018ab2b 100644 --- a/WiThrottle.cpp +++ b/WiThrottle.cpp @@ -187,6 +187,7 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) { } break; case 'N': // Heartbeat (2), only send if connection completed by 'HU' message + sendIntro(stream); StringFormatter::send(stream, F("*%d\n"), heartrateSent ? HEARTBEAT_SECONDS : HEARTBEAT_PRELOAD); // return timeout value break; case 'M': // multithrottle @@ -194,7 +195,7 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) { break; case 'H': // send initial connection info after receiving "HU" message if (cmd[1] == 'U') { - sendIntro(stream); + sendIntro(stream); } break; case 'Q': // @@ -498,12 +499,14 @@ void WiThrottle::getLocoCallback(int16_t locoid) { } void WiThrottle::sendIntro(Print* stream) { + if (introSent) // sendIntro only once + return; introSent=true; StringFormatter::send(stream,F("VN2.0\nHTDCC-EX\nRL0\n")); - StringFormatter::send(stream,F("HtDCC-EX v%S, %S, %S, %S\n"), F(VERSION), F(ARDUINO_TYPE), DCC::getMotorShieldName(), F(GITHUB_SHA)); - StringFormatter::send(stream,F("PTT]\\[Turnouts}|{Turnout]\\[THROW}|{2]\\[CLOSE}|{4\n")); - StringFormatter::send(stream,F("PPA%x\n"),TrackManager::getMainPower()==POWERMODE::ON); - // set heartbeat to 2 seconds because we need to sync the metadata (1 second is too short!) + StringFormatter::send(stream,F("HtDCC-EX v%S, %S, %S, %S\n"), F(VERSION), F(ARDUINO_TYPE), DCC::getMotorShieldName(), F(GITHUB_SHA)); + StringFormatter::send(stream,F("PTT]\\[Turnouts}|{Turnout]\\[THROW}|{2]\\[CLOSE}|{4\n")); + StringFormatter::send(stream,F("PPA%x\n"),TrackManager::getMainPower()==POWERMODE::ON); + // set heartbeat to 2 seconds because we need to sync the metadata (1 second is too short!) StringFormatter::send(stream,F("*%d\nHMConnecting..\n"), HEARTBEAT_PRELOAD); } From be40a7e274cd7eb907ca2fd75e26f2c707f885fd Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 4 Feb 2024 12:51:41 +0100 Subject: [PATCH 2/3] version 5.2.30 --- GITHUB_SHA.h | 2 +- version.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 8aa2bd8..56992fe 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202401212011Z" +#define GITHUB_SHA "devel-202402041151Z" diff --git a/version.h b/version.h index d44166a..c443179 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "5.2.29" +#define VERSION "5.2.30" +// 5.2.40 - Bugfix: WiThrottle sendIntro after initial N message as well // 5.2.29 - Added IO_I2CDFPlayer.h to support DFPLayer over I2C connected to NXP SC16IS750/SC16IS752 (currently only single UART for SC16IS752) // - Added enhanced IO_I2CDFPLayer enum commands to EXRAIL2.h // - Added PLAYSOUND alias of ANOUT to EXRAILMacros.h From 5f6e18e1e78620ea77a9b3bfe9e1d9dc740a5b8d Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 4 Feb 2024 13:50:07 +0100 Subject: [PATCH 3/3] remove mega328 from default build env list --- platformio.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 8767ef1..2630e6d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,7 +12,6 @@ default_envs = mega2560 uno - mega328 unowifiR2 nano samd21-dev-usb