J1939 Documentation
Version 4.16.00
|
Transport protocol functions are described as a part of the data link layer with the recognition that Transport protocol functionality is subdivided into two major functions: Message Packetization and Reassembly as well as Connection Management.
The CAN Data Frame includes an 8-byte data field. Because the individual packets which comprise a large message must be identified individually so that they may be reassembled correctly, the first byte of the data field is defined as the sequence number of the packet. Individual message packets are assigned a sequence number of 1 to 255. This yields a maximum message size of (255 packets * 7 bytes/packet =) 1785 bytes (see J1939_TP_SIZE_MAX).
The j1939_tp.c implements the Connection Management and the Message Packetization for PDU1 formats. The handling of Broadcast Announce Messages is implemented inside the j1939_bam.h file.
Functions | |
void | J1939_TpSendPgn (uint8_t ubNetV, uint8_t ubDestAddrV, uint32_t ulPgnV) |
void | J1939_TpSendAck (uint8_t ubNetV, uint8_t ubAckTypeV, uint8_t ubGrpFunctionV, uint32_t ulPgnV) |
void | J1939_TpSetAckSourceAddress (uint8_t ubNetV, uint8_t ubAddressV) |
void J1939_TpSendAck | ( | uint8_t | ubNetV, |
uint8_t | ubAckTypeV, | ||
uint8_t | ubGrpFunctionV, | ||
uint32_t | ulPgnV ) |
[in] | ubNetV | CAN network |
[in] | ubAckTypeV | Acknowledgement type |
[in] | ubGrpFunctionV | Group Function value |
[in] | ulPgnV | Parameter Group number |
The function sends a positive or negative ACK message, depending on the ubAckTypeV value. The value is defined by the enumeration J1939_ACK_Type_e.
If the function is called by the application it is required to set the source address of the ECU which has issued the ACK message by J1939_TpSetAckSourceAddress().
void J1939_TpSendPgn | ( | uint8_t | ubNetV, |
uint8_t | ubDestAddrV, | ||
uint32_t | ulPgnV ) |
[in] | ubNetV | CAN network |
[in] | ubDestAddrV | Destination address |
[in] | ulPgnV | Parameter Group number |
The function sends a PGN via the Transport protocol.
void J1939_TpSetAckSourceAddress | ( | uint8_t | ubNetV, |
uint8_t | ubAddressV ) |
[in] | ubNetV | CAN network |
[in] | ubAddressV | Source address |
The function sets the source address of the ECU which has issued an ACK message.