I have a question about J1939. I'm looking for a PGN number that doing a request for deleting the name of an ECU.
I have made a library for open source SAE J1939 https://github.com/DanielMartensson/Open-SAE-J1939
There is two PGN numbers
PGN_ADDRESS_CLAIMED = 0x00EE00,
PGN_COMMANDED_ADDRESS = 0x00FED8,
PGN_ADDRESS_CLAIMED
asking for the information about the ECU (name) and PGN_COMMANDED_ADDRESS
is not a request, more like a command for chaning the information about the ECU and its destination address.
Question:
Where can I find a PGN number that can delete the ECU information or disconnect the ECU? Or do you think I can say that the PGN number can be 0xFFFFFF? I hope that PGN is already taken?
The reason why I'm asking is becase when I change the address and information at an ECU, then the old information and address is still there...avaiable at other ECU. My library works like all ECU have the same information about all ECU:s.
If you wonder what I'm doing. I'm buildning a J1939 library that are very easy to use and very clear to understand. I'm focusing on minimal code and the purpose with the library is that the user should easily implements own external functions.
Here is an example of a request funtion in my J1939 library:
/* PGN 00EA00 - Request for name information about other ECU */
ENUM_J1939_STATUS_CODES J1939_User_Send_Request(J1939* j1939, uint8_t DA, uint32_t PGN_code) {
uint8_t PGN[3];
PGN[0] = PGN_code; /* PGN least significant bit */
PGN[1] = PGN_code >> 8; /* Look in J1939_Enum_PGN.h */
PGN[2] = PGN_code >> 16; /* PGN most significant bit */
uint32_t ID = (0x18EA << 16) | (DA << 8) | j1939->this_address;
return CAN_Send_Request(ID, PGN, 100); /* 100 ms delay */
}
AFAIK, J1939 does not provide feature to deregister an address. However, you can send address claim message with SA as 0xFE and NAME set to value which you used during initial address claim.
I had implemented in a way that, my library used to store all Address and their name combinations in "Adress book". Before sending any message, DA was validated against address book. If a node sends Adress claim with SA as 0xFE, Name will be searched in address book and deleted.
Search for valid address is kind of overhead.