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

Detailed Description

The file j1939_conf.h holds all definitions for the configuration of the J1939 protocol stack. Please set the symbols to an appropriate value in order to achieve a specific J1939 behaviour.

Macros

#define J1939_NET_MAX   1
 
#define J1939_TIMER_PERIOD   ((uint32_t) 1000)
 
#define J1939_COS_TUNNEL   0
 
#define J1939_FAST_PACKET_SUPPORT   0
 
#define J1939_BAM_RCV_BUFFER_SIZE   64
 
#define J1939_BAM_TRM_BUFFER_SIZE   64
 
#define J1939_TP_RCV_BUFFER_SIZE   64
 
#define J1939_TP_TRM_BUFFER_SIZE   64
 
#define J1939_DM1_DTC_SIZE   8
 
#define J1939_DM2_DTC_SIZE   8
 
#define J1939_DM16_BIN_SIZE   128
 
#define J1939_ADDRESS_SELF   1
 
#define J1939_NAME_MANUFACTURER   ((uint16_t) 652)
 
#define J1939_NAME_ECU_INSTANCE   ((uint8_t) 0)
 
#define J1939_NAME_FUNCTION   ((uint8_t) 3)
 
#define J1939_NAME_FUNCTION_INSTANCE   ((uint8_t) 0)
 
#define J1939_NAME_INDUSTRY_GROUP   ((uint8_t) 4)
 
#define J1939_NAME_VEHICLE_SYSTEM   ((uint8_t) 0)
 
#define J1939_NAME_VEHICLE_SYSTEM_INSTANCE   ((uint8_t) 0)
 
#define J1939_NAME_ARBITRARY_ADDRESS_CAPABLE   1
 

Macro Definition Documentation

◆ J1939_ADDRESS_SELF

#define J1939_ADDRESS_SELF   1

Enable Self-Configurable Address CA.

This symbol defines if the CA uses only one single address or is able to setup a new address by itself.

◆ J1939_BAM_RCV_BUFFER_SIZE

#define J1939_BAM_RCV_BUFFER_SIZE   64

Size of BAM buffer for reception.

This symbol defines the size (in byte) of the message buffer for BAM messages

◆ J1939_BAM_TRM_BUFFER_SIZE

#define J1939_BAM_TRM_BUFFER_SIZE   64

Size of BAM buffer for transmission.

This symbol defines the size (in byte) of the message buffer for BAM messages

◆ J1939_COS_TUNNEL

#define J1939_COS_TUNNEL   0

Tunnel to CANopen Slave Protocol Stack.

This symbol enables or disables a tunnel via a proprietary PDU to an existing CANopen Slave Stack.

  • 0 : Disable tunnel to CANopen Slave protocol stack
  • 1 : Enable tunnel to CANopen Slave protocol stack

◆ J1939_DM16_BIN_SIZE

#define J1939_DM16_BIN_SIZE   128

Maximum size of DM16 message.

This symbol defines the maximum number of bytes that can be transferred by a DM16 message.

◆ J1939_DM1_DTC_SIZE

#define J1939_DM1_DTC_SIZE   8

Supported number of DM1 diagnostic trouble codes.

This symbol defines the number of diagnostic trouble codes (DTC) that can be transferred by a DM1 message.

◆ J1939_DM2_DTC_SIZE

#define J1939_DM2_DTC_SIZE   8

Supported number of DM2 diagnostic trouble codes.

This symbol defines the number of diagnostic trouble codes (DTC) that can be transferred by a DM2 message.

◆ J1939_FAST_PACKET_SUPPORT

#define J1939_FAST_PACKET_SUPPORT   0

Support Fast-packet protocol.

This symbol defines if the Fast-packet protocol is enabled

◆ J1939_NAME_ARBITRARY_ADDRESS_CAPABLE

#define J1939_NAME_ARBITRARY_ADDRESS_CAPABLE   1

Arbitrary Address Capable.

This field indicates whether a CA can use an arbitrary source address to resolve an address claim conflict. If this symbol is set to "1", the CA will resolve an address conflict with a CA whose NAME has a higher priority (lower numeric value) by selecting an arbitrary source address from the range 128 to 247 inclusive and claiming that source address.

◆ J1939_NAME_ECU_INSTANCE

#define J1939_NAME_ECU_INSTANCE   ((uint8_t) 0)

ECU Instance Field.

The ECU Instance is a 3-bit field that indicates which one of a group of electronic control modules associated with a given Function is being referenced. For example, in the case where a single engine is managed by two separate control units, each of which is attached to the same SAE J1939 network, the ECU Instance Field will be set to 0 for the first ECU and 1 for the second ECU.

Note that in the case of a single or first ECU for a particular CA, the instance field should be set to zero indicating the first instance.

◆ J1939_NAME_FUNCTION

#define J1939_NAME_FUNCTION   ((uint8_t) 3)

Function Field.

Function is an 8-bit field defined and assigned by the committee. When Function has a value of 0 to 127 (See J1939 top level document, Appendix B, Table B11), its definition is not dependent on any other field. When Function has a value greater than 127 (See Appendix B, Table B12), its definition depends on Vehicle System. Function, when combined with the Industry Group and the Vehicle System fields identifies a common name for a specific controller. The common name formed from the combination does not imply any specific capabilities.

◆ J1939_NAME_FUNCTION_INSTANCE

#define J1939_NAME_FUNCTION_INSTANCE   ((uint8_t) 0)

Function Instance Field.

The Function Instance is a 5-bit field that identifies the particular occurrence of a Function on the same Vehicle System on a given network.

Note that in the case of single or first Function of a particular type, the instance field should be set to zero indicating the first instance.

Individual manufacturers and integrators are advised that some agreement in the interpretation and use of Function Instances may be necessary. As an example, consider an implementation consisting of two engines and two transmissions. It may be important that engine instance 0 is physically connected to transmission instance 0 and that engine instance 1 is physically connected to transmission instance 1.

◆ J1939_NAME_INDUSTRY_GROUP

#define J1939_NAME_INDUSTRY_GROUP   ((uint8_t) 4)

Industry Group Field.

Industry Group is a 3-bit field defined and assigned by the committee. Industry Group definitions may be found in Appendix B.7 of the SAE J1939 base document. The Industry Group field identifies NAMEs associated with a particular industry that uses SAE J1939, for example: On-Highway Equipment, or Agricultural Equipment.

◆ J1939_NAME_MANUFACTURER

#define J1939_NAME_MANUFACTURER   ((uint16_t) 652)

Manufacturer Code Field.

The Manufacturer Code is an 11-bit field that indicates which company was responsible for the production of the electronic control module for which this NAME is being referenced. Manufacturer codes are assigned by committee and may be found in the J1939-71 document. See J1939-71 (top-level document) Appendix B, Table B10. The Manufacturer Code field is not dependent on any other field in the NAME.

◆ J1939_NAME_VEHICLE_SYSTEM

#define J1939_NAME_VEHICLE_SYSTEM   ((uint8_t) 0)

Vehicle System Field.

Vehicle System is a 7-bit field defined and assigned by the committee, which when combined with the Industry Group can be correlated to a common name. See J1939 (top-level document) Appendix B, Table B12. Vehicle System provides a common name for a group of functions within a connected network. Examples of Vehicle Systems for currently defined Industry Groups are "tractor" in the "Common" Industry Group, "Trailer" in the On-Highway Industry Group, and planter in the "Agricultural Equipment" Industry Group.

◆ J1939_NAME_VEHICLE_SYSTEM_INSTANCE

#define J1939_NAME_VEHICLE_SYSTEM_INSTANCE   ((uint8_t) 0)

Vehicle System Instance Field.

Vehicle System Instance is a 4-bit field that is used to identify a particular occurrence of a particular Vehicle System within a connected network.

Note that in the case of single or first Vehicle System of a particular type, the instance field should be set to zero indicating the first instance.

◆ J1939_NET_MAX

#define J1939_NET_MAX   1

This symbol defines the maximum number of J1939 networks in a system. The value is typically equal to the number of physical CAN interfaces.

◆ J1939_TIMER_PERIOD

#define J1939_TIMER_PERIOD   ((uint32_t) 1000)

Period of timer interrupt.

Note
The value of the timer interrupt period has to be adjusted to the target hardware.

This symbol defines the period of the timer interrupt. The value is a multiple of 1 microsecond. It is used for timing services.

◆ J1939_TP_RCV_BUFFER_SIZE

#define J1939_TP_RCV_BUFFER_SIZE   64

Size of TP.DT buffer.

This symbol defines the size (in byte) for reception of TP.DT messages

◆ J1939_TP_TRM_BUFFER_SIZE

#define J1939_TP_TRM_BUFFER_SIZE   64

Size of TP.DT buffer.

This symbol defines the size (in byte) for transmission of TP.DT messages