Closed Anmolg1102 closed 1 week ago
@Anmolg1102 Not sure what you mean. But you can read the DM1 or DM2 codes from the message. But it will only give you a number, not a plain text.
If you want to implement and send me a PR, it's welcome. Use the enum .h file inside the project.
I’m currently handling J1939 DM1 and DM2 diagnostic messages and need to map DTCs to corresponding OBD-II P-codes directly, without relying on predefined DTC tables or manual lookup resources. Specifically, I want to know if there's a method or conversion algorithm that can derive the correct P-code based on parsed parameters like SPN (Suspect Parameter Number), FMI (Failure Mode Identifier), or potentially other J1939 parameters.
Has anyone developed a systematic way or heuristic to infer OBD-II P-codes using SPN, FMI, or other available data points in J1939? Any insights or examples of a conversion technique that could dynamically map these values to related P-codes would be very helpful.
Thank you!