Beispiel #1
0
        public void GetECUInfo()
        {
            string vin;
            string immo;
            string engineType;
            string swVersion;
            float  e85level;

            KWPResult res = kwpHandler.getVIN(out vin);

            if (res == KWPResult.OK)
            {
                CastInfoEvent("VIN: " + vin, ActivityType.ConvertingFile);
            }
            else if (res == KWPResult.DeviceNotConnected)
            {
                CastInfoEvent("VIN: not connected", ActivityType.ConvertingFile);
            }
            else
            {
                CastInfoEvent("VIN: timeout", ActivityType.ConvertingFile);
            }
            res = kwpHandler.getImmo(out immo);
            if (res == KWPResult.OK)
            {
                CastInfoEvent("Immo: " + immo, ActivityType.ConvertingFile);
            }
            res = kwpHandler.getEngineType(out engineType);
            if (res == KWPResult.OK)
            {
                CastInfoEvent("Engine type: :" + engineType, ActivityType.ConvertingFile);
            }
            res = kwpHandler.getSwVersion(out swVersion);
            if (res == KWPResult.OK)
            {
                CastInfoEvent("Software version: " + swVersion, ActivityType.ConvertingFile);
            }
            res = kwpHandler.getE85Level(out e85level);
            if (res == KWPResult.OK)
            {
                CastInfoEvent("E85 : " + e85level + "%", ActivityType.ConvertingFile);
            }
        }
Beispiel #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            string vin;
            string immo;
            string engineType;
            string swVersion;

            if (m_connectedToECU)
            {
                if (useCombiAdapter)
                {
                    // begin comms session
                    T7.Flasher.T7CombiFlasher cf =
                        (T7.Flasher.T7CombiFlasher) this.flash;
                    cf.beginSession();

                    // NB: does not work, but it's a firmware problem
                    //vin = cf.getHeaderString(T7.Flasher.T7HeaderField.vin);
                    //engineType = cf.getHeaderString(T7.Flasher.T7HeaderField.engtype);
                    //swVersion = cf.getHeaderString(T7.Flasher.T7HeaderField.swversion);

                    // end session
                    cf.endSession();
                }
                else
                {
                    if (checkBox1.Checked)
                    {
                        KWPHandler.startLogging();
                    }
                    KWPResult res = kwpHandler.getVIN(out vin);
                    if (res == KWPResult.OK)
                    {
                        AddToLog("VIN: " + vin);
                    }
                    else if (res == KWPResult.DeviceNotConnected)
                    {
                        AddToLog("VIN: not connected");
                    }
                    else
                    {
                        AddToLog("VIN: timeout");
                    }
                    res = kwpHandler.getImmo(out immo);
                    if (res == KWPResult.OK)
                    {
                        AddToLog("Immo: " + immo);
                    }
                    res = kwpHandler.getEngineType(out engineType);
                    if (res == KWPResult.OK)
                    {
                        AddToLog("Engine type: :" + engineType);
                    }
                    res = kwpHandler.getSwVersion(out swVersion);
                    if (res == KWPResult.OK)
                    {
                        AddToLog("Software version: " + swVersion);
                    }
                }
            }
        }