57 #include "MockHL_can.h"
58 #include "Mockcan_cfg.h"
59 #include "Mockdatabase.h"
61 #include "Mockfoxmath.h"
62 #include "Mockftask.h"
68 #include "Mockqueue.h"
69 #include "Mocktest_can_mpu_prototype_queue_create_stub.h"
83 #define CANRX_NOT_PERIODIC (0u)
86 #define TEST_CANTX_ID_DUMMY (0x001)
87 #define TEST_CANTX_DUMMY_PERIOD_ms (100)
88 #define TEST_CANTX_DUMMY_PHASE_ms (0)
90 #define TEST_CANTX_DUMMY_MESSAGE \
92 .id = TEST_CANTX_ID_DUMMY, \
93 .dlc = CAN_DEFAULT_DLC, \
94 .endianness = CAN_LITTLE_ENDIAN, \
95 .idType = CAN_STANDARD_IDENTIFIER_11_BIT, \
98 .period = TEST_CANTX_DUMMY_PERIOD_ms, .phase = TEST_CANTX_DUMMY_PHASE_ms \
102 #define TEST_CANRX_ID_DUMMY (0x002)
104 #define TEST_CANRX_DUMMY_MESSAGE \
106 .id = TEST_CANRX_ID_DUMMY, \
107 .dlc = CAN_DEFAULT_DLC, \
108 .endianness = CAN_LITTLE_ENDIAN, \
109 .idType = CAN_STANDARD_IDENTIFIER_11_BIT, \
112 .period = CANRX_NOT_PERIODIC \
152 const uint8_t *
const kpkCanData,
193 canIsTxMessagePending_IgnoreAndReturn(0u);
194 canUpdateID_Ignore();
195 canTransmit_IgnoreAndReturn(0u);
201 canIsTxMessagePending_IgnoreAndReturn(0u);
202 canUpdateID_Ignore();
203 canTransmit_IgnoreAndReturn(0u);
211 canIsTxMessagePending_IgnoreAndReturn(1u);
213 for (uint8_t i = 0u; i < 32; i++) {
223 canIsTxMessagePending_IgnoreAndReturn(1u);
239 canIsTxMessagePending_ExpectAndReturn(pNode->
canNodeRegister, messageBox, 1u);
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
bool CAN_IsCurrentSensorCcPresent(uint8_t stringNumber)
get flag if CC message from current sensor is received.
CAN_STATE_s * TEST_CAN_GetCANState(void)
bool CAN_IsCurrentSensorPresent(uint8_t stringNumber)
set flag for presence of current sensor.
STD_RETURN_TYPE_e CAN_DataSend(CAN_NODE_s *pNode, uint32_t id, CAN_IDENTIFIER_TYPE_e idType, uint8 *pData)
Sends over CAN the data passed in parameters. This function goes over the message boxes and marks the...
void CAN_EnablePeriodic(bool command)
Enables periodic sending per CAN. This is used to prevent sending uninitialized data per CAN (e....
Header for the driver for the CAN module.
#define CAN_NR_OF_TX_MESSAGE_BOX
@ CAN_STANDARD_IDENTIFIER_11_BIT
@ DATA_BLOCK_ID_STATE_REQUEST
@ DATA_BLOCK_ID_CELL_VOLTAGE
@ DATA_BLOCK_ID_CURRENT_SENSOR
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
@ DATA_BLOCK_ID_CELL_TEMPERATURE
#define NULL_PTR
Null pointer.
canBASE_t * canNodeRegister
bool currentSensorCCPresent[BS_NR_OF_STRINGS]
bool currentSensorPresent[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
#define TEST_ASSERT_FAIL_ASSERT(_code_under_test)
assert whether assert macro has failed
static DATA_BLOCK_CELL_VOLTAGE_s can_tableCellVoltages
#define TEST_CANTX_ID_DUMMY
const CAN_RX_MESSAGE_TYPE_s can_rxMessages[]
void testDataSendNoMessagePending(void)
#define TEST_CANRX_DUMMY_MESSAGE
OS_QUEUE ftsk_imdCanDataQueue
static DATA_BLOCK_MIN_MAX_s can_tableMinimumMaximumValues
static DATA_BLOCK_OPEN_WIRE_s can_tableOpenWire
CAN_STATE_s * canTestState
volatile bool ftsk_allQueuesCreated
const uint8_t can_txLength
void testDataSendMessagePending(void)
void testDataSendInvalidIdentifierType(void)
void testIsCurrentSensorCcPresent(void)
const CAN_TX_MESSAGE_TYPE_s can_txMessages[]
const CAN_SHIM_s can_kShim
static DATA_BLOCK_CELL_TEMPERATURE_s can_tableTemperatures
const CAN_NODE_s can_node1
void testEnablePeriodic(void)
static uint32_t TEST_CANTX_DummyCallback(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
static uint32_t TEST_CANRX_DummyCallback(CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim)
const uint8_t can_rxLength
static DATA_BLOCK_STATE_REQUEST_s can_tableStateRequest
void testDataSendNullPointerAsData(void)
#define TEST_CANTX_DUMMY_MESSAGE
void testIsCurrentSensorPresent(void)
const CAN_NODE_s can_node2Isolated
void testDataSendNullPointerAsNode(void)
static DATA_BLOCK_CURRENT_SENSOR_s can_tableCurrentSensor
OS_QUEUE imd_canDataQueue
Header file for the version information that is generated by the toolchain.