• Home • Files • Structures         • Download

cp_test.h File Reference


Detailed Description

The CANpie test functions are used to verify the driver functionality on the CAN controller.

The following tests need to be defined:

  • remote frame reception / transmission
  • test for autobaud detection
  • test for error detection

Include dependency graph for cp_test.h:


Defines

#define CP_TEST_TRM_ID_STD   0x100
#define CP_TEST_TRM_ID_EXT   0x180A0100
#define CP_TEST_RCV_ID_STD   0x200
#define CP_TEST_RCV_ID_EXT   0x182C0200

Enumerations

enum  CP_TEST_CASE { CP_TEST_BUFFER_TRM_HDI = 1, CP_TEST_BUFFER_TRM_ALL, CP_TEST_BUFFER_TRM_EXT, CP_TEST_BUFFER_MIRROR_STD, CP_TEST_BUFFER_MIRROR_EXT, CP_TEST_BUFFER_COUNT_STD }

Functions

void CpTest_01 (_TsCpPort *ptsPortV)
void CpTest_02 (_TsCpPort *ptsPortV)
void CpTest_03 (_TsCpPort *ptsPortV)
void CpTest_04 (_TsCpPort *ptsPortV)
void CpTest_05 (_TsCpPort *ptsPortV)
void CpTest_06 (_TsCpPort *ptsPortV)

Define Documentation

#define CP_TEST_RCV_ID_EXT   0x182C0200

Defines the initial identifier that is used for Extended Frame message reception.

#define CP_TEST_RCV_ID_STD   0x200

Defines the initial identifier that is used for Standard Frame message reception.

#define CP_TEST_TRM_ID_EXT   0x180A0100

Defines the initial identifier that is used for Extended Frame message transmission.

#define CP_TEST_TRM_ID_STD   0x100

Defines the initial identifier that is used for Standard Frame message transmission.


Enumeration Type Documentation

Defines test cases.

The values of the enumeration CP_TEST_CASE are used to start and identify a specific test funtion.

Enumerator:
CP_TEST_BUFFER_TRM_HDI  Test case #1: check hardware description
CP_TEST_BUFFER_TRM_ALL  Test case #2: send on multiple buffers
CP_TEST_BUFFER_TRM_EXT  Test case #3: send Extended Frames
CP_TEST_BUFFER_MIRROR_STD  Test case #4: mirror Standard Frames
CP_TEST_BUFFER_MIRROR_EXT  Test case #5: mirror Extended Frames
CP_TEST_BUFFER_COUNT_STD  Test case #6: count Standard Frames


Function Documentation

void CpTest_01 ( _TsCpPort *  ptsPortV  ) 

Test number of message buffers.

Parameters:
ptsPortV Pointer to CAN port structure
The function evaluates the total number of available message buffers and reports the result via a CAN message. The identifier is defined by CP_TEST_TRM_ID_STD.

void CpTest_02 ( _TsCpPort *  ptsPortV  ) 

Test CAN 2.0A message transmission on multiple buffers.

Parameters:
ptsPortV Pointer to CAN port structure
The function sends CAN 2.0A messages on all available message buffers. The first message buffer uses the identifier CP_TEST_TRM_ID_STD, for the following an offset of 1 is added.

void CpTest_03 ( _TsCpPort *  ptsPortV  ) 

Test CAN 2.0B message transmission on multiple buffers.

Parameters:
ptsPortV Pointer to CAN port structure
The function sends CAN 2.0B messages on all available message buffers. The first message buffer uses the identifier CP_TEST_TRM_ID_EXT, for the following an offset of 1 is added.

void CpTest_04 ( _TsCpPort *  ptsPortV  ) 

Test CAN 2.0A message reception.

Parameters:
ptsPortV Pointer to CAN port structure
The function receives a CAN 2.0A message on the identifier defined by CP_TEST_RCV_ID_STD and mirrors the incoming data on the transmit message with the identifier CP_TEST_TRM_ID_STD.

void CpTest_05 ( _TsCpPort *  ptsPortV  ) 

Test CAN 2.0B message reception.

Parameters:
ptsPortV Pointer to CAN port structure
The function receives a CAN 2.0B message on the identifier defined by CP_TEST_RCV_ID_EXT and mirrors the incoming data on the transmit message with the identifier CP_TEST_TRM_ID_EXT.

void CpTest_06 ( _TsCpPort *  ptsPortV  ) 

Test CAN 2.0A message reception on multiple buffers.

Parameters:
ptsPortV Pointer to CAN port structure
The function receives CAN 2.0A messages on multiple identifiers. The total number of received messages is counted and reported.

void CpTestFail ( _U08  ubTestCaseV,
_TvCpStatus  tvStatusV 
)

Report test failure.

void CpTestSuccess ( _U08  ubTestCaseV  ) 

Report test success.


SourceForge.net Logo

© MicroControl GmbH & Co. KG

CANpie - V2.00