From 369a75f958ad1e428e7c0ce01922587fe7a52a25 Mon Sep 17 00:00:00 2001 From: FrightRisk <37218136+FrightRisk@users.noreply.github.com> Date: Mon, 26 Oct 2020 12:57:37 -0400 Subject: [PATCH] Fix return values for outputs and sensors ( and responses --- DCCEXParser.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 712313c..027e6c9 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -436,10 +436,17 @@ bool DCCEXParser::parseZ(Print *stream, int params, int p[]) case 3: // Output::create(p[0], p[1], p[2], 1); + if (!Output::create(p[0], p[1], p[2], 1)) + return false; + StringFormatter::send(stream, F("")); return true; case 1: // return Output::remove(p[0]); + if (!Output::remove(p[0])) + return false; + StringFormatter::send(stream, F("")); + return true; case 0: // { @@ -548,11 +555,18 @@ bool DCCEXParser::parseS(Print *stream, int params, int p[]) { case 3: // create sensor. pullUp indicator (0=LOW/1=HIGH) Sensor::create(p[0], p[1], p[2]); + if (!Sensor::create(p[0], p[1], p[2])) + return false; + StringFormatter::send(stream, F("")); return true; case 1: // S id> remove sensor if (Sensor::remove(p[0])) return true; + if (!Sensor::remove(p[0])) + return false; + StringFormatter::send(stream, F("")); + return true; break; case 0: // lit sensor states