87 uint64_t messageData = 0u;
89 float_t minimumStringSoc_perc = FLT_MAX;
90 float_t maximumStringSoc_perc = FLT_MIN;
91 float_t minimumStringSoe_perc = FLT_MAX;
92 float_t maximumStringSoe_perc = FLT_MIN;
93 uint32_t minimumStringEnergy_Wh = UINT32_MAX;
102 if (maximumStringSoc_perc < kpkCanShim->pTableSoc->maximumSoc_perc[s]) {
105 if (maximumStringSoe_perc < kpkCanShim->pTableSoe->maximumSoe_perc[s]) {
130 float_t packSoc_perc = 0.0f;
131 float_t packSoe_perc = 0.0f;
132 uint32_t packEnergyLeft_Wh = 0u;
147 packEnergyLeft_Wh = 0u;
151 float_t signalData = packSoc_perc;
152 float_t offset = 0.0f;
153 float_t factor = 100.0f;
154 signalData = (signalData + offset) * factor;
155 uint64_t data = (int64_t)signalData;
160 signalData = packSoe_perc;
163 signalData = (signalData + offset) * factor;
164 data = (int64_t)signalData;
169 signalData = packEnergyLeft_Wh;
172 signalData = (signalData + offset) * factor;
173 data = (int64_t)signalData;
180 factor = 1.0f / 0.025f;
181 signalData = (signalData + offset) * factor;
182 data = (int64_t)signalData;
193 #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_GetBatterySystemState(void)
Returns current battery system state (charging/discharging, resting or in relaxation phase)
uint32_t CANTX_PackStateEstimation(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for state estimation values
Header for the driver for the CAN module.
#define CANTX_PACK_STATE_ESTIMATION_ID_TYPE
#define CANTX_PACK_STATE_ESTIMATION_ID
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.
CAN_IDENTIFIER_TYPE_e idType
CAN_ENDIANNESS_e endianness
DATA_BLOCK_SOE_s * pTableSoe
DATA_BLOCK_SOC_s * pTableSoc
float_t minimumSoc_perc[BS_NR_OF_STRINGS]
float_t maximumSoc_perc[BS_NR_OF_STRINGS]
uint32_t minimumSoe_Wh[BS_NR_OF_STRINGS]
float_t maximumSoe_perc[BS_NR_OF_STRINGS]
float_t minimumSoe_perc[BS_NR_OF_STRINGS]