adding data age to battery data

This commit is contained in:
MalteSchm 2023-04-01 15:34:32 +02:00
parent d1e43c11b9
commit e514ef744b
2 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,8 @@
class BatteryClass { class BatteryClass {
public: public:
uint32_t lastUpdate;
float chargeVoltage; float chargeVoltage;
float chargeCurrentLimitation; float chargeCurrentLimitation;
float dischargeCurrentLimitation; float dischargeCurrentLimitation;

View File

@ -133,6 +133,7 @@ void PylontechCanReceiverClass::parseCanPackets()
Battery.stateOfCharge = this->readUnsignedInt16(rx_message.data); Battery.stateOfCharge = this->readUnsignedInt16(rx_message.data);
Battery.stateOfChargeLastUpdate = millis(); Battery.stateOfChargeLastUpdate = millis();
Battery.stateOfHealth = this->readUnsignedInt16(rx_message.data + 2); Battery.stateOfHealth = this->readUnsignedInt16(rx_message.data + 2);
Battery.lastUpdate = millis();
#ifdef PYLONTECH_DEBUG_ENABLED #ifdef PYLONTECH_DEBUG_ENABLED
MessageOutput.printf("[Pylontech] soc: %d soh: %d\n", MessageOutput.printf("[Pylontech] soc: %d soh: %d\n",