58 #include "Mockafe_plausibility.h"
59 #include "Mockdatabase.h"
60 #include "Mockfassert.h"
61 #include "Mockmxm_17841b.h"
62 #include "Mockmxm_41b_register_map.h"
63 #include "Mockmxm_battery_management.h"
64 #include "Mockmxm_cfg.h"
65 #include "Mockmxm_crc8.h"
66 #include "Mockmxm_registry.h"
83 .allowStartup =
false,
84 .operationRequested =
false,
85 .firstMeasurementDone =
false,
86 .stopRequested =
false,
87 .openwireRequested =
false,
88 .undervoltageAlert =
false,
90 .mxmVoltageCellCounter = 0,
98 .deviceAddress = 0x00,
153 uint8_t voltRxBuffer = 0;
185 MXM_5XSetStateRequest_ExpectAndReturn(
201 OS_GetTickCount_ExpectAndReturn(0u);
225 const uint8_t registerAddress = 21u;
228 .regAddress = registerAddress,
233 MXM_5XSetStateRequest_ExpectAndReturn(
235 bool functionReturnValue;
237 TEST_ASSERT_EQUAL(
false, functionReturnValue);
242 bool functionReturnValue;
244 TEST_ASSERT_EQUAL(
false, functionReturnValue);
249 OS_GetTickCount_ExpectAndReturn(0u);
250 bool functionReturnValue;
252 TEST_ASSERT_EQUAL(
false, functionReturnValue);
260 bool functionReturnValue;
262 TEST_ASSERT_EQUAL(
true, functionReturnValue);
280 DATA_Write_1_DataBlock_IgnoreAndReturn(
STD_OK);
284 for (uint8_t i = 0u; i < 8; i = i + 2) {
287 for (uint8_t i = 1u; i < 8; i = i + 2) {
Database configuration header.
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
#define NULL_PTR
Null pointer.
STD_RETURN_TYPE_e MXM_ProcessOpenWire(const MXM_MONITORING_INSTANCE_s *const kpkInstance)
Processes the retrieved information on openwire.
bool must_check_return MXM_HandleStateReadall(MXM_MONITORING_INSTANCE_s *pInstance, MXM_REG_NAME_e registerName, MXM_STATEMACHINE_OPERATION_STATES_e nextState)
Handle the statemachine-transactions for a READALL.
STD_RETURN_TYPE_e TEST_MXM_ParseVoltagesIntoDB(MXM_MONITORING_INSTANCE_s *pInstance)
MXM_MONITORING_STATE_e must_check_return MXM_MonGetVoltages(MXM_MONITORING_INSTANCE_s *pState, MXM_REG_NAME_e regAddress)
Encapsulation for reading voltages from a register.
void MXM_StateMachine(MXM_MONITORING_INSTANCE_s *pInstance)
Main state-machine implementation.
STD_RETURN_TYPE_e TEST_MXM_ParseVoltageReadallTest(MXM_MONITORING_INSTANCE_s *pInstance)
void MXM_HandleStateWriteall(MXM_MONITORING_INSTANCE_s *pInstance, MXM_STATEMACHINE_OPERATION_STATES_e nextState)
Handle the statemachine-transactions for a WRITEALL.
STD_RETURN_TYPE_e TEST_MXM_ParseVoltageReadall(uint8_t *voltRxBuffer, uint16_t voltRxBufferLength, MXM_DATA_STORAGE_s *datastorage, MXM_CONVERSION_TYPE_e conversionType)
Headers for the driver for the MAX17841B ASCI and MAX1785x monitoring chip.
MXM_MODEL_ID_e
Type of monitoring device.
#define MXM_MAXIMUM_NR_OF_CELLS_PER_MODULE
Maximum number of cells per module.
@ MXM_STATEMACH_5X_READALL
@ MXM_STATEMACH_5X_WRITEALL
@ MXM_5X_STATE_UNPROCESSED
MXM_REG_NAME_e
MAX1785x register names.
DATA_BLOCK_HEADER_s header
uint8_t openwire[BS_NR_OF_STRINGS][BS_NR_OF_MODULES *(BS_NR_OF_CELLS_PER_MODULE+1u)]
MXM_5X_COMMAND_PAYLOAD_s batteryCmdBuffer
MXM_STATEMACHINE_OPERATION_STATES_e operationSubstate
uint8_t rxBuffer[MXM_RX_BUFFER_LENGTH]
MXM_STATEMACHINE_STATES_e state
MXM_5X_INSTANCE_s *const pInstance5X
MXM_5X_STATE_REQUEST_STATUS_e requestStatus5x
DATA_BLOCK_OPEN_WIRE_s *const pOpenwire_table
#define TEST_ASSERT_PASS_ASSERT(_code_under_test)
assert whether assert macro has passed
#define TEST_ASSERT_FAIL_ASSERT(_code_under_test)
assert whether assert macro has failed
uint16_t commandBuffer[10]
void testMXM_ParseVoltageReadallTestNullPointer(void)
void testMXM_HandleStateWriteallInvalidRequestStatus(void)
void testMXM_HandleStateReadallError(void)
const bool mxm_allowSkippingPostInitSelfCheck
void testMXM_HandleStateReadallInvalidRequestStatus(void)
void testMXM_HandleStateReadallNullPointer(void)
void testMXM_StateMachineNullPointer(void)
void testMXM_HandleStateWriteallError(void)
void testMXM_HandleStateWriteallEntry(void)
MXM_MODEL_ID_e MXM_GetModelIdOfDaisyChain(void)
returns the model ID of the daisy chain
void MXM_StateMachineOperation(MXM_MONITORING_INSTANCE_s *pState)
State-Machine implementation for operation state.
void testMXM_ParseVoltagesIntoDBNullPointer(void)
void testMXM_HandleStateReadallUnsent(void)
static MXM_MONITORING_INSTANCE_s mxm_instance
void testMXM_ParseVoltageReadallTest(void)
void testTEST_MXM_ParseVoltageReadallNullPointer(void)
void testMXM_HandleStateReadallUnprocessed(void)
static MXM_MODEL_ID_e modelForTest
void testMXM_MonGetVoltagesNullPointer(void)
void testMXM_ProcessOpenWire1SatelliteAlternatingPattern(void)
void testMXM_HandleStateWriteallProcessed(void)
void testMXM_ProcessOpenWireNullPointer(void)
static DATA_BLOCK_OPEN_WIRE_s mxm_tableOpenWire
void testMXM_HandleStateReadallProcessed(void)
void testMXM_HandleStateWriteallUnprocessed(void)
void testMXM_HandleStateWriteallNullPointer(void)