コード例 #1
0
        // this function is parked here since the values are drawn from EnvironmentContexts // Xref_Count and Xref_Offset;
        public List <DiagService> GetEnvironmentContextsForDTC(DTC inDtc)
        {
            List <DiagService> ctxList = new List <DiagService>();

            for (int i = inDtc.XrefStart; i < (inDtc.XrefStart + inDtc.XrefCount); i++)
            {
                foreach (DiagService envToTest in EnvironmentContexts)
                {
                    int xref = Xrefs[i];
                    if (envToTest.PoolIndex == xref)
                    {
                        ctxList.Add(envToTest);
                        break;
                    }
                }
            }
            return(ctxList);
        }
コード例 #2
0
ファイル: ECU.cs プロジェクト: gibsonk1980/CaesarSuite
        public void CreateDTCs(BinaryReader reader, CTFLanguage language)
        {
            byte[] dtcPool    = ReadECUDtcPool(reader);
            DTC[]  globalDtcs = new DTC[Dtc_EntryCount];
            using (BinaryReader poolReader = new BinaryReader(new MemoryStream(dtcPool)))
            {
                for (int dtcIndex = 0; dtcIndex < Dtc_EntryCount; dtcIndex++)
                {
                    int  offset         = poolReader.ReadInt32();
                    int  size           = poolReader.ReadInt32();
                    uint crc            = poolReader.ReadUInt32();
                    long dtcBaseAddress = offset + Dtc_BlockOffset;

                    DTC dtc = new DTC(reader, language, dtcBaseAddress, dtcIndex, this);
                    globalDtcs[dtcIndex] = dtc;
                }
            }
            GlobalDTCs = new List <DTC>(globalDtcs);
        }