Command: CMD_J1939_ADDR_CLAIM
Destination: SD_J1939 Destination Channel:Vehicle Network Protocol Channel Id.
Description
Clients use this command to get a J1939 address after the J1939 protocol layer has been enabled by the client for the channel. Before an address is claimed, all J1939 messages that are present on the channel can be seen by the client. After an address has been claimed with the node emulation flag set (set to 1), only J1939 messages sent to the claimed address and broadcast messages can be seen by the client. After an address has been claimed with the node emulation flag cleared (set to 0), all J1939 messages that are present on the channel can be seen by the client. If the claimed address changes during a connection, the user will be notified via an Event.
Command Data Format
NAME Preferred Address Emulation Flag padding Identity Number Manufacturer Code ECU Instance Function Instance Function Vehicle System Vehicle System Instance Industry Group Arbitrary Address Capable Preferred Address Emulation Flag padding 4 bytes 2 bytes 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 0-3 bytes
NAME
A 13 byte structure that describes the J1939 node. This field is optional. If it is missing, the default values for the sub fields shown below are used. All multi-byte fields are in network byte order.
Manufacturer Identity Number 0 Manufacturer Code 11 (Dearborn Group) ECU Instance 0 Function Instance 0 (First Offboard Service Tool) Function 129 (Off board Service Tool) Vehicle System 0 (Non specific) Vehicle System Instance 0 (first instance) Industry Group 0 (Global) Self Configurable 0 (no)
Preferred Address
The preferred address of the J1939 node. This field is optional. If it is missing, the default address of 249 (0xF9) is used.
Emulation Flag
The emulation node flag. This field is required.If the byte is set to any non-zero value, the returned address is used to automatically filter J1939 messages sent to the client. (Only messages with a destination address that is the same as the returned address are seen by the client.)
If the byte is set to zero, no filtering performed. (All J1939 messages are seen by the client.)
In either case, the client program can specify one or more filters to restrict or further restrict incoming messages.
Response Data Format
Response Return Codes
Address padding 1 byte 3 bytes
Address
The negotiated address. If the preferred address is not available and no address was successfully claimed, the null address (254) is returned.
RESP_OK Execution of the command was successful. The current J1939 address is returned in the response data. RESP_UNAVAILABLE The J1939 protocol layer is not available. RESP_UNSUPPORTED This command is not supported on the specified channel. RESP_UNREG The specified source channel is not registered with the server. RESP_UNKNOWN_ERR An unknown error occurred.
If the J1939 address is changed after it has been claimed, an EVENT_ADDR_LOST event is sent to the client. The new address is present as the only data byte of the event. If no address was successfully claimed, the null address (254) is returned as the new address.