diff --git a/AppInventor/BluetoothHeaterMenu.aia b/AppInventor/BluetoothHeaterMenu.aia index 91e83d8..640bdd4 100644 Binary files a/AppInventor/BluetoothHeaterMenu.aia and b/AppInventor/BluetoothHeaterMenu.aia differ diff --git a/Arduino/BTCDieselHeater/src/Protocol/Protocol.cpp b/Arduino/BTCDieselHeater/src/Protocol/Protocol.cpp index a753f2d..db0dfdd 100644 --- a/Arduino/BTCDieselHeater/src/Protocol/Protocol.cpp +++ b/Arduino/BTCDieselHeater/src/Protocol/Protocol.cpp @@ -336,7 +336,7 @@ const char* Runstates [] PROGMEM = { const char* CProtocolPackage::getRunStateStr() const { - uint8_t runstate = Heater.getRunState(); + uint8_t runstate = getRunState(); UPPERLIMIT(runstate, 10); if(runstate == 2 && getPump_Actual() == 0) { // split runstate 2 - glow, then fuel runstate = 9; @@ -371,7 +371,7 @@ const char* ErrstatesEx [] PROGMEM = { "E-04: Pump fault", // E-04 "E-05: Overheat", // E-05 "E-06: Motor fault", // E-06 - "E-07: Comms fault", // E-07 + "E-07: No heater comms", // E-07 "E-08: Flame out", // E-08 "E-09: Temp sense", // E-09 "E-10: Ignition fail", // E-10 SmartError manufactured state - sensing runstate 2 -> >5 @@ -382,7 +382,7 @@ const char* ErrstatesEx [] PROGMEM = { const char* CProtocolPackage::getErrStateStr() const { - uint8_t errstate = Heater.getErrState(); + uint8_t errstate = getErrState(); UPPERLIMIT(errstate, 13); return Errstates[errstate]; } @@ -390,7 +390,7 @@ CProtocolPackage::getErrStateStr() const const char* CProtocolPackage::getErrStateStrEx() const { - uint8_t errstate = Heater.getErrState(); + uint8_t errstate = getErrState(); UPPERLIMIT(errstate, 13); return ErrstatesEx[errstate]; } @@ -412,4 +412,13 @@ CProtocolPackage::reportFrames(bool isOEM) DebugReportFrame("BTC:", Controller, TERMINATE_BTC_LINE ? "\r\n" : " "); } DebugReportFrame("HTR:", Heater, "\r\n"); -} \ No newline at end of file +} + +int +CProtocolPackage::getErrState() const +{ + if(getBlueWireStat() & 0x01) + return 8; // force E-07 - we're not seeing heater data + else + return Heater.getErrState(); +} diff --git a/Arduino/BTCDieselHeater/src/Protocol/Protocol.h b/Arduino/BTCDieselHeater/src/Protocol/Protocol.h index cb03df5..f442ca4 100644 --- a/Arduino/BTCDieselHeater/src/Protocol/Protocol.h +++ b/Arduino/BTCDieselHeater/src/Protocol/Protocol.h @@ -214,7 +214,7 @@ public: void set(const CProtocol& htr, const CProtocol& ctl) { Heater = htr; Controller = ctl; }; int getRunState() const { return Heater.getRunState(); }; const char* getRunStateStr() const; - int getErrState() const { return Heater.getErrState(); }; + int getErrState() const; const char* getErrStateStr() const; const char* getErrStateStrEx() const; float getBattVoltage() const { return Heater.getVoltage_Supply(); }; diff --git a/Arduino/BTCDieselHeater/src/Utility/BTC_JSON.cpp b/Arduino/BTCDieselHeater/src/Utility/BTC_JSON.cpp index bd60c00..fdb3e8d 100644 --- a/Arduino/BTCDieselHeater/src/Utility/BTC_JSON.cpp +++ b/Arduino/BTCDieselHeater/src/Utility/BTC_JSON.cpp @@ -145,14 +145,8 @@ bool makeJsonString(CModerator& moderator, char* opStr, int len) bSend |= moderator.addJson("TempBody", getHeaterInfo().getTemperature_HeatExchg(), root); bSend |= moderator.addJson("RunState", getHeaterInfo().getRunState(), root); bSend |= moderator.addJson("RunString", getHeaterInfo().getRunStateStr(), root); // verbose it up! - if(getBlueWireStat() & 0x01) { - bSend |= moderator.addJson("ErrorState", 8, root ); // force E-07 - bSend |= moderator.addJson("ErrorString", "E-07: No heater data", root); - } - else { - bSend |= moderator.addJson("ErrorState", getHeaterInfo().getErrState(), root ); - bSend |= moderator.addJson("ErrorString", getHeaterInfo().getErrStateStrEx(), root); // verbose it up! - } + bSend |= moderator.addJson("ErrorState", getHeaterInfo().getErrState(), root ); + bSend |= moderator.addJson("ErrorString", getHeaterInfo().getErrStateStrEx(), root); // verbose it up! bSend |= moderator.addJson("Thermostat", getHeaterInfo().isThermostat(), root ); bSend |= moderator.addJson("PumpFixed", getHeaterInfo().getPump_Fixed(), root ); bSend |= moderator.addJson("PumpMin", getHeaterInfo().getPump_Min(), root );