* adding data age to battery data * Add battery enabled flag * Webapi and websocket api for Battery * Webinterface for battery * fixed bug due to naming inconsistencies * cleaned up rounding * dist update * change typename to uppercase * reverting to original file
46 lines
978 B
C++
46 lines
978 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
class BatteryClass {
|
|
public:
|
|
uint32_t lastUpdate;
|
|
|
|
float chargeVoltage;
|
|
float chargeCurrentLimitation;
|
|
float dischargeCurrentLimitation;
|
|
uint16_t stateOfCharge;
|
|
uint32_t stateOfChargeLastUpdate;
|
|
uint16_t stateOfHealth;
|
|
float voltage;
|
|
float current;
|
|
float temperature;
|
|
bool alarmOverCurrentDischarge;
|
|
bool alarmUnderTemperature;
|
|
bool alarmOverTemperature;
|
|
bool alarmUnderVoltage;
|
|
bool alarmOverVoltage;
|
|
|
|
bool alarmBmsInternal;
|
|
bool alarmOverCurrentCharge;
|
|
|
|
|
|
bool warningHighCurrentDischarge;
|
|
bool warningLowTemperature;
|
|
bool warningHighTemperature;
|
|
bool warningLowVoltage;
|
|
bool warningHighVoltage;
|
|
|
|
bool warningBmsInternal;
|
|
bool warningHighCurrentCharge;
|
|
char manufacturer[9];
|
|
bool chargeEnabled;
|
|
bool dischargeEnabled;
|
|
bool chargeImmediately;
|
|
|
|
private:
|
|
};
|
|
|
|
extern BatteryClass Battery;
|