queue fix
This commit is contained in:
@@ -210,11 +210,13 @@ void BoardInterface::customConsoleCommand(String cmd) {
|
|||||||
/**
|
/**
|
||||||
* Serialize parameters
|
* Serialize parameters
|
||||||
*/
|
*/
|
||||||
bool BoardInterface::serializeParamsToJson(File file) {
|
bool BoardInterface::serializeParamsToJson(File file, bool inclApiKey) {
|
||||||
|
|
||||||
StaticJsonDocument<1024> jsonData;
|
StaticJsonDocument<1024> jsonData;
|
||||||
|
|
||||||
jsonData["apiKey"] = liveData->settings.remoteApiKey;
|
if (inclApiKey)
|
||||||
|
jsonData["apiKey"] = liveData->settings.remoteApiKey;
|
||||||
|
|
||||||
jsonData["carType"] = liveData->settings.carType;
|
jsonData["carType"] = liveData->settings.carType;
|
||||||
jsonData["batTotalKwh"] = liveData->params.batteryTotalAvailableKWh;
|
jsonData["batTotalKwh"] = liveData->params.batteryTotalAvailableKWh;
|
||||||
jsonData["currTime"] = liveData->params.currentTime;
|
jsonData["currTime"] = liveData->params.currentTime;
|
||||||
@@ -238,7 +240,7 @@ bool BoardInterface::serializeParamsToJson(File file) {
|
|||||||
jsonData["cellMinV"] = liveData->params.batCellMinV;
|
jsonData["cellMinV"] = liveData->params.batCellMinV;
|
||||||
jsonData["cellMaxV"] = liveData->params.batCellMaxV;
|
jsonData["cellMaxV"] = liveData->params.batCellMaxV;
|
||||||
jsonData["bMinC"] = round(liveData->params.batMinC);
|
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["bHeatC"] = round(liveData->params.batHeaterC);
|
||||||
jsonData["bInletC"] = round(liveData->params.batInletC);
|
jsonData["bInletC"] = round(liveData->params.batInletC);
|
||||||
jsonData["bFanSt"] = liveData->params.batFanStatus;
|
jsonData["bFanSt"] = liveData->params.batFanStatus;
|
||||||
@@ -248,7 +250,7 @@ bool BoardInterface::serializeParamsToJson(File file) {
|
|||||||
jsonData["tmpC"] = round(liveData->params.bmsUnknownTempC);
|
jsonData["tmpC"] = round(liveData->params.bmsUnknownTempC);
|
||||||
jsonData["tmpD"] = round(liveData->params.bmsUnknownTempD);
|
jsonData["tmpD"] = round(liveData->params.bmsUnknownTempD);
|
||||||
|
|
||||||
jsonData["auxP"] = liveData->params.auxPerc;
|
jsonData["auxPerc"] = liveData->params.auxPerc;
|
||||||
jsonData["auxV"] = liveData->params.auxVoltage;
|
jsonData["auxV"] = liveData->params.auxVoltage;
|
||||||
jsonData["auxA"] = liveData->params.auxCurrentAmp;
|
jsonData["auxA"] = liveData->params.auxCurrentAmp;
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class BoardInterface {
|
|||||||
// Sdcard
|
// Sdcard
|
||||||
virtual bool sdcardMount() {return false; };
|
virtual bool sdcardMount() {return false; };
|
||||||
virtual void sdcardToggleRecording()=0;
|
virtual void sdcardToggleRecording()=0;
|
||||||
bool serializeParamsToJson(File file);
|
bool serializeParamsToJson(File file, bool inclApiKey = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BOARDINTERFACE_H
|
#endif // BOARDINTERFACE_H
|
||||||
|
|||||||
@@ -635,13 +635,13 @@ void loop() {
|
|||||||
} else {
|
} else {
|
||||||
line = line + ch;
|
line = line + ch;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Can send next command from queue to OBD
|
// Can send next command from queue to OBD
|
||||||
if (liveData->canSendNextAtCommand) {
|
if (liveData->canSendNextAtCommand) {
|
||||||
liveData->canSendNextAtCommand = false;
|
liveData->canSendNextAtCommand = false;
|
||||||
doNextAtCommand();
|
doNextAtCommand();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SIM800L_ENABLED
|
#ifdef SIM800L_ENABLED
|
||||||
if (liveData->params.lastDataSent + SIM800L_TIMER < liveData->params.currentTime && liveData->params.sim800l_enabled) {
|
if (liveData->params.lastDataSent + SIM800L_TIMER < liveData->params.currentTime && liveData->params.sim800l_enabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user