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

Detailed Description

The functions in this file are used to convert a CAN message identifier to J1939 specific values and vice versa.

+ Include dependency graph for j1939_msg.h:

Functions

uint32_t J1939_MsgIdFromPgn (uint16_t uwPriorityV, uint32_t ulPgnV, uint8_t ubDestAddrV, uint8_t ubSrcAddrV)
 
uint8_t J1939_MsgPageFromId (uint32_t ulIdentifierV)
 
uint32_t J1939_MsgPgnFromId (uint32_t ulIdentifierV)
 
uint8_t J1939_MsgPriorityFromId (uint32_t ulIdentifierV)
 

Function Documentation

◆ J1939_MsgIdFromPgn()

uint32_t J1939_MsgIdFromPgn ( uint16_t uwPriorityV,
uint32_t ulPgnV,
uint8_t ubDestAddrV,
uint8_t ubSrcAddrV )
Parameters
[in]uwPriorityV- Priority value
[in]ulPgnV- PGN value
[in]ubDestAddrV- Destination address
[in]ubSrcAddrV- Source address
Returns
Extended identifier value

This function calculates the CAN identifier with the supplied values for priority, Parameter Group Number (PGN) and source address. The parameter ubDestAddrV is only evaluated for PGN values less than 61440, i.e. the PDU format is less than 240.

◆ J1939_MsgPageFromId()

uint8_t J1939_MsgPageFromId ( uint32_t ulIdentifierV)
Parameters
[in]ulIdentifierV- Extended identifier value
Returns
Data page

This function calculates the data page value (0 to 3) from the passed CAN identifier value, given by ulIdentifierV.

◆ J1939_MsgPgnFromId()

uint32_t J1939_MsgPgnFromId ( uint32_t ulIdentifierV)

Calculate PGN.

Parameters
ulIdentifierV- Extended identifier value
Returns
PGN

This function calculates the Parameter Group number (PGN) from the passed CAN identifier value, given by ulIdentifierV.

◆ J1939_MsgPriorityFromId()

uint8_t J1939_MsgPriorityFromId ( uint32_t ulIdentifierV)

Calculate priority.

Parameters
ulIdentifierV- Extended identifier value
Returns
PGN

This function calculates the priority from the passed CAN identifier value, given by ulIdentifierV.