-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
3,157 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Caesar | ||
{ | ||
public class DTC | ||
{ | ||
public enum DTCStatusByte : uint | ||
{ | ||
TestFailedAtRequestTime = 0x01, | ||
TestFailedAtCurrentCycle = 0x02, | ||
PendingDTC = 0x04, | ||
ConfirmedDTC = 0x08, | ||
TestIncompleteSinceLastClear = 0x10, | ||
TestFailedSinceLastClear = 0x20, | ||
TestIncompleteAtCurrentCycle = 0x40, | ||
WarningIndicatorActive = 0x80, | ||
} | ||
|
||
// see : const char *__cdecl DIGetComfortErrorCode(DI_ECUINFO *ecuh, unsigned int dtcIndex) | ||
public string Qualifier; | ||
|
||
public int Description_CTF; | ||
public int Reference_CTF; | ||
|
||
public int XrefStart = -1; | ||
public int XrefCount = -1; | ||
|
||
public long BaseAddress; | ||
public int PoolIndex; | ||
|
||
public ECU ParentECU; | ||
CTFLanguage Language; | ||
|
||
public string Description { get { return Language.GetString(Description_CTF); } } | ||
|
||
public DTC(BinaryReader reader, CTFLanguage language, long baseAddress, int poolIndex, ECU parentEcu) | ||
{ | ||
ParentECU = parentEcu; | ||
PoolIndex = poolIndex; | ||
BaseAddress = baseAddress; | ||
Language = language; | ||
reader.BaseStream.Seek(baseAddress, SeekOrigin.Begin); | ||
|
||
ulong bitflags = reader.ReadUInt16(); | ||
|
||
Qualifier = CaesarReader.ReadBitflagStringWithReader(ref bitflags, reader, baseAddress); | ||
|
||
Description_CTF = CaesarReader.ReadBitflagInt32(ref bitflags, reader, -1); | ||
Reference_CTF = CaesarReader.ReadBitflagInt32(ref bitflags, reader, -1); | ||
#if DEBUG | ||
if (bitflags > 0) | ||
{ | ||
Console.WriteLine($"DTC {Qualifier} has additional unparsed fields : 0x{bitflags:X}"); | ||
} | ||
#endif | ||
} | ||
/* | ||
public string GetDescription() | ||
{ | ||
return Language.GetString(Description_CTF); | ||
} | ||
*/ | ||
public static DTC FindDTCById(string id, ECUVariant variant) | ||
{ | ||
foreach (DTC dtc in variant.DTCs) | ||
{ | ||
if (dtc.Qualifier.EndsWith(id)) | ||
{ | ||
return dtc; | ||
} | ||
} | ||
return null; | ||
} | ||
public void PrintDebug() | ||
{ | ||
Console.WriteLine($"DTC: {Qualifier}: {Language.GetString(Description_CTF)} : {Language.GetString(Reference_CTF)}"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
87dc8a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NRC aus UDS DC_10747.pdf
may be helpful for negative responses
87dc8a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and a full doc
445846427-MBN-10747-2013-02-en-pdf.pdf