88 float minimumStringSoc_perc = FLT_MAX;
89 float maximumStringSoc_perc = FLT_MIN;
90 float minimumStringSoe_perc = FLT_MAX;
91 float maximumStringSoe_perc = FLT_MIN;
92 uint32_t minimumStringEnergy_Wh = UINT32_MAX;
101 if (maximumStringSoc_perc < kpkCanShim->pTableSox->maximumSoc_perc[s]) {
104 if (maximumStringSoe_perc < kpkCanShim->pTableSox->maximumSoe_perc[s]) {
129 float packSoc_perc = 0.0f;
130 float packSoe_perc = 0.0f;
131 uint32_t packEnergyLeft_Wh = 0u;
146 packEnergyLeft_Wh = 0u;
150 float signalData = packSoc_perc;
152 float factor = 100.0f;
153 signalData = (signalData + offset) * factor;
154 uint64_t data = (int64_t)signalData;
159 signalData = packSoe_perc;
162 signalData = (signalData + offset) * factor;
163 data = (int64_t)signalData;
168 signalData = packEnergyLeft_Wh;
171 signalData = (signalData + offset) * factor;
172 data = (int64_t)signalData;
179 factor = 1.0f / 0.025f;
180 signalData = (signalData + offset) * factor;
181 data = (int64_t)signalData;
204 uint64_t message = 0;
209 const uint8_t stringNumber = *pMuxId;
213 uint64_t data = (uint64_t)stringNumber;
220 signalData = (signalData + offset) * factor;
221 data = (int64_t)signalData;
229 signalData = (signalData + offset) * factor;
230 data = (int64_t)signalData;
238 signalData = (signalData + offset) * factor;
239 data = (int64_t)signalData;
251 signalData = (signalData + offset) * factor;
252 data = (int64_t)signalData;
260 signalData = (signalData + offset) * factor;
261 data = (int64_t)signalData;
269 signalData = (signalData + offset) * factor;
270 data = (int64_t)signalData;
290 #ifdef UNITY_UNIT_TEST
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
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
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_PACK_VALUES_s * pTablePackValues
DATA_BLOCK_SOX_s * pTableSox
int32_t stringCurrent_mA[BS_NR_OF_STRINGS]
float maximumSoc_perc[BS_NR_OF_STRINGS]
float averageSoc_perc[BS_NR_OF_STRINGS]
float minimumSoe_perc[BS_NR_OF_STRINGS]
float minimumSoc_perc[BS_NR_OF_STRINGS]
float maximumSoe_perc[BS_NR_OF_STRINGS]
uint32_t minimumSoe_Wh[BS_NR_OF_STRINGS]