J1939 Documentation
Version 4.16.00
|
This modules provides a tunnel via a CAM11 and CAM21 message to an existing CANopen Slave Protocol Stack. Please note that the symbol J1939_COS_TUNNEL must be set to 1 in order to enable this functionality.
The CANopen Slave Protocol Stack and the J1939 Protocol Stack can be initialised on the same CAN interface, but they can not run at the same time on a physical CAN interface. This means when the J1939 Protocol Stack is started by calling J1939_MgrStart(), the corresponding CANopen function CosMgrStart() shall not be called.
The tunnel provides an interface to the CANopen Slave object dictionary. The CAM11 message emulates a CANopen SDO service request, the CAM21 message emulates the CANopen SDO service response. The following example depicts the PDU exchange between an ECU with source address 1 running the CANopen Slave protocol stack and a J1939 tool running on ECU address 8. The J1939 tool starts a request on object 1000h:00h using the CAM11 PDU.
The tunnel is available when the handler ECU_PgnCAM11() and ECU_PgnCAM21() are added to a PGN list.
Functions | |
int16_t | ECU_PgnCAM11 (uint8_t *pubDataV, uint16_t uwSizeV, uint8_t ubSrcAddrV, uint8_t ubNetV) |
int16_t | ECU_PgnCAM21 (uint8_t *pubDataV, uint16_t uwSizeV, uint8_t ubSrcAddrV, uint8_t ubNetV) |
int16_t ECU_PgnCAM11 | ( | uint8_t * | pubDataV, |
uint16_t | uwSizeV, | ||
uint8_t | ubSrcAddrV, | ||
uint8_t | ubNetV ) |
[in] | pubDataV | Pointer to SDO request data |
[in] | uwSizeV | Size of data |
[in] | ubSrcAddrV | Source address |
[in] | ubNetV | J1939 Network channel |
The function adds a handler for SDO request messages between the J1939 Protocol Stack and the CANopen Slave Protocol Stack.
int16_t ECU_PgnCAM21 | ( | uint8_t * | pubDataV, |
uint16_t | uwSizeV, | ||
uint8_t | ubSrcAddrV, | ||
uint8_t | ubNetV ) |
[in] | pubDataV | Pointer to SDO request data |
[in] | uwSizeV | Size of data |
[in] | ubSrcAddrV | Source address |
[in] | ubNetV | J1939 Network channel |
The function adds a handler for SDO response messages between the CANopen Slave Protocol Stack and the J1939 Protocol Stack.