Add separate web datalayer

This commit is contained in:
Daniel Öster 2024-10-11 13:50:25 +03:00
parent 742f51c658
commit d096caf9bb
6 changed files with 74 additions and 20 deletions

View file

@ -1,6 +1,7 @@
#include "../include.h"
#ifdef TESLA_BATTERY
#include "../datalayer/datalayer.h"
#include "../datalayer/datalayer_web.h" //For Advanced Battery Insights webpage
#include "../devboard/utils/events.h"
#include "TESLA-BATTERY.h"
@ -341,6 +342,15 @@ void update_values_battery() { //This function maps all the values fetched via
}
#endif // TESLA_MODEL_3Y_BATTERY
// Update webserver datalayer
datalayer_web.tesla.status_contactor = battery_contactor;
datalayer_web.tesla.hvil_status = battery_hvil_status;
datalayer_web.tesla.packContNegativeState = battery_packContNegativeState;
datalayer_web.tesla.packContPositiveState = battery_packContPositiveState;
datalayer_web.tesla.packContactorSetState = battery_packContactorSetState;
datalayer_web.tesla.packCtrsClosingAllowed = battery_packCtrsClosingAllowed;
datalayer_web.tesla.pyroTestInProgress = battery_pyroTestInProgress;
#ifdef DEBUG_VIA_USB
printFaultCodesIfActive();