Beispiel #1
0
        /// <summary>
        /// Read the rom identification header and include from a file
        /// </summary>
        /// <param name="fetchPath"></param>
        /// <returns></returns>
        public void ParseMetaData_ECUFlash()
        {
            try
            {
                XDocument xmlDoc = XDocument.Load(filePath, LoadOptions.PreserveWhitespace);
                XElement  xRomId = xmlDoc.XPathSelectElement("/rom/romid");
                ident = new ECUIdentifier();
                string incl;

                if (xmlDoc.XPathSelectElement("/rom/include") != null)
                {
                    incl = xmlDoc.XPathSelectElement("/rom/include").Value.ToString();
                }
                else
                {
                    incl   = null;
                    isBase = true;
                }

                ident.ParseEcuFlashXml(xRomId, incl);
            }
            catch (Exception e)
            {
                Trace.TraceWarning("Error parsing definition metadata for {0}.", filePath);
                Trace.TraceError(e.Message);
                Trace.TraceError(e.StackTrace);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ECUMetaData(AvailableDevices ad)
 {
     availableDevices = ad;
     isBase           = false;
     ident            = new ECUIdentifier();
     ExposedRomTables = new Dictionary <string, TableMetaData>();
     ExposedRamTables = new Dictionary <string, TableMetaData>();
     BaseRomTables    = new Dictionary <string, TableMetaData>();
     BaseRamTables    = new Dictionary <string, TableMetaData>();
     ScalingList      = new Dictionary <string, Scaling>();
     inheritList      = new List <ECUMetaData>();
 }
Beispiel #3
0
        public string getIdentifierFromFooter(byte[] footer, ECUIdentifier identifier)
        {
            string result = string.Empty;

            int offset = footer.Length - 0x05;  //  avoid the stored checksum
            while (offset > 0)
            {
                int length = footer[offset--];
                ECUIdentifier search = (ECUIdentifier)footer[offset--];
                if (search == identifier)
                {
                    for (int i = 0; i < length; i++)
                    {
                        result += (char)footer[offset--];
                    }
                    return result;
                }
                offset -= length;
            }

            CastInfoEvent("Error getting Identifier Version", ActivityType.QueryingECUTypeInfo);
            return result;
        }