87 float minimumStringSoc_perc = FLT_MAX;
88 float maximumStringSoc_perc = FLT_MIN;
89 float minimumStringSoe_perc = FLT_MAX;
90 float maximumStringSoe_perc = FLT_MIN;
91 uint32_t minimumStringEnergy_Wh = UINT32_MAX;
98 for (uint8_t stringNumber = 0u; stringNumber <
BS_NR_OF_STRINGS; stringNumber++) {
100 if (maximumStringSoc_perc < kpkCanShim->pTableSox->maximumSoc_perc[stringNumber]) {
103 if (maximumStringSoe_perc < kpkCanShim->pTableSox->maximumSoe_perc[stringNumber]) {
113 for (uint8_t stringNumber = 0u; stringNumber <
BS_NR_OF_STRINGS; stringNumber++) {
128 float packSoc_perc = 0.0f;
129 float packSoe_perc = 0.0f;
130 uint32_t packEnergyLeft_Wh = 0u;
145 packEnergyLeft_Wh = 0u;
149 float signalData = packSoc_perc;
151 float factor = 100.0f;
152 signalData = (signalData + offset) * factor;
153 uint64_t data = (int64_t)signalData;
158 signalData = packSoe_perc;
161 signalData = (signalData + offset) * factor;
162 data = (int64_t)signalData;
167 signalData = packEnergyLeft_Wh;
170 signalData = (signalData + offset) * factor;
171 data = (int64_t)signalData;
178 factor = 1.0f / 0.025f;
179 signalData = (signalData + offset) * factor;
180 data = (int64_t)signalData;
203 uint64_t message = 0;
208 const uint8_t stringNumber = *pMuxId;
212 uint64_t data = (uint64_t)stringNumber;
219 signalData = (signalData + offset) * factor;
220 data = (int64_t)signalData;
228 signalData = (signalData + offset) * factor;
229 data = (int64_t)signalData;
237 signalData = (signalData + offset) * factor;
238 data = (int64_t)signalData;
250 signalData = (signalData + offset) * factor;
251 data = (int64_t)signalData;
259 signalData = (signalData + offset) * factor;
260 data = (int64_t)signalData;
268 signalData = (signalData + offset) * factor;
269 data = (int64_t)signalData;
289 #ifdef UNITY_UNIT_TEST
uint8_t BMS_GetNumberOfConnectedStrings(void)
Returns number of connected strings.
bool BMS_IsStringClosed(uint8_t stringNumber)
Returns string state (closed or open)
BMS_CURRENT_FLOW_STATE_e BMS_GetCurrentFlowDirection(int32_t current_mA)
Get current flow direction, current value as function parameter.
BMS_CURRENT_FLOW_STATE_e BMS_GetBatterySystemState(void)
Returns current battery system state (charging/discharging, resting or in relaxation phase)
uint32_t CAN_TxStateEstimation(uint32_t id, uint8_t dlc, CAN_ENDIANNESS_e endianness, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for state estimation values
uint32_t CAN_TxStringStateEstimation(uint32_t id, uint8_t dlc, CAN_ENDIANNESS_e endianness, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for string state estimation
enum CAN_ENDIANNESS CAN_ENDIANNESS_e
void CAN_TxSetMessageDataWithSignalData(uint64_t *pMessage, uint64_t bitStart, uint8_t bitLength, uint64_t canSignal, CAN_ENDIANNESS_e endianness)
Puts CAN signal data in a 64-bit variable. This function is used to compose a 64-bit CAN message....
void CAN_TxSetCanDataWithMessageData(uint64_t message, uint8_t *pCanData, CAN_ENDIANNESS_e endianness)
Copy CAN data from a 64-bit variable to 8 bytes. This function is used to copy a 64-bit CAN message t...
Headers for the helper functions for the CAN module.
#define DATA_READ_DATA(...)
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
math library for often used math functions
#define NULL_PTR
Null pointer.
DATA_BLOCK_SOX_s * pTableSox
DATA_BLOCK_PACK_VALUES_s * pTablePackValues
int32_t stringCurrent_mA[BS_NR_OF_STRINGS]
float maximumSoe_perc[BS_NR_OF_STRINGS]
float minimumSoe_perc[BS_NR_OF_STRINGS]
float minimumSoc_perc[BS_NR_OF_STRINGS]
float averageSoc_perc[BS_NR_OF_STRINGS]
float maximumSoc_perc[BS_NR_OF_STRINGS]
uint32_t minimumSoe_Wh[BS_NR_OF_STRINGS]