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

Detailed Description

Address configuration is the method by which a particular CA determines the source address it will use for Address Claim. For the purposes of the Address Claim process, there are two capabilities: Single Address Capable and Arbitrary Address Capable. These are distinguished by the value in the Arbitrary Address Capable field at the high-order position in the CA’s NAME.

+ Include dependency graph for j1939_nmt.h:

Data Structures

struct  J1939_Name_s
 

Enumerations

enum  J1939_Name_e {
  eJ1939_NAME_SMALLER = 1 ,
  eJ1939_NAME_EQUAL ,
  eJ1939_NAME_GREATER
}
 

Functions

void J1939_NmtEventClaimAddess (uint8_t ubNetV, uint8_t ubSrcAddrV, uint8_t *pubDataV)
 
J1939_Name_tsJ1939_NmtGetApplicationName (uint8_t ubNetV)
 
uint32_t J1939_NmtGetIdentityNumber (uint8_t ubNetV)
 
uint8_t J1939_NmtGetNewAddress (uint8_t ubNetV, uint8_t ubCurrentAddressV)
 
void J1939_NmtSetName (uint8_t ubNetV, J1939_Name_ts *ptsNameV)
 

Enumeration Type Documentation

◆ J1939_Name_e

NAME compare result.

See also
J1939_NmtCompareName()

The enumeration defines possible return values for a NAME comparison.

Enumerator
eJ1939_NAME_SMALLER 

NAME is smaller

eJ1939_NAME_EQUAL 

NAME is equal

eJ1939_NAME_GREATER 

NAME is greater

Function Documentation

◆ J1939_NmtEventClaimAddess()

void J1939_NmtEventClaimAddess ( uint8_t ubNetV,
uint8_t ubSrcAddrV,
uint8_t * pubDataV )
Parameters
[in]ubNetV- J1939 Network channel
[in]ubSrcAddrV- Source address of claim message
[in]pubDataV- Pointer to 8 bytes of NAME

This function is called be the J1939 stack upon reception of an address claiming message that has a different source address.

◆ J1939_NmtGetApplicationName()

J1939_Name_ts * J1939_NmtGetApplicationName ( uint8_t ubNetV)
Parameters
[in]ubNetV- J1939 Network channel
Returns
Pointer to J1939_Name_ts structure

The function is called by the protocol upon initialization in order to allow modification of the NAME field. It can be used to overwrite the pre-defined values defined inside the j1939_conf.h file. In case a NULL pointer is returned the pre-defined values are used.

A sample implementation of he function is located inside the j1939_user.c file.

{
//---------------------------------------------------------------------------------------------------
// returning a NULL pointer denotes to use the pre-defined values
//
return ((J1939_Name_ts *) 0L);
}
J1939_Name_ts * J1939_NmtGetApplicationName(uint8_t ubNetV)
Access to ECU NAME.
Definition j1939_nmt.h:69

◆ J1939_NmtGetIdentityNumber()

uint32_t J1939_NmtGetIdentityNumber ( uint8_t ubNetV)
Parameters
[in]ubNetV- J1939 Network channel
Returns
Identity number

The function returns the Identity number, which is required for the NAME function. The function is located inside the j1939_user.c file.

◆ J1939_NmtGetNewAddress()

uint8_t J1939_NmtGetNewAddress ( uint8_t ubNetV,
uint8_t ubCurrentAddressV )
Parameters
[in]ubNetV- J1939 Network channel
[in]ubCurrentAddressV- Current ECU address
Returns
New ECU address

This function is called by the stack when the symbol J1939_ADDRESS_SELF is set to 1 and the device fails to claim its address. The application can then return a new address here to the J1939 protocol stack. The function is located inside the j1939_user.c file.

◆ J1939_NmtSetName()

void J1939_NmtSetName ( uint8_t ubNetV,
J1939_Name_ts * ptsNameV )
Deprecated
This function is deprecated, use J1939_NmtGetApplicationName() instead
Parameters
[in]ubNetV- J1939 Network channel
[in]ptsNameV- Pointer to J1939 NAME structure

The function sets a new NAME for the ECU. The fields are defined by the structure J1939_Name_ts. The function can be used to overwrite the pre-defined values defined inside the j1939_conf.h file.