kolins-cz / Smart-BMS-Bluetooth-ESP32

Program to read out and display data from xiaoxiang Smart BMS over Bluetooth Low Energy
99 stars 28 forks source link

Variable CapacityRemainAh has the wrong type uint16_t #6

Closed gmbo closed 5 months ago

gmbo commented 3 years ago

Wenn ich zu einer 200Ah Batterie verbinde, erhalte ich ungültige Werte für die Kapazität, da da die Variable CapacityRemainAh mit uint16_t zu klein dimensioniert ist. Sie sollte mit uint32_t in den Files mydatatypes.h Zeile 25 uint32_t CapacityAh; und BMS_process_data.ino
Zeile 59 output->CapacityRemainAh = ((uint32_t)two_ints_into16(data[4], data[5])) * 10; deklariert werden.

If I connect to a 200Ah battery, I get invalid values for the capacity, because there the variable CapacityRemainAh with uint16_t is dimensioned too small. It should be defined with uint32_t in the files mydatatypes.h Line 25 uint32_t CapacityAh; and BMS_process_data.ino
Line 59 output->CapacityRemainAh = ((uint32_t)two_ints_into16(data[4], data[5])) * 10; must be declared.