Пример #1
0
        public void Activate(SensorRegistry registry)
        {
            CoreSensor s;

            // OBD2DTCFRZF
            s = new OBD2Sensor()
            {
                ID = "OBD2.DTCFRZF",
                Name = "DTCFRZF",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0x00);
                      },

                Command = 0x02,

            };

            registry.Add(s);

            // OBD2FuelSystemStatus
            s = new OBD2Sensor()
            {
                ID = "OBD2.FuelSystemStatus",
                Name = "FuelSystemStatus",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return ((int)get(0)<<8) + (p.len() > 1 ? get(1) : 0);
                      },

                Command = 0x03,

            };

            registry.Add(s);

            // OBD2EngineLoad
            s = new OBD2Sensor()
            {
                ID = "OBD2.EngineLoad",
                Name = "EngineLoad",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0) * 100 / 255;
                      },

                Command = 0x04,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2CoolantTemp
            s = new OBD2Sensor()
            {
                ID = "OBD2.CoolantTemp",
                Name = "CoolantTemp",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0)-40;
                      },

                Command = 0x05,

            };

            s.Units = "celsius";

            registry.Add(s);

            // OBD2STFT1
            s = new OBD2Sensor()
            {
                ID = "OBD2.STFT1",
                Name = "STFT1",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(0)-128) * 100/128;
                      },

                Command = 0x06,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2LTFT1
            s = new OBD2Sensor()
            {
                ID = "OBD2.LTFT1",
                Name = "LTFT1",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(0)-128) * 100/128;
                      },

                Command = 0x07,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2STFT2
            s = new OBD2Sensor()
            {
                ID = "OBD2.STFT2",
                Name = "STFT2",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(0)-128) * 100/128;
                      },

                Command = 0x08,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2LTFT2
            s = new OBD2Sensor()
            {
                ID = "OBD2.LTFT2",
                Name = "LTFT2",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(0)-128) * 100/128;
                      },

                Command = 0x09,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2FuelPressure
            s = new OBD2Sensor()
            {
                ID = "OBD2.FuelPressure",
                Name = "FuelPressure",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0)*3;
                      },

                Command = 0x0A,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2IntakeManifoldPressure
            s = new OBD2Sensor()
            {
                ID = "OBD2.IntakeManifoldPressure",
                Name = "IntakeManifoldPressure",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0);
                      },

                Command = 0x0B,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2RPM
            s = new OBD2Sensor()
            {
                ID = "OBD2.RPM",
                Name = "RPM",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(0)*256 + get(1)) / 4;
                      },

                Command = 0x0C,

            };

            s.Units = "rpm";

            registry.Add(s);

            // OBD2Speed
            s = new OBD2Sensor()
            {
                ID = "OBD2.Speed",
                Name = "Speed",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0x00);
                      },

                Command = 0x0D,

            };

            s.Units = "kph";

            registry.Add(s);

            // OBD2TimingAdvance
            s = new OBD2Sensor()
            {
                ID = "OBD2.TimingAdvance",
                Name = "TimingAdvance",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0x00)/2 - 64;
                      },

                Command = 0x0E,

            };

            s.Units = "°";

            registry.Add(s);

            // OBD2IntakeAirTemp
            s = new OBD2Sensor()
            {
                ID = "OBD2.IntakeAirTemp",
                Name = "IntakeAirTemp",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0x00) - 40;
                      },

                Command = 0x0F,

            };

            s.Units = "celsius";

            registry.Add(s);

            // OBD2MAF
            s = new OBD2Sensor()
            {
                ID = "OBD2.MAF",
                Name = "MAF",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return ((get(0)*256)+get(1)) / 100;
                      },

                Command = 0x10,

            };

            s.Units = "gr/sec";

            registry.Add(s);

            // OBD2ThrottlePosition
            s = new OBD2Sensor()
            {
                ID = "OBD2.ThrottlePosition",
                Name = "ThrottlePosition",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0)*100 / 255;
                      },

                Command = 0x11,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b1s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b1s1",
                Name = "Oxygen_b1s1",

                      obdValue = (p) => { return p.get(0)*0.005; },

                Command = 0x14,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b1s1_stft
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b1s1_stft",
                Name = "Oxygen_b1s1_stft",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(1)-128)*100/128;
                      },

                Command = 0x14,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b1s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b1s2",
                Name = "Oxygen_b1s2",

                      obdValue = (p) => { return p.get(0)*0.005; },

                Command = 0x15,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b1s2_stft
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b1s2_stft",
                Name = "Oxygen_b1s2_stft",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(1)-128)*100/128;
                      },

                Command = 0x15,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b1s3
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b1s3",
                Name = "Oxygen_b1s3",

                      obdValue = (p) => { return p.get(0)*0.005; },

                Command = 0x16,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b1s3_stft
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b1s3_stft",
                Name = "Oxygen_b1s3_stft",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(1)-128)*100/128;
                      },

                Command = 0x16,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b1s4
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b1s4",
                Name = "Oxygen_b1s4",

                      obdValue = (p) => { return p.get(0)*0.005; },

                Command = 0x17,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b1s4_stft
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b1s4_stft",
                Name = "Oxygen_b1s4_stft",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(1)-128)*100/128;
                      },

                Command = 0x17,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b2s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b2s1",
                Name = "Oxygen_b2s1",

                      obdValue = (p) => { return p.get(0)*0.005; },

                Command = 0x18,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b2s1_stft
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b2s1_stft",
                Name = "Oxygen_b2s1_stft",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(1)-128)*100/128;
                      },

                Command = 0x18,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b2s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b2s2",
                Name = "Oxygen_b2s2",

                      obdValue = (p) => { return p.get(0)*0.005; },

                Command = 0x19,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b2s2_stft
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b2s2_stft",
                Name = "Oxygen_b2s2_stft",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(1)-128)*100/128;
                      },

                Command = 0x19,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b2s3
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b2s3",
                Name = "Oxygen_b2s3",

                      obdValue = (p) => { return p.get(0)*0.005; },

                Command = 0x1a,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b2s3_stft
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b2s3_stft",
                Name = "Oxygen_b2s3_stft",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(1)-128)*100/128;
                      },

                Command = 0x1a,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b2s4
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b2s4",
                Name = "Oxygen_b2s4",

                      obdValue = (p) => { return p.get(0)*0.005; },

                Command = 0x1b,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b2s4_stft
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen_b2s4_stft",
                Name = "Oxygen_b2s4_stft",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(1)-128)*100/128;
                      },

                Command = 0x1b,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Lambda_b1s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda_b1s1",
                Name = "Lambda_b1s1",

                      obdValue = (p) => { return p.getab()*2 / 65535; },

                Command = 0x24,

            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b1s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen2_b1s1",
                Name = "Oxygen2_b1s1",

                      obdValue = (p) => { return p.getcd()*8 / 65535; },

                Command = 0x24,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b1s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda_b1s2",
                Name = "Lambda_b1s2",

                      obdValue = (p) => { return p.getab()*2 / 65535; },

                Command = 0x25,

            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b1s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen2_b1s2",
                Name = "Oxygen2_b1s2",

                      obdValue = (p) => { return p.getcd()*8 / 65535; },

                Command = 0x25,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b2s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda_b2s1",
                Name = "Lambda_b2s1",

                      obdValue = (p) => { return p.getab()*2 / 65535; },

                Command = 0x26,

            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b2s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen2_b2s1",
                Name = "Oxygen2_b2s1",

                      obdValue = (p) => { return p.getcd()*8 / 65535; },

                Command = 0x26,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b2s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda_b2s2",
                Name = "Lambda_b2s2",

                      obdValue = (p) => { return p.getab()*2 / 65535; },

                Command = 0x27,

            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b2s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen2_b2s2",
                Name = "Oxygen2_b2s2",

                      obdValue = (p) => { return p.getcd()*8 / 65535; },

                Command = 0x27,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b3s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda_b3s1",
                Name = "Lambda_b3s1",

                      obdValue = (p) => { return p.getab()*2 / 65535; },

                Command = 0x28,

            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b3s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen2_b3s1",
                Name = "Oxygen2_b3s1",

                      obdValue = (p) => { return p.getcd()*8 / 65535; },

                Command = 0x28,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b3s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda_b3s2",
                Name = "Lambda_b3s2",

                      obdValue = (p) => { return p.getab()*2 / 65535; },

                Command = 0x29,

            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b3s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen2_b3s2",
                Name = "Oxygen2_b3s2",

                      obdValue = (p) => { return p.getcd()*8 / 65535; },

                Command = 0x29,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b4s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda_b4s1",
                Name = "Lambda_b4s1",

                      obdValue = (p) => { return p.getab()*2 / 65535; },

                Command = 0x2a,

            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b4s1
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen2_b4s1",
                Name = "Oxygen2_b4s1",

                      obdValue = (p) => { return p.getcd()*8 / 65535; },

                Command = 0x2a,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b4s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda_b4s2",
                Name = "Lambda_b4s2",

                      obdValue = (p) => { return p.getab()*2 / 65535; },

                Command = 0x2b,

            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b4s2
            s = new OBD2Sensor()
            {
                ID = "OBD2.Oxygen2_b4s2",
                Name = "Oxygen2_b4s2",

                      obdValue = (p) => { return p.getcd()*8 / 65535; },

                Command = 0x2b,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2OBDSupport
            s = new OBD2Sensor()
            {
                ID = "OBD2.OBDSupport",
                Name = "OBDSupport",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0);
                      },

                Command = 0x1C,

            };

            registry.Add(s);

            // OBD2RunTime
            s = new OBD2Sensor()
            {
                ID = "OBD2.RunTime",
                Name = "RunTime",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0)*256 + get(1);
                      },

                Command = 0x1F,

            };

            s.Units = "sec";

            registry.Add(s);

            // OBD2DistanceMIL
            s = new OBD2Sensor()
            {
                ID = "OBD2.DistanceMIL",
                Name = "DistanceMIL",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0)*256 + get(1);
                      },

                Command = 0x21,

            };

            s.Units = "km";

            registry.Add(s);

            // OBD2FuelRailPressure_rel
            s = new OBD2Sensor()
            {
                ID = "OBD2.FuelRailPressure_rel",
                Name = "FuelRailPressure_rel",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (((get(0)*256)+get(1)) * 10) / 128;
                      },

                Command = 0x22,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2FuelRailPressure_diesel
            s = new OBD2Sensor()
            {
                ID = "OBD2.FuelRailPressure_diesel",
                Name = "FuelRailPressure_diesel",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (((get(0)*256)+get(1)) * 10);
                      },

                Command = 0x23,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2CommandedEGR
            s = new OBD2Sensor()
            {
                ID = "OBD2.CommandedEGR",
                Name = "CommandedEGR",

                      obdValue = (p) => { return p.get(0)*100/255; },

                Command = 0x2C,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2EGRError
            s = new OBD2Sensor()
            {
                ID = "OBD2.EGRError",
                Name = "EGRError",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(0)-128)*100/128;
                      },

                Command = 0x2D,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Commanded_EVAP
            s = new OBD2Sensor()
            {
                ID = "OBD2.Commanded_EVAP",
                Name = "Commanded_EVAP",

                      obdValue = (p) => { return p.get(0)*100/255; },

                Command = 0x2E,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2FuelLevel
            s = new OBD2Sensor()
            {
                ID = "OBD2.FuelLevel",
                Name = "FuelLevel",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return 100*get(0)/255;
                      },

                Command = 0x2F,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2DistanceMILCleared
            s = new OBD2Sensor()
            {
                ID = "OBD2.DistanceMILCleared",
                Name = "DistanceMILCleared",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0)*256 + get(1);
                      },

                Command = 0x31,

            };

            s.Units = "km";

            registry.Add(s);

            // OBD2VaporPressure
            s = new OBD2Sensor()
            {
                ID = "OBD2.VaporPressure",
                Name = "VaporPressure",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (((get(0)*256)+get(1)) / 4);
                      },

                Command = 0x32,

            };

            s.Units = "Pa";

            registry.Add(s);

            // OBD2BaroPressure
            s = new OBD2Sensor()
            {
                ID = "OBD2.BaroPressure",
                Name = "BaroPressure",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0);
                      },

                Command = 0x33,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2ControlModuleVoltage
            s = new OBD2Sensor()
            {
                ID = "OBD2.ControlModuleVoltage",
                Name = "ControlModuleVoltage",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (((get(0)*256)+get(1)) / 1000);
                      },

                Command = 0x42,

            };

            s.Units = "V";

            registry.Add(s);

            // OBD2AbsoluteLoadValue
            s = new OBD2Sensor()
            {
                ID = "OBD2.AbsoluteLoadValue",
                Name = "AbsoluteLoadValue",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (((get(0)*256)+get(1)) * 100 / 255);
                      },

                Command = 0x43,

            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Lambda
            s = new OBD2Sensor()
            {
                ID = "OBD2.Lambda",
                Name = "Lambda",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(0)*256 + get(1)) * 2.0 / 65535;
                      },

                Command = 0x44,

            };

            registry.Add(s);

            // OBD2AirTemp
            s = new OBD2Sensor()
            {
                ID = "OBD2.AirTemp",
                Name = "AirTemp",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return get(0) - 40;
                      },

                Command = 0x46,

            };

            s.Units = "celsius";

            registry.Add(s);

            // OBD2EngineOilTemp
            s = new OBD2Sensor()
            {
                ID = "OBD2.EngineOilTemp",
                Name = "EngineOilTemp",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (get(0)-40 );
                      },

                Command = 0x5C,

            };

            s.Units = "celsius";

            registry.Add(s);

            // OBD2FuelInjectionTiming
            s = new OBD2Sensor()
            {
                ID = "OBD2.FuelInjectionTiming",
                Name = "FuelInjectionTiming",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (((get(0)*256)+get(1) - 26880) / 128);
                      },

                Command = 0x5D,

            };

            s.Units = "degree";

            registry.Add(s);

            // OBD2LitersPerHour
            s = new OBD2Sensor()
            {
                ID = "OBD2.LitersPerHour",
                Name = "LitersPerHour",

                      obdValue = (p) => { Func<int, double> get = p.get; Func<int, int, double> get_bit = p.get_bit;
                        return (((get(0)*256)+get(1)) * 0.05);
                      },

                Command = 0x5E,

            };

            s.Units = "lphour";

            registry.Add(s);

            // OBD2TCA_CINP
            s = new OBD2Sensor()
            {
                ID = "OBD2.TCA_CINP",
                Name = "TCA_CINP",

                      obdValue = (p) => { return p.get(1)*1; },

                Command = 0x6F,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2TCB_CINP
            s = new OBD2Sensor()
            {
                ID = "OBD2.TCB_CINP",
                Name = "TCB_CINP",

                      obdValue = (p) => { return p.get(2)*1; },

                Command = 0x6F,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2EP_1
            s = new OBD2Sensor()
            {
                ID = "OBD2.EP_1",
                Name = "EP_1",

                      obdValue = (p) => { return p.getbc()*0.01; },

                Command = 0x73,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2EP_2
            s = new OBD2Sensor()
            {
                ID = "OBD2.EP_2",
                Name = "EP_2",

                      obdValue = (p) => { return p.getde()*0.01; },

                Command = 0x73,

            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2TCA_RPM
            s = new OBD2Sensor()
            {
                ID = "OBD2.TCA_RPM",
                Name = "TCA_RPM",

                      obdValue = (p) => { return p.getbc()*1; },

                Command = 0x74,

            };

            s.Units = "rpm";

            registry.Add(s);

            // OBD2TCB_RPM
            s = new OBD2Sensor()
            {
                ID = "OBD2.TCB_RPM",
                Name = "TCB_RPM",

                      obdValue = (p) => { return p.getde()*1; },

                Command = 0x74,

            };

            s.Units = "rpm";

            registry.Add(s);

            // OBD2MIL
            s = new hobd.MILSensor()
            {
                ID = "OBD2.MIL",
                Name = "MIL",

            };

            registry.Add(s);

            // OBD2PMIL
            s = new hobd.PMILSensor()
            {
                ID = "OBD2.PMIL",
                Name = "PMIL",

            };

            registry.Add(s);

            // OBD2ClearDTC
            s = new hobd.ClearDTCSensor()
            {
                ID = "OBD2.ClearDTC",
                Name = "ClearDTC",

            };

            registry.Add(s);
        }
Пример #2
0
        public void Activate(SensorRegistry registry)
        {
            CoreSensor s;

            // OBD2DTCFRZF
            s = new OBD2Sensor()
            {
                ID   = "OBD2.DTCFRZF",
                Name = "DTCFRZF",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0x00)); },

                Command = 0x02,
            };

            registry.Add(s);

            // OBD2FuelSystemStatus
            s = new OBD2Sensor()
            {
                ID   = "OBD2.FuelSystemStatus",
                Name = "FuelSystemStatus",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(((int)get(0) << 8) + (p.len() > 1 ? get(1) : 0)); },

                Command = 0x03,
            };

            registry.Add(s);

            // OBD2EngineLoad
            s = new OBD2Sensor()
            {
                ID   = "OBD2.EngineLoad",
                Name = "EngineLoad",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) * 100 / 255); },

                Command = 0x04,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2CoolantTemp
            s = new OBD2Sensor()
            {
                ID   = "OBD2.CoolantTemp",
                Name = "CoolantTemp",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) - 40); },

                Command = 0x05,
            };

            s.Units = "celsius";

            registry.Add(s);

            // OBD2STFT1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.STFT1",
                Name = "STFT1",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(0) - 128) * 100 / 128); },

                Command = 0x06,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2LTFT1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.LTFT1",
                Name = "LTFT1",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(0) - 128) * 100 / 128); },

                Command = 0x07,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2STFT2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.STFT2",
                Name = "STFT2",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(0) - 128) * 100 / 128); },

                Command = 0x08,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2LTFT2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.LTFT2",
                Name = "LTFT2",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(0) - 128) * 100 / 128); },

                Command = 0x09,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2FuelPressure
            s = new OBD2Sensor()
            {
                ID   = "OBD2.FuelPressure",
                Name = "FuelPressure",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) * 3); },

                Command = 0x0A,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2IntakeManifoldPressure
            s = new OBD2Sensor()
            {
                ID   = "OBD2.IntakeManifoldPressure",
                Name = "IntakeManifoldPressure",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0)); },

                Command = 0x0B,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2RPM
            s = new OBD2Sensor()
            {
                ID   = "OBD2.RPM",
                Name = "RPM",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(0) * 256 + get(1)) / 4); },

                Command = 0x0C,
            };

            s.Units = "rpm";

            registry.Add(s);

            // OBD2Speed
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Speed",
                Name = "Speed",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0x00)); },

                Command = 0x0D,
            };

            s.Units = "kph";

            registry.Add(s);

            // OBD2TimingAdvance
            s = new OBD2Sensor()
            {
                ID   = "OBD2.TimingAdvance",
                Name = "TimingAdvance",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0x00) / 2 - 64); },

                Command = 0x0E,
            };

            s.Units = "°";

            registry.Add(s);

            // OBD2IntakeAirTemp
            s = new OBD2Sensor()
            {
                ID   = "OBD2.IntakeAirTemp",
                Name = "IntakeAirTemp",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0x00) - 40); },

                Command = 0x0F,
            };

            s.Units = "celsius";

            registry.Add(s);

            // OBD2MAF
            s = new OBD2Sensor()
            {
                ID   = "OBD2.MAF",
                Name = "MAF",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(((get(0) * 256) + get(1)) / 100); },

                Command = 0x10,
            };

            s.Units = "gr/sec";

            registry.Add(s);

            // OBD2ThrottlePosition
            s = new OBD2Sensor()
            {
                ID   = "OBD2.ThrottlePosition",
                Name = "ThrottlePosition",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) * 100 / 255); },

                Command = 0x11,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b1s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b1s1",
                Name = "Oxygen_b1s1",

                obdValue = (p) => { return(p.get(0) * 0.005); },

                Command = 0x14,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b1s1_stft
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b1s1_stft",
                Name = "Oxygen_b1s1_stft",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(1) - 128) * 100 / 128); },

                Command = 0x14,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b1s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b1s2",
                Name = "Oxygen_b1s2",

                obdValue = (p) => { return(p.get(0) * 0.005); },

                Command = 0x15,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b1s2_stft
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b1s2_stft",
                Name = "Oxygen_b1s2_stft",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(1) - 128) * 100 / 128); },

                Command = 0x15,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b1s3
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b1s3",
                Name = "Oxygen_b1s3",

                obdValue = (p) => { return(p.get(0) * 0.005); },

                Command = 0x16,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b1s3_stft
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b1s3_stft",
                Name = "Oxygen_b1s3_stft",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(1) - 128) * 100 / 128); },

                Command = 0x16,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b1s4
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b1s4",
                Name = "Oxygen_b1s4",

                obdValue = (p) => { return(p.get(0) * 0.005); },

                Command = 0x17,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b1s4_stft
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b1s4_stft",
                Name = "Oxygen_b1s4_stft",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(1) - 128) * 100 / 128); },

                Command = 0x17,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b2s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b2s1",
                Name = "Oxygen_b2s1",

                obdValue = (p) => { return(p.get(0) * 0.005); },

                Command = 0x18,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b2s1_stft
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b2s1_stft",
                Name = "Oxygen_b2s1_stft",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(1) - 128) * 100 / 128); },

                Command = 0x18,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b2s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b2s2",
                Name = "Oxygen_b2s2",

                obdValue = (p) => { return(p.get(0) * 0.005); },

                Command = 0x19,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b2s2_stft
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b2s2_stft",
                Name = "Oxygen_b2s2_stft",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(1) - 128) * 100 / 128); },

                Command = 0x19,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b2s3
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b2s3",
                Name = "Oxygen_b2s3",

                obdValue = (p) => { return(p.get(0) * 0.005); },

                Command = 0x1a,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b2s3_stft
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b2s3_stft",
                Name = "Oxygen_b2s3_stft",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(1) - 128) * 100 / 128); },

                Command = 0x1a,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Oxygen_b2s4
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b2s4",
                Name = "Oxygen_b2s4",

                obdValue = (p) => { return(p.get(0) * 0.005); },

                Command = 0x1b,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Oxygen_b2s4_stft
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen_b2s4_stft",
                Name = "Oxygen_b2s4_stft",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(1) - 128) * 100 / 128); },

                Command = 0x1b,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Lambda_b1s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda_b1s1",
                Name = "Lambda_b1s1",

                obdValue = (p) => { return(p.getab() * 2 / 65535); },

                Command = 0x24,
            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b1s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen2_b1s1",
                Name = "Oxygen2_b1s1",

                obdValue = (p) => { return(p.getcd() * 8 / 65535); },

                Command = 0x24,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b1s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda_b1s2",
                Name = "Lambda_b1s2",

                obdValue = (p) => { return(p.getab() * 2 / 65535); },

                Command = 0x25,
            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b1s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen2_b1s2",
                Name = "Oxygen2_b1s2",

                obdValue = (p) => { return(p.getcd() * 8 / 65535); },

                Command = 0x25,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b2s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda_b2s1",
                Name = "Lambda_b2s1",

                obdValue = (p) => { return(p.getab() * 2 / 65535); },

                Command = 0x26,
            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b2s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen2_b2s1",
                Name = "Oxygen2_b2s1",

                obdValue = (p) => { return(p.getcd() * 8 / 65535); },

                Command = 0x26,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b2s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda_b2s2",
                Name = "Lambda_b2s2",

                obdValue = (p) => { return(p.getab() * 2 / 65535); },

                Command = 0x27,
            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b2s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen2_b2s2",
                Name = "Oxygen2_b2s2",

                obdValue = (p) => { return(p.getcd() * 8 / 65535); },

                Command = 0x27,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b3s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda_b3s1",
                Name = "Lambda_b3s1",

                obdValue = (p) => { return(p.getab() * 2 / 65535); },

                Command = 0x28,
            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b3s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen2_b3s1",
                Name = "Oxygen2_b3s1",

                obdValue = (p) => { return(p.getcd() * 8 / 65535); },

                Command = 0x28,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b3s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda_b3s2",
                Name = "Lambda_b3s2",

                obdValue = (p) => { return(p.getab() * 2 / 65535); },

                Command = 0x29,
            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b3s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen2_b3s2",
                Name = "Oxygen2_b3s2",

                obdValue = (p) => { return(p.getcd() * 8 / 65535); },

                Command = 0x29,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b4s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda_b4s1",
                Name = "Lambda_b4s1",

                obdValue = (p) => { return(p.getab() * 2 / 65535); },

                Command = 0x2a,
            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b4s1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen2_b4s1",
                Name = "Oxygen2_b4s1",

                obdValue = (p) => { return(p.getcd() * 8 / 65535); },

                Command = 0x2a,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2Lambda_b4s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda_b4s2",
                Name = "Lambda_b4s2",

                obdValue = (p) => { return(p.getab() * 2 / 65535); },

                Command = 0x2b,
            };

            s.Units = "";

            registry.Add(s);

            // OBD2Oxygen2_b4s2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Oxygen2_b4s2",
                Name = "Oxygen2_b4s2",

                obdValue = (p) => { return(p.getcd() * 8 / 65535); },

                Command = 0x2b,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2OBDSupport
            s = new OBD2Sensor()
            {
                ID   = "OBD2.OBDSupport",
                Name = "OBDSupport",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0)); },

                Command = 0x1C,
            };

            registry.Add(s);

            // OBD2RunTime
            s = new OBD2Sensor()
            {
                ID   = "OBD2.RunTime",
                Name = "RunTime",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) * 256 + get(1)); },

                Command = 0x1F,
            };

            s.Units = "sec";

            registry.Add(s);

            // OBD2DistanceMIL
            s = new OBD2Sensor()
            {
                ID   = "OBD2.DistanceMIL",
                Name = "DistanceMIL",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) * 256 + get(1)); },

                Command = 0x21,
            };

            s.Units = "km";

            registry.Add(s);

            // OBD2FuelRailPressure_rel
            s = new OBD2Sensor()
            {
                ID   = "OBD2.FuelRailPressure_rel",
                Name = "FuelRailPressure_rel",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((((get(0) * 256) + get(1)) * 10) / 128); },

                Command = 0x22,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2FuelRailPressure_diesel
            s = new OBD2Sensor()
            {
                ID   = "OBD2.FuelRailPressure_diesel",
                Name = "FuelRailPressure_diesel",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(((get(0) * 256) + get(1)) * 10); },

                Command = 0x23,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2CommandedEGR
            s = new OBD2Sensor()
            {
                ID   = "OBD2.CommandedEGR",
                Name = "CommandedEGR",

                obdValue = (p) => { return(p.get(0) * 100 / 255); },

                Command = 0x2C,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2EGRError
            s = new OBD2Sensor()
            {
                ID   = "OBD2.EGRError",
                Name = "EGRError",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(0) - 128) * 100 / 128); },

                Command = 0x2D,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Commanded_EVAP
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Commanded_EVAP",
                Name = "Commanded_EVAP",

                obdValue = (p) => { return(p.get(0) * 100 / 255); },

                Command = 0x2E,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2FuelLevel
            s = new OBD2Sensor()
            {
                ID   = "OBD2.FuelLevel",
                Name = "FuelLevel",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(100 * get(0) / 255); },

                Command = 0x2F,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2DistanceMILCleared
            s = new OBD2Sensor()
            {
                ID   = "OBD2.DistanceMILCleared",
                Name = "DistanceMILCleared",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) * 256 + get(1)); },

                Command = 0x31,
            };

            s.Units = "km";

            registry.Add(s);

            // OBD2VaporPressure
            s = new OBD2Sensor()
            {
                ID   = "OBD2.VaporPressure",
                Name = "VaporPressure",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(((get(0) * 256) + get(1)) / 4); },

                Command = 0x32,
            };

            s.Units = "Pa";

            registry.Add(s);

            // OBD2BaroPressure
            s = new OBD2Sensor()
            {
                ID   = "OBD2.BaroPressure",
                Name = "BaroPressure",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0)); },

                Command = 0x33,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2ControlModuleVoltage
            s = new OBD2Sensor()
            {
                ID   = "OBD2.ControlModuleVoltage",
                Name = "ControlModuleVoltage",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(((get(0) * 256) + get(1)) / 1000); },

                Command = 0x42,
            };

            s.Units = "V";

            registry.Add(s);

            // OBD2AbsoluteLoadValue
            s = new OBD2Sensor()
            {
                ID   = "OBD2.AbsoluteLoadValue",
                Name = "AbsoluteLoadValue",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(((get(0) * 256) + get(1)) * 100 / 255); },

                Command = 0x43,
            };

            s.Units = "%";

            registry.Add(s);

            // OBD2Lambda
            s = new OBD2Sensor()
            {
                ID   = "OBD2.Lambda",
                Name = "Lambda",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return((get(0) * 256 + get(1)) * 2.0 / 65535); },

                Command = 0x44,
            };

            registry.Add(s);

            // OBD2AirTemp
            s = new OBD2Sensor()
            {
                ID   = "OBD2.AirTemp",
                Name = "AirTemp",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) - 40); },

                Command = 0x46,
            };

            s.Units = "celsius";

            registry.Add(s);

            // OBD2EngineOilTemp
            s = new OBD2Sensor()
            {
                ID   = "OBD2.EngineOilTemp",
                Name = "EngineOilTemp",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(get(0) - 40); },

                Command = 0x5C,
            };

            s.Units = "celsius";

            registry.Add(s);

            // OBD2FuelInjectionTiming
            s = new OBD2Sensor()
            {
                ID   = "OBD2.FuelInjectionTiming",
                Name = "FuelInjectionTiming",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(((get(0) * 256) + get(1) - 26880) / 128); },

                Command = 0x5D,
            };

            s.Units = "degree";

            registry.Add(s);

            // OBD2LitersPerHour
            s = new OBD2Sensor()
            {
                ID   = "OBD2.LitersPerHour",
                Name = "LitersPerHour",

                obdValue = (p) => { Func <int, double> get = p.get; Func <int, int, double> get_bit = p.get_bit;
                                    return(((get(0) * 256) + get(1)) * 0.05); },

                Command = 0x5E,
            };

            s.Units = "lphour";

            registry.Add(s);

            // OBD2TCA_CINP
            s = new OBD2Sensor()
            {
                ID   = "OBD2.TCA_CINP",
                Name = "TCA_CINP",

                obdValue = (p) => { return(p.get(1) * 1); },

                Command = 0x6F,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2TCB_CINP
            s = new OBD2Sensor()
            {
                ID   = "OBD2.TCB_CINP",
                Name = "TCB_CINP",

                obdValue = (p) => { return(p.get(2) * 1); },

                Command = 0x6F,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2EP_1
            s = new OBD2Sensor()
            {
                ID   = "OBD2.EP_1",
                Name = "EP_1",

                obdValue = (p) => { return(p.getbc() * 0.01); },

                Command = 0x73,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2EP_2
            s = new OBD2Sensor()
            {
                ID   = "OBD2.EP_2",
                Name = "EP_2",

                obdValue = (p) => { return(p.getde() * 0.01); },

                Command = 0x73,
            };

            s.Units = "kPa";

            registry.Add(s);

            // OBD2TCA_RPM
            s = new OBD2Sensor()
            {
                ID   = "OBD2.TCA_RPM",
                Name = "TCA_RPM",

                obdValue = (p) => { return(p.getbc() * 1); },

                Command = 0x74,
            };

            s.Units = "rpm";

            registry.Add(s);

            // OBD2TCB_RPM
            s = new OBD2Sensor()
            {
                ID   = "OBD2.TCB_RPM",
                Name = "TCB_RPM",

                obdValue = (p) => { return(p.getde() * 1); },

                Command = 0x74,
            };

            s.Units = "rpm";

            registry.Add(s);

            // OBD2MIL
            s = new hobd.MILSensor()
            {
                ID   = "OBD2.MIL",
                Name = "MIL",
            };

            registry.Add(s);

            // OBD2PMIL
            s = new hobd.PMILSensor()
            {
                ID   = "OBD2.PMIL",
                Name = "PMIL",
            };

            registry.Add(s);

            // OBD2ClearDTC
            s = new hobd.ClearDTCSensor()
            {
                ID   = "OBD2.ClearDTC",
                Name = "ClearDTC",
            };

            registry.Add(s);
        }