ndWWHOBDConvertDTCsToJ2012
- Updated2024-08-07
- 1 minute(s) read
ndWWHOBDConvertDTCsToJ2012
Purpose
Converts DTCs to the J2012 DTC format.
Format
long ndWWHOBDConvertDTCsToJ2012 (
TD4 DTCs[],
long lenDTCs,
TD5 DTCsJ2012[],
long *lenDTCsJ2012);
Input
DTCs
The DTC to convert as an array of structs:
typedef struct {
unsigned long DTC;
unsigned long Status;
unsigned long AddData;
} TD4;
lenDTCs
Must contain the number of valid data bytes in DTCs.
Output
DTCsJ2012
Returns the converted DTCs to the J2012 format as an array of structs:
typedef struct {
unsigned short DTC;
unsigned char FTB;
unsigned long Status;
unsigned long AddData;
} TD6;
DTC is the resulting Diagnostic Trouble Code.
FTB contains the failure type byte.
Status is the DTC status. Usually, this is a bit field with following meaning:
Bit | Meaning |
0 | testFailed |
1 | testFailedThisMonitoringCycle |
2 | pendingDTC |
3 | confirmedDTC |
4 | testNotCompletedSinceLastClear |
5 | testFailedSinceLastClear |
6 | testNotCompletedThisMonitoringCycle |
7 | warningIndicatorRequested |
AddData contains optional additional data for this DTC. Usually, this does not contain valid information (refer to DTCDescriptor).
FMI contains the failure mode identifier.
lenDTCsJ2012
On input, lenDTCsJ2012 must contain the DTCsJ2012 array length. On return, it contains the number of valid data bytes in the DTCsJ2012 array.
Return Value
The return value indicates the function call status as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Use the ndStatusToString function to obtain a descriptive string for the return value.