J1939 Documentation
Version 4.16.00
Loading...
Searching...
No Matches
j1939_tp.h File Reference

Detailed Description

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.

+ Include dependency graph for j1939_tp.h:

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)
 

Function Documentation

◆ J1939_TpSendAck()

void J1939_TpSendAck ( uint8_t ubNetV,
uint8_t ubAckTypeV,
uint8_t ubGrpFunctionV,
uint32_t ulPgnV )
Parameters
[in]ubNetVCAN network
[in]ubAckTypeVAcknowledgement type
[in]ubGrpFunctionVGroup Function value
[in]ulPgnVParameter Group number
See also
J1939_TpSetAckSourceAddress()

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().

◆ J1939_TpSendPgn()

void J1939_TpSendPgn ( uint8_t ubNetV,
uint8_t ubDestAddrV,
uint32_t ulPgnV )
Parameters
[in]ubNetVCAN network
[in]ubDestAddrVDestination address
[in]ulPgnVParameter Group number

The function sends a PGN via the Transport protocol.

◆ J1939_TpSetAckSourceAddress()

void J1939_TpSetAckSourceAddress ( uint8_t ubNetV,
uint8_t ubAddressV )
Parameters
[in]ubNetVCAN network
[in]ubAddressVSource address
See also
J1939_TpSendAck()

The function sets the source address of the ECU which has issued an ACK message.