From 8af0e5b45a7da8948394ac57cdf9f60d8fa8c419 Mon Sep 17 00:00:00 2001 From: Lubos Petrovic Date: Mon, 7 Dec 2020 07:57:16 +0100 Subject: [PATCH] queue fix --- BoardInterface.cpp | 10 ++++++---- BoardInterface.h | 2 +- evDash.ino | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/BoardInterface.cpp b/BoardInterface.cpp index daa7d28..b0be0a8 100644 --- a/BoardInterface.cpp +++ b/BoardInterface.cpp @@ -210,11 +210,13 @@ void BoardInterface::customConsoleCommand(String cmd) { /** * Serialize parameters */ -bool BoardInterface::serializeParamsToJson(File file) { +bool BoardInterface::serializeParamsToJson(File file, bool inclApiKey) { StaticJsonDocument<1024> jsonData; - jsonData["apiKey"] = liveData->settings.remoteApiKey; + if (inclApiKey) + jsonData["apiKey"] = liveData->settings.remoteApiKey; + jsonData["carType"] = liveData->settings.carType; jsonData["batTotalKwh"] = liveData->params.batteryTotalAvailableKWh; jsonData["currTime"] = liveData->params.currentTime; @@ -238,7 +240,7 @@ bool BoardInterface::serializeParamsToJson(File file) { jsonData["cellMinV"] = liveData->params.batCellMinV; jsonData["cellMaxV"] = liveData->params.batCellMaxV; jsonData["bMinC"] = round(liveData->params.batMinC); - jsonData["baxC"] = round(liveData->params.batMaxC); + jsonData["bMaxC"] = round(liveData->params.batMaxC); jsonData["bHeatC"] = round(liveData->params.batHeaterC); jsonData["bInletC"] = round(liveData->params.batInletC); jsonData["bFanSt"] = liveData->params.batFanStatus; @@ -248,7 +250,7 @@ bool BoardInterface::serializeParamsToJson(File file) { jsonData["tmpC"] = round(liveData->params.bmsUnknownTempC); jsonData["tmpD"] = round(liveData->params.bmsUnknownTempD); - jsonData["auxP"] = liveData->params.auxPerc; + jsonData["auxPerc"] = liveData->params.auxPerc; jsonData["auxV"] = liveData->params.auxVoltage; jsonData["auxA"] = liveData->params.auxCurrentAmp; diff --git a/BoardInterface.h b/BoardInterface.h index e122768..78f9160 100644 --- a/BoardInterface.h +++ b/BoardInterface.h @@ -51,7 +51,7 @@ class BoardInterface { // Sdcard virtual bool sdcardMount() {return false; }; virtual void sdcardToggleRecording()=0; - bool serializeParamsToJson(File file); + bool serializeParamsToJson(File file, bool inclApiKey = false); }; #endif // BOARDINTERFACE_H diff --git a/evDash.ino b/evDash.ino index 49e4f49..1fc6749 100644 --- a/evDash.ino +++ b/evDash.ino @@ -635,13 +635,13 @@ void loop() { } else { line = line + ch; } + } // Can send next command from queue to OBD if (liveData->canSendNextAtCommand) { liveData->canSendNextAtCommand = false; doNextAtCommand(); } - } #ifdef SIM800L_ENABLED if (liveData->params.lastDataSent + SIM800L_TIMER < liveData->params.currentTime && liveData->params.sim800l_enabled) {