From 3faefc97ca9636290fadccf5a28eac838fd86c12 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Tue, 11 Aug 2020 20:27:21 +0200 Subject: [PATCH] Added EngineCoolantTemperatureSensor (0x67) and IntakeAirTemperatureSensor (0x68) --- .../60-7F/EngineCoolantTemperatureSensor.cs | 29 ++++++++++++++++ .../60-7F/IntakeAirTemperatureSensor.cs | 33 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 OBD.NET/OBD.NET.Common/OBDData/60-7F/EngineCoolantTemperatureSensor.cs create mode 100644 OBD.NET/OBD.NET.Common/OBDData/60-7F/IntakeAirTemperatureSensor.cs diff --git a/OBD.NET/OBD.NET.Common/OBDData/60-7F/EngineCoolantTemperatureSensor.cs b/OBD.NET/OBD.NET.Common/OBDData/60-7F/EngineCoolantTemperatureSensor.cs new file mode 100644 index 0000000..0dc335c --- /dev/null +++ b/OBD.NET/OBD.NET.Common/OBDData/60-7F/EngineCoolantTemperatureSensor.cs @@ -0,0 +1,29 @@ +using OBD.NET.Common.DataTypes; + +namespace OBD.NET.Common.OBDData +{ + public class EngineCoolantTemperatureSensor : AbstractOBDData + { + #region Properties & Fields + + public int SensorsSupported => A; + public DegreeCelsius Sensor1 => new DegreeCelsius(B - 40, -40, 215); + public DegreeCelsius Sensor2 => new DegreeCelsius(C - 40, -40, 215); + + #endregion + + #region Constructors + + public EngineCoolantTemperatureSensor() + : base(0x67, 3) + { } + + #endregion + + #region Methods + + public override string ToString() => Sensor1.ToString(); + + #endregion + } +} diff --git a/OBD.NET/OBD.NET.Common/OBDData/60-7F/IntakeAirTemperatureSensor.cs b/OBD.NET/OBD.NET.Common/OBDData/60-7F/IntakeAirTemperatureSensor.cs new file mode 100644 index 0000000..795fdfc --- /dev/null +++ b/OBD.NET/OBD.NET.Common/OBDData/60-7F/IntakeAirTemperatureSensor.cs @@ -0,0 +1,33 @@ +using OBD.NET.Common.DataTypes; + +namespace OBD.NET.Common.OBDData +{ + public class IntakeAirTemperatureSensor : AbstractOBDData + { + #region Properties & Fields + + public int SensorsSupported => A; + public DegreeCelsius Bank1Sensor1 => new DegreeCelsius(B - 40, -40, 215); + public DegreeCelsius Bank1Sensor2 => new DegreeCelsius(C - 40, -40, 215); + public DegreeCelsius Bank1Sensor3 => new DegreeCelsius(D - 40, -40, 215); + public DegreeCelsius Bank2Sensor1 => new DegreeCelsius(E - 40, -40, 215); + public DegreeCelsius Bank2Sensor2 => new DegreeCelsius(RawData[5] - 40, -40, 215); + public DegreeCelsius Bank2Sensor3 => new DegreeCelsius(RawData[6] - 40, -40, 215); + + #endregion + + #region Constructors + + public IntakeAirTemperatureSensor() + : base(0x68, 7) + { } + + #endregion + + #region Methods + + public override string ToString() => Bank1Sensor1.ToString(); + + #endregion + } +}