From d013078c1f423b3da1e3fc3848a7b93083833fb7 Mon Sep 17 00:00:00 2001 From: Charl Wentzel Date: Wed, 5 Jul 2017 18:20:29 +0200 Subject: [PATCH] Bug fixes: - Remove LogStr var - Create new Command Str before adding parameters - Set Watchdog name correctly --- WatchdogCore.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WatchdogCore.cpp b/WatchdogCore.cpp index 2757ed5..1368a9b 100644 --- a/WatchdogCore.cpp +++ b/WatchdogCore.cpp @@ -20,16 +20,16 @@ // Global vars extern char * ProcessName; -char LogStr[1000]; // Temporary var to create log messages, globally available to save on memory operations //--------------------------------------------------------------------------- CWatchdogCore::CWatchdogCore( const char * WatchdogName, const int pInterval, CLogCore * pLog, EDebugLevel pDebugLevel ) : - CFunctionCore( Name, pLog, pDebugLevel, OUT_NORMAL ) + CFunctionCore( WatchdogName, pLog, pDebugLevel, OUT_NORMAL ) { // Create protocol Protocol = new CLiteProtocol( 50, '\x01', '\x02', '\x00' ); - Protocol->AppendParam( Name, strlen(Name) ); + Protocol->NewCommandStr(); + Protocol->AppendParam( WatchdogName, strlen(WatchdogName) ); Protocol->AppendParam( ProcessName, strlen(ProcessName) ); Protocol->AppendParam( "ping", 4 );