From 582d30916ec0555596da27983ae29a4f3cd56cb9 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Wed, 29 Dec 2021 15:13:37 +0000 Subject: [PATCH] Withrottle connect speedup --- WiThrottle.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/WiThrottle.cpp b/WiThrottle.cpp index 3b9bd67..bec51a5 100644 --- a/WiThrottle.cpp +++ b/WiThrottle.cpp @@ -133,8 +133,12 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) { exRailSent=true; #ifdef RMFT_ACTIVE RMFT2::emitWithrottleRouteList(stream); -#endif +#endif + // allow heartbeat to slow down once all metadata sent + StringFormatter::send(stream,F("*%d\n"),HEARTBEAT_SECONDS); } + + } while (cmd[0]) { @@ -199,10 +203,11 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) { 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"),DCCWaveform::mainTrack.getPowerMode()==POWERMODE::ON); - StringFormatter::send(stream,F("*%d\n"),HEARTBEAT_SECONDS); #ifdef RMFT_ACTIVE RMFT2::emitWithrottleRoster(stream); #endif + // set heartbeat to 1 second because we need to sync the metadata + StringFormatter::send(stream,F("*1\n")); initSent = true; } break;