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

Detailed Description

Whenever it is necessary to identify a Parameter Group in the data field of a CAN data frame, it will be expressed in 24 bits. The 24-bit value is sent least significant byte first. The Parameter Group Number is a 24-bit value that has the following constituent components:

  • 6 bits set to zero
  • Extended Data Page bit
  • Data Page bit
  • PDU Format Field (8 bits)
  • PDU Specific Field (8 bits).

Within the stack, the PGN value is a 32 bit value.

+ Include dependency graph for j1939_pgn.h:

Functions

J1939_Status_tv J1939_PgnAddList (uint8_t ubNetV, J1939_PGN_Entry_ts *ptsPgnListV)
 
void J1939_PgnListUserInit (uint8_t ubNetV)
 
J1939_Status_tv J1939_PgnGetCycleTime (uint8_t ubNetV, uint32_t ulPgnV, uint16_t *puwTimeV)
 
J1939_Status_tv J1939_PgnRequest (uint8_t ubNetV, uint32_t ulPgnV, uint8_t ubDestAddrV)
 
J1939_Status_tv J1939_PgnSetCycleTime (uint8_t ubNetV, uint32_t ulPgnV, uint16_t uwTimeV)
 
J1939_Status_tv J1939_PgnSetDataSize (uint8_t ubNetV, uint32_t ulPgnV, uint16_t uwSizeV)
 

Function Documentation

◆ J1939_PgnAddList()

J1939_Status_tv J1939_PgnAddList ( uint8_t ubNetV,
J1939_PGN_Entry_ts * ptsPgnListV )
Parameters
[in]ubNetV- J1939 Network channel
[in]ptsPgnListV- Pointer to PGN list
Returns
eJ1939_ERR_NONE on success, negative J1939_Err_e value on failure

The function adds an application defined PGN list for the network defined by ubNetV. The list is an array of elements of structure J1939_PGN_Entry_s.

◆ J1939_PgnGetCycleTime()

J1939_Status_tv J1939_PgnGetCycleTime ( uint8_t ubNetV,
uint32_t ulPgnV,
uint16_t * puwTimeV )
Parameters
[in]ubNetV- J1939 Network channel
[in]ulPgnV- Parameter Group Number (PGN)
[in]puwTimeV- pointer to buffer for cycle time value
Returns
eJ1939_ERR_NONE on success, negative J1939_Err_e value on failure

The function retrieves the cycle time of a PGN defined by the parameter ulPgnV. If the PGN is available in the stored PGN list the function returns eJ1939_ERR_NONE.

◆ J1939_PgnListUserInit()

void J1939_PgnListUserInit ( uint8_t ubNetV)
Parameters
[in]ubNetV- J1939 Network channel
See also
J1939_PgnAddList()

This function is called when a PGN list is added to the J1939 protocol stack. It used to initialise application specific parameters related to the PGN list.

◆ J1939_PgnRequest()

J1939_Status_tv J1939_PgnRequest ( uint8_t ubNetV,
uint32_t ulPgnV,
uint8_t ubDestAddrV )
Parameters
[in]ubNetV- J1939 Network channel
ulPgnV- Parameter Group Number (PGN)
ubDestAddrV- Destination address
Returns
eJ1939_ERR_NONE on success, negative J1939_Err_e value on failure

The function sends a J1939 Request message (RQST) for a PGN defined by ulPgnV. The Request message is send to an ECU with address ubDestAddrV.

◆ J1939_PgnSetCycleTime()

J1939_Status_tv J1939_PgnSetCycleTime ( uint8_t ubNetV,
uint32_t ulPgnV,
uint16_t uwTimeV )
Parameters
[in]ubNetV- J1939 Network channel
[in]ulPgnV- Parameter Group Number (PGN)
[in]uwTimeV- cycle time
Returns
eJ1939_ERR_NONE on success, negative J1939_Err_e value on failure

The function modifies the cycle time of a PGN defined by the parameter ulPgnV. If the PGN is available in the stored PGN list the function returns eJ1939_ERR_NONE.

◆ J1939_PgnSetDataSize()

J1939_Status_tv J1939_PgnSetDataSize ( uint8_t ubNetV,
uint32_t ulPgnV,
uint16_t uwSizeV )
Parameters
[in]ubNetV- J1939 Network channel
[in]ulPgnV- Parameter Group Number (PGN)
[in]uwSizeV- Data size
Returns
eJ1939_ERR_NONE on success, negative J1939_Err_e value on failure

The function modifies the data size of a PGN defined by the parameter ulPgnV. If the PGN is available in the stored PGN list the function returns eJ1939_ERR_NONE.