diff --git a/OBD.NET/OBD.NET.Common/Commands/ATCommand.cs b/OBD.NET/OBD.NET.Common/Commands/ATCommand.cs
index 6267372..04c6a45 100644
--- a/OBD.NET/OBD.NET.Common/Commands/ATCommand.cs
+++ b/OBD.NET/OBD.NET.Common/Commands/ATCommand.cs
@@ -1,8 +1,9 @@
-namespace OBD.NET.Commands
+namespace OBD.NET.Common.Commands
{
public class ATCommand
{
- #region Values
+ #region Commands
+ // ReSharper disable InconsistentNaming
//TODO DarthAffe 26.06.2016: Implement all commands
@@ -21,6 +22,7 @@
public static readonly ATCommand PrintVersion = new ATCommand("ATI", "^ELM327.*");
public static readonly ATCommand CloseProtocol = new ATCommand("ATPC");
+ // ReSharper restore InconsistentNaming
#endregion
#region Properties & Fields
@@ -42,19 +44,13 @@
#region Methods
- public override string ToString()
- {
- return Command;
- }
+ public override string ToString() => Command;
#endregion
#region Operators
- public static implicit operator string(ATCommand command)
- {
- return command.ToString();
- }
+ public static implicit operator string(ATCommand command) => command.ToString();
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/Commands/STCommand.cs b/OBD.NET/OBD.NET.Common/Commands/STCommand.cs
index e0e1af8..818ceeb 100644
--- a/OBD.NET/OBD.NET.Common/Commands/STCommand.cs
+++ b/OBD.NET/OBD.NET.Common/Commands/STCommand.cs
@@ -1,8 +1,9 @@
-namespace OBD.NET.Commands
+namespace OBD.NET.Common.Commands
{
public class STCommand
{
#region Values
+ // ReSharper disable InconsistentNaming
//TODO DarthAffe 19.03.2017: Implement all commands
@@ -15,6 +16,7 @@
internal static readonly STCommand Monitor = new STCommand("STM");
internal static readonly STCommand MonitorAll = new STCommand("STMA");
+ // ReSharper restore InconsistentNaming
#endregion
#region Properties & Fields
@@ -34,19 +36,13 @@
#region Methods
- public override string ToString()
- {
- return Command;
- }
+ public override string ToString() => Command;
#endregion
#region Operators
- public static implicit operator string(STCommand command)
- {
- return command.ToString();
- }
+ public static implicit operator string(STCommand command) => command.ToString();
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/Communication/EventArgs/DataReceivedEventArgs.cs b/OBD.NET/OBD.NET.Common/Communication/EventArgs/DataReceivedEventArgs.cs
index bff6c57..07231b3 100644
--- a/OBD.NET/OBD.NET.Common/Communication/EventArgs/DataReceivedEventArgs.cs
+++ b/OBD.NET/OBD.NET.Common/Communication/EventArgs/DataReceivedEventArgs.cs
@@ -3,8 +3,24 @@
///
/// Event args for receiving serial data
///
- public class DataReceivedEventArgs:System.EventArgs
+ public class DataReceivedEventArgs : System.EventArgs
{
+ #region Properties & Fields
+
+ ///
+ /// Count of valid data bytes in the buffer
+ ///
+ public int Count { get; }
+
+ ///
+ /// Data buffer holding the bytes
+ ///
+ public byte[] Data { get; }
+
+ #endregion
+
+ #region Constructors
+
///
/// Initializes a new instance of the class.
///
@@ -12,18 +28,10 @@
/// The data.
public DataReceivedEventArgs(int count, byte[] data)
{
- Count = count;
- Data = data;
+ this.Count = count;
+ this.Data = data;
}
- ///
- /// Count of valid data bytes in the buffer
- ///
- public int Count { get; private set; }
-
- ///
- /// Data buffer holding the bytes
- ///
- public byte[] Data { get; private set; }
+ #endregion
}
}
diff --git a/OBD.NET/OBD.NET.Common/Communication/ISerialConnection.cs b/OBD.NET/OBD.NET.Common/Communication/ISerialConnection.cs
index 6b2ea8e..0fec8a8 100644
--- a/OBD.NET/OBD.NET.Common/Communication/ISerialConnection.cs
+++ b/OBD.NET/OBD.NET.Common/Communication/ISerialConnection.cs
@@ -1,8 +1,8 @@
-using OBD.NET.Common.Communication.EventArgs;
-using System;
+using System;
using System.Threading.Tasks;
+using OBD.NET.Common.Communication.EventArgs;
-namespace OBD.NET.Communication
+namespace OBD.NET.Common.Communication
{
///
/// Serial connection interface
@@ -42,18 +42,17 @@ namespace OBD.NET.Communication
///
///
Task ConnectAsync();
-
+
///
/// Writes the specified data to the serial connection
///
- /// The text.
+ /// The data.
void Write(byte[] data);
///
/// Writes the specified data to the serial connection asynchronous
///
- /// The text.
+ /// The data.
Task WriteAsync(byte[] data);
-
}
}
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Count.cs b/OBD.NET/OBD.NET.Common/DataTypes/Count.cs
index 1c29a00..d8e6675 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Count.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Count.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Count : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Degree.cs b/OBD.NET/OBD.NET.Common/DataTypes/Degree.cs
index 07afad0..af06dff 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Degree.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Degree.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Degree : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/DegreeCelsius.cs b/OBD.NET/OBD.NET.Common/DataTypes/DegreeCelsius.cs
index f53f3aa..85d5bdc 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/DegreeCelsius.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/DegreeCelsius.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class DegreeCelsius : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/GenericData.cs b/OBD.NET/OBD.NET.Common/DataTypes/GenericData.cs
index fc25c75..3db09e3 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/GenericData.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/GenericData.cs
@@ -1,6 +1,6 @@
using System;
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public abstract class GenericData
{
@@ -17,7 +17,7 @@ namespace OBD.NET.DataTypes
#region Constructors
- public GenericData(double value, double minValue, double maxValue)
+ protected GenericData(double value, double minValue, double maxValue)
{
this.Value = value;
this.MinValue = minValue;
@@ -25,7 +25,7 @@ namespace OBD.NET.DataTypes
this.IsFloatingPointValue = true;
}
- public GenericData(int value, int minValue, int maxValue)
+ protected GenericData(int value, int minValue, int maxValue)
{
this.Value = value;
this.MinValue = minValue;
@@ -37,24 +37,15 @@ namespace OBD.NET.DataTypes
#region Operators
- public static implicit operator double(GenericData p)
- {
- return p.Value;
- }
+ public static implicit operator double(GenericData p) => p.Value;
- public static implicit operator int(GenericData p)
- {
- return (int)Math.Round(p.Value);
- }
+ public static implicit operator int(GenericData p) => (int)Math.Round(p.Value);
#endregion
#region Methods
- public override string ToString()
- {
- return (IsFloatingPointValue ? Value.ToString("0.00") : Value.ToString()) + (Unit == null ? string.Empty : (" " + Unit));
- }
+ public override string ToString() => (IsFloatingPointValue ? Value.ToString("0.00") : Value.ToString()) + (Unit == null ? string.Empty : (" " + Unit));
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/GramPerSec.cs b/OBD.NET/OBD.NET.Common/DataTypes/GramPerSec.cs
index 273a9d4..76ccd5f 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/GramPerSec.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/GramPerSec.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class GramPerSec : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Kilometre.cs b/OBD.NET/OBD.NET.Common/DataTypes/Kilometre.cs
index 49069c5..9368e76 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Kilometre.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Kilometre.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Kilometre : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/KilometrePerHour.cs b/OBD.NET/OBD.NET.Common/DataTypes/KilometrePerHour.cs
index 14686cd..d265720 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/KilometrePerHour.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/KilometrePerHour.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class KilometrePerHour : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Kilopascal.cs b/OBD.NET/OBD.NET.Common/DataTypes/Kilopascal.cs
index f30c733..73b7c28 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Kilopascal.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Kilopascal.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Kilopascal : GenericData
{
@@ -22,10 +22,7 @@
#region Operators
- public static explicit operator Pascal(Kilopascal pa)
- {
- return new Pascal(pa.Value / 1000.0, pa.MinValue / 1000.0, pa.MaxValue / 1000.0);
- }
+ public static explicit operator Pascal(Kilopascal pa) => new Pascal(pa.Value / 1000.0, pa.MinValue / 1000.0, pa.MaxValue / 1000.0);
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/LitresPerHour.cs b/OBD.NET/OBD.NET.Common/DataTypes/LitresPerHour.cs
index e298429..232bc29 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/LitresPerHour.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/LitresPerHour.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class LitresPerHour : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Milliampere.cs b/OBD.NET/OBD.NET.Common/DataTypes/Milliampere.cs
index ad2cf6f..5a3d176 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Milliampere.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Milliampere.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Milliampere : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Minute.cs b/OBD.NET/OBD.NET.Common/DataTypes/Minute.cs
index 1c9cecd..104ec73 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Minute.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Minute.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Minute : GenericData
{
@@ -22,12 +22,9 @@
#region Operators
- public static explicit operator Second(Minute m)
- {
- return m.IsFloatingPointValue
- ? new Second(m.Value * 60, m.MinValue * 60, m.MaxValue * 60)
- : new Second((int)(m.Value * 60), (int)(m.MinValue * 60), (int)(m.MaxValue * 60));
- }
+ public static explicit operator Second(Minute m) => m.IsFloatingPointValue
+ ? new Second(m.Value * 60, m.MinValue * 60, m.MaxValue * 60)
+ : new Second((int)(m.Value * 60), (int)(m.MinValue * 60), (int)(m.MaxValue * 60));
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/NewtonMetre.cs b/OBD.NET/OBD.NET.Common/DataTypes/NewtonMetre.cs
index 40dffcd..25651be 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/NewtonMetre.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/NewtonMetre.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class NewtonMetre : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Pascal.cs b/OBD.NET/OBD.NET.Common/DataTypes/Pascal.cs
index a0fc91d..f81f42b 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Pascal.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Pascal.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Pascal : GenericData
{
@@ -22,12 +22,9 @@
#region Operators
- public static explicit operator Kilopascal(Pascal pa)
- {
- return pa.IsFloatingPointValue
- ? new Kilopascal(pa.Value * 1000, pa.MinValue * 1000, pa.MaxValue * 1000)
- : new Kilopascal((int)(pa.Value * 1000), (int)(pa.MinValue * 1000), (int)(pa.MaxValue * 1000));
- }
+ public static explicit operator Kilopascal(Pascal pa) => pa.IsFloatingPointValue
+ ? new Kilopascal(pa.Value * 1000, pa.MinValue * 1000, pa.MaxValue * 1000)
+ : new Kilopascal((int)(pa.Value * 1000), (int)(pa.MinValue * 1000), (int)(pa.MaxValue * 1000));
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Percent.cs b/OBD.NET/OBD.NET.Common/DataTypes/Percent.cs
index a255df9..55541cc 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Percent.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Percent.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Percent : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Ratio.cs b/OBD.NET/OBD.NET.Common/DataTypes/Ratio.cs
index 724c7e2..cf871f5 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Ratio.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Ratio.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Ratio : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/RevolutionsPerMinute.cs b/OBD.NET/OBD.NET.Common/DataTypes/RevolutionsPerMinute.cs
index f8c9247..3162590 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/RevolutionsPerMinute.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/RevolutionsPerMinute.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class RevolutionsPerMinute : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Second.cs b/OBD.NET/OBD.NET.Common/DataTypes/Second.cs
index ce37354..3072a2c 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Second.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Second.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Second : GenericData
{
@@ -22,10 +22,7 @@
#region Operators
- public static explicit operator Minute(Second s)
- {
- return new Minute(s.Value / 60.0, s.MinValue / 60.0, s.MaxValue / 60.0);
- }
+ public static explicit operator Minute(Second s) => new Minute(s.Value / 60.0, s.MinValue / 60.0, s.MaxValue / 60.0);
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/DataTypes/Volt.cs b/OBD.NET/OBD.NET.Common/DataTypes/Volt.cs
index 70dcdcc..3d372b3 100644
--- a/OBD.NET/OBD.NET.Common/DataTypes/Volt.cs
+++ b/OBD.NET/OBD.NET.Common/DataTypes/Volt.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.DataTypes
+namespace OBD.NET.Common.DataTypes
{
public class Volt : GenericData
{
diff --git a/OBD.NET/OBD.NET.Common/Devices/Command.cs b/OBD.NET/OBD.NET.Common/Devices/Command.cs
index c3b306c..4a6d766 100644
--- a/OBD.NET/OBD.NET.Common/Devices/Command.cs
+++ b/OBD.NET/OBD.NET.Common/Devices/Command.cs
@@ -1,27 +1,27 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace OBD.NET.Common.Devices
+namespace OBD.NET.Common.Devices
{
///
/// Class used for queued command
///
public class QueuedCommand
{
+ #region Properties & Fields
- ///
- /// Initializes a new instance
- ///
- ///
- public QueuedCommand(string commandText)
- {
- CommandResult = new CommandResult();
- CommandText = commandText;
- }
-
- public string CommandText { get; set; }
+ public string CommandText { get; private set; }
public CommandResult CommandResult { get; }
+
+ #endregion
+
+ #region Constructors
+
+ public QueuedCommand(string commandText)
+ {
+ this.CommandText = commandText;
+
+ CommandResult = new CommandResult();
+ }
+
+ #endregion
}
}
diff --git a/OBD.NET/OBD.NET.Common/Devices/CommandResult.cs b/OBD.NET/OBD.NET.Common/Devices/CommandResult.cs
index 7352301..3c30514 100644
--- a/OBD.NET/OBD.NET.Common/Devices/CommandResult.cs
+++ b/OBD.NET/OBD.NET.Common/Devices/CommandResult.cs
@@ -1,18 +1,23 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using OBD.NET.Util;
+using OBD.NET.Common.Util;
namespace OBD.NET.Common.Devices
{
public class CommandResult
{
+ #region Properties & Fields
+
+ public object Result { get; set; }
+ public AsyncManualResetEvent WaitHandle { get; }
+
+ #endregion
+
+ #region Constructors
+
public CommandResult()
{
WaitHandle = new AsyncManualResetEvent();
}
- public object Result { get; set; }
- public AsyncManualResetEvent WaitHandle { get; }
+ #endregion
}
}
diff --git a/OBD.NET/OBD.NET.Common/Devices/ELM327.cs b/OBD.NET/OBD.NET.Common/Devices/ELM327.cs
index 170f561..4f0218c 100644
--- a/OBD.NET/OBD.NET.Common/Devices/ELM327.cs
+++ b/OBD.NET/OBD.NET.Common/Devices/ELM327.cs
@@ -1,29 +1,28 @@
using System;
using System.Collections.Generic;
-using System.Threading;
-using OBD.NET.Commands;
-using OBD.NET.Communication;
-using OBD.NET.Enums;
-using OBD.NET.Events;
-using OBD.NET.Events.EventArgs;
-using OBD.NET.Extensions;
-using OBD.NET.Logging;
-using OBD.NET.OBDData;
using System.Threading.Tasks;
+using OBD.NET.Common.Commands;
+using OBD.NET.Common.Communication;
+using OBD.NET.Common.Enums;
+using OBD.NET.Common.Events;
+using OBD.NET.Common.Events.EventArgs;
+using OBD.NET.Common.Extensions;
+using OBD.NET.Common.Logging;
+using OBD.NET.Common.OBDData;
-namespace OBD.NET.Devices
+namespace OBD.NET.Common.Devices
{
public class ELM327 : SerialDevice
{
#region Properties & Fields
- protected Dictionary _dataReceivedEventHandlers = new Dictionary();
+ protected readonly Dictionary DataReceivedEventHandlers = new Dictionary();
protected static Dictionary PidCache { get; } = new Dictionary();
protected static Dictionary DataTypeCache { get; } = new Dictionary();
protected Mode Mode { get; set; } = Mode.ShowCurrentData; //TODO DarthAffe 26.06.2016: Implement different modes
-
+
#endregion
#region Events
@@ -89,16 +88,12 @@ namespace OBD.NET.Devices
throw;
}
}
-
-
+
///
/// Sends the AT command.
///
/// The command.
- public virtual void SendCommand(ATCommand command)
- {
- SendCommand(command.Command);
- }
+ public virtual void SendCommand(ATCommand command) => SendCommand(command.Command);
///
/// Requests the data and calls the handler
@@ -130,14 +125,12 @@ namespace OBD.NET.Devices
Logger?.WriteLine("Requesting Type " + typeof(T).Name + " ...", OBDLogLevel.Debug);
byte pid = ResolvePid();
Logger?.WriteLine("Requesting PID " + pid.ToString("X2") + " ...", OBDLogLevel.Debug);
- var result = SendCommand(((byte)Mode).ToString("X2") + pid.ToString("X2"));
+ CommandResult result = SendCommand(((byte)Mode).ToString("X2") + pid.ToString("X2"));
await result.WaitHandle.WaitAsync();
return result.Result as T;
}
-
-
protected override object ProcessMessage(string message)
{
DateTime timestamp = DateTime.Now;
@@ -145,21 +138,19 @@ namespace OBD.NET.Devices
RawDataReceived?.Invoke(this, new RawDataReceivedEventArgs(message, timestamp));
if (message.Length > 4)
- {
+ {
if (message[0] == '4')
{
byte mode = (byte)message[1].GetHexVal();
if (mode == (byte)Mode)
{
byte pid = (byte)message.Substring(2, 2).GetHexVal();
- Type dataType;
- if (DataTypeCache.TryGetValue(pid, out dataType))
+ if (DataTypeCache.TryGetValue(pid, out Type dataType))
{
IOBDData obdData = (IOBDData)Activator.CreateInstance(dataType);
obdData.Load(message.Substring(4, message.Length - 4));
-
- IDataEventManager dataEventManager;
- if (_dataReceivedEventHandlers.TryGetValue(dataType, out dataEventManager))
+
+ if (DataReceivedEventHandlers.TryGetValue(dataType, out IDataEventManager dataEventManager))
dataEventManager.RaiseEvent(this, obdData, timestamp);
return obdData;
@@ -173,8 +164,7 @@ namespace OBD.NET.Devices
protected virtual byte ResolvePid()
where T : class, IOBDData, new()
{
- byte pid;
- if (!PidCache.TryGetValue(typeof(T), out pid))
+ if (!PidCache.TryGetValue(typeof(T), out byte pid))
{
T data = Activator.CreateInstance();
pid = data.PID;
@@ -185,40 +175,33 @@ namespace OBD.NET.Devices
return pid;
}
- public override void Dispose()
- {
- Dispose(true);
- }
+ public override void Dispose() => Dispose(true);
public void Dispose(bool sendCloseProtocol)
{
try
{
if (sendCloseProtocol)
- {
SendCommand(ATCommand.CloseProtocol);
- }
}
- catch { }
+ catch { /* Well at least we tried ... */ }
- _dataReceivedEventHandlers.Clear();
+ DataReceivedEventHandlers.Clear();
base.Dispose();
}
public void SubscribeDataReceived(DataReceivedEventHandler eventHandler) where T : IOBDData
{
- IDataEventManager eventManager;
- if (!_dataReceivedEventHandlers.TryGetValue(typeof(T), out eventManager))
- _dataReceivedEventHandlers.Add(typeof(T), (eventManager = new GenericDataEventManager()));
+ if (!DataReceivedEventHandlers.TryGetValue(typeof(T), out IDataEventManager eventManager))
+ DataReceivedEventHandlers.Add(typeof(T), (eventManager = new GenericDataEventManager()));
((GenericDataEventManager)eventManager).DataReceived += eventHandler;
}
public void UnsubscribeDataReceived(DataReceivedEventHandler eventHandler) where T : IOBDData
{
- IDataEventManager eventManager;
- if (_dataReceivedEventHandlers.TryGetValue(typeof(T), out eventManager))
+ if (DataReceivedEventHandlers.TryGetValue(typeof(T), out IDataEventManager eventManager))
((GenericDataEventManager)eventManager).DataReceived -= eventHandler;
}
diff --git a/OBD.NET/OBD.NET.Common/Devices/STN1170.cs b/OBD.NET/OBD.NET.Common/Devices/STN1170.cs
index af35037..44c6c3e 100644
--- a/OBD.NET/OBD.NET.Common/Devices/STN1170.cs
+++ b/OBD.NET/OBD.NET.Common/Devices/STN1170.cs
@@ -1,12 +1,11 @@
-using OBD.NET.Communication;
-using OBD.NET.Logging;
+using OBD.NET.Common.Commands;
+using OBD.NET.Common.Communication;
+using OBD.NET.Common.Logging;
-namespace OBD.NET.Devices
+namespace OBD.NET.Common.Devices
{
public class STN1170 : ELM327 // Fully compatible device
{
- //TODO DarthAffe 26.06.2016: Add ST-Commands and stuff
-
#region Constructors
public STN1170(ISerialConnection connection, IOBDLogger logger = null)
@@ -14,5 +13,15 @@ namespace OBD.NET.Devices
{ }
#endregion
+
+ #region Methods
+
+ ///
+ /// Sends the ST command.
+ ///
+ /// The command.
+ public virtual void SendCommand(STCommand command) => SendCommand(command.Command);
+
+ #endregion
}
}
diff --git a/OBD.NET/OBD.NET.Common/Devices/SerialDevice.cs b/OBD.NET/OBD.NET.Common/Devices/SerialDevice.cs
index 7427e0b..d911954 100644
--- a/OBD.NET/OBD.NET.Common/Devices/SerialDevice.cs
+++ b/OBD.NET/OBD.NET.Common/Devices/SerialDevice.cs
@@ -1,59 +1,37 @@
using System;
-using OBD.NET.Communication;
-using OBD.NET.Exceptions;
-using OBD.NET.Logging;
-using System.Threading.Tasks;
-using OBD.NET.Common.Communication.EventArgs;
+using System.Collections.Concurrent;
using System.Text;
using System.Threading;
-using System.Collections.Concurrent;
-using OBD.NET.Common.Devices;
+using System.Threading.Tasks;
+using OBD.NET.Common.Communication;
+using OBD.NET.Common.Communication.EventArgs;
+using OBD.NET.Common.Exceptions;
+using OBD.NET.Common.Logging;
-namespace OBD.NET.Devices
-{
+namespace OBD.NET.Common.Devices
+{
///
/// Base class used for communicating with the device
///
public abstract class SerialDevice : IDisposable
{
- private BlockingCollection commandQueue;
+ #region Properties & Fields
+ private readonly BlockingCollection _commandQueue = new BlockingCollection();
private readonly StringBuilder _lineBuffer = new StringBuilder();
+ private readonly AutoResetEvent _commandFinishedEvent = new AutoResetEvent(false);
+ private Task _commandWorkerTask;
+ private CancellationTokenSource _commandCancellationToken;
- private readonly AutoResetEvent commandFinishedEvent = new AutoResetEvent(false);
-
- private Task commandWorkerTask;
-
- private CancellationTokenSource commandCancellationToken;
-
- protected QueuedCommand currentCommand;
-
- ///
- /// Logger instance
- ///
+ protected QueuedCommand CurrentCommand;
protected IOBDLogger Logger { get; }
-
- ///
- /// Low level connection
- ///
protected ISerialConnection Connection { get; }
-
- ///
- /// Terminator of the protocol message
- ///
protected char Terminator { get; set; }
+ #endregion
#region Constructors
- ///
- /// Prevents a default instance of the class from being created.
- ///
- private SerialDevice()
- {
- commandQueue = new BlockingCollection();
- }
-
///
/// Initializes a new instance of the class.
///
@@ -61,21 +39,18 @@ namespace OBD.NET.Devices
/// terminator used for terminating the command message
/// logger instance
protected SerialDevice(ISerialConnection connection, char terminator = '\r', IOBDLogger logger = null)
- :this()
{
- Connection = connection;
- Terminator = terminator;
- Logger = logger;
+ this.Connection = connection;
+ this.Terminator = terminator;
+ this.Logger = logger;
connection.DataReceived += OnDataReceived;
}
-
#endregion
-
+
#region Methods
-
///
/// Initializes the device
///
@@ -105,13 +80,11 @@ namespace OBD.NET.Devices
Logger?.WriteLine("Failed to open Serial-Connection.", OBDLogLevel.Error);
throw new SerialException("Failed to open Serial-Connection.");
}
- else
- {
- Logger?.WriteLine("Opened Serial-Connection!", OBDLogLevel.Debug);
- }
- commandCancellationToken = new CancellationTokenSource();
- commandWorkerTask = Task.Factory.StartNew(CommandWorker);
+ Logger?.WriteLine("Opened Serial-Connection!", OBDLogLevel.Debug);
+
+ _commandCancellationToken = new CancellationTokenSource();
+ _commandWorkerTask = Task.Factory.StartNew(CommandWorker);
}
@@ -123,19 +96,17 @@ namespace OBD.NET.Devices
protected virtual CommandResult SendCommand(string command)
{
if (!Connection.IsOpen)
- {
throw new InvalidOperationException("Not connected");
- }
-
command = PrepareCommand(command);
Logger?.WriteLine("Queuing Command: '" + command.Replace('\r', '\'') + "'", OBDLogLevel.Verbose);
- var cmd = new QueuedCommand(command);
- commandQueue.Add(cmd);
+ QueuedCommand cmd = new QueuedCommand(command);
+ _commandQueue.Add(cmd);
+
return cmd.CommandResult;
}
-
+
///
/// Prepares the command
///
@@ -168,8 +139,8 @@ namespace OBD.NET.Devices
break;
case '>':
- currentCommand.CommandResult.WaitHandle.Set();
- commandFinishedEvent.Set();
+ CurrentCommand.CommandResult.WaitHandle.Set();
+ _commandFinishedEvent.Set();
break;
case '\n':
@@ -203,8 +174,8 @@ namespace OBD.NET.Devices
/// The message.
private void InternalProcessMessage(string message)
{
- var data = ProcessMessage(message);
- currentCommand.CommandResult.Result = data;
+ object data = ProcessMessage(message);
+ CurrentCommand.CommandResult.Result = data;
}
///
@@ -219,7 +190,7 @@ namespace OBD.NET.Devices
///
private async void CommandWorker()
{
- while (!commandCancellationToken.IsCancellationRequested)
+ while (!_commandCancellationToken.IsCancellationRequested)
{
currentCommand = null;
try
@@ -229,14 +200,9 @@ namespace OBD.NET.Devices
Logger?.WriteLine("Writing Command: '" + currentCommand.CommandText.Replace('\r', '\'') + "'", OBDLogLevel.Verbose);
if (Connection.IsAsync)
- {
await Connection.WriteAsync(Encoding.ASCII.GetBytes(currentCommand.CommandText));
- }
else
- {
Connection.Write(Encoding.ASCII.GetBytes(currentCommand.CommandText));
-
- }
//wait for command to finish
commandFinishedEvent.WaitOne();
}
diff --git a/OBD.NET/OBD.NET.Common/Enums/Mode.cs b/OBD.NET/OBD.NET.Common/Enums/Mode.cs
index 8722a8d..9126eb6 100644
--- a/OBD.NET/OBD.NET.Common/Enums/Mode.cs
+++ b/OBD.NET/OBD.NET.Common/Enums/Mode.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.Enums
+namespace OBD.NET.Common.Enums
{
///
/// https://en.wikipedia.org/wiki/OBD-II_PIDs#Modes
diff --git a/OBD.NET/OBD.NET.Common/Events/EventArgs/DataReceivedEventArgs.cs b/OBD.NET/OBD.NET.Common/Events/EventArgs/DataReceivedEventArgs.cs
index 4fada1f..557ce18 100644
--- a/OBD.NET/OBD.NET.Common/Events/EventArgs/DataReceivedEventArgs.cs
+++ b/OBD.NET/OBD.NET.Common/Events/EventArgs/DataReceivedEventArgs.cs
@@ -1,7 +1,7 @@
using System;
-using OBD.NET.OBDData;
+using OBD.NET.Common.OBDData;
-namespace OBD.NET.Events.EventArgs
+namespace OBD.NET.Common.Events.EventArgs
{
public class DataReceivedEventArgs where T : IOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/Events/EventArgs/RawDataReceivedEventArgs.cs b/OBD.NET/OBD.NET.Common/Events/EventArgs/RawDataReceivedEventArgs.cs
index 8fd7c0e..680bff6 100644
--- a/OBD.NET/OBD.NET.Common/Events/EventArgs/RawDataReceivedEventArgs.cs
+++ b/OBD.NET/OBD.NET.Common/Events/EventArgs/RawDataReceivedEventArgs.cs
@@ -1,6 +1,6 @@
using System;
-namespace OBD.NET.Events.EventArgs
+namespace OBD.NET.Common.Events.EventArgs
{
public class RawDataReceivedEventArgs
{
diff --git a/OBD.NET/OBD.NET.Common/Events/GenericDataEventManager.cs b/OBD.NET/OBD.NET.Common/Events/GenericDataEventManager.cs
index 2b355bf..39ad47b 100644
--- a/OBD.NET/OBD.NET.Common/Events/GenericDataEventManager.cs
+++ b/OBD.NET/OBD.NET.Common/Events/GenericDataEventManager.cs
@@ -1,32 +1,22 @@
using System;
-using OBD.NET.Devices;
-using OBD.NET.Events.EventArgs;
-using OBD.NET.OBDData;
+using OBD.NET.Common.Devices;
+using OBD.NET.Common.Events.EventArgs;
+using OBD.NET.Common.OBDData;
-namespace OBD.NET.Events
+namespace OBD.NET.Common.Events
{
- public class GenericDataEventManager : IDataEventManager where T : IOBDData
+ public class GenericDataEventManager : IDataEventManager
+ where T : IOBDData
{
- #region Properties & Fields
-
- #endregion
-
#region Events
internal event ELM327.DataReceivedEventHandler DataReceived;
#endregion
- #region Constructors
-
- #endregion
-
#region Methods
- public void RaiseEvent(object sender, IOBDData data, DateTime timestamp)
- {
- DataReceived?.Invoke(sender, new DataReceivedEventArgs((T)data, timestamp));
- }
+ public void RaiseEvent(object sender, IOBDData data, DateTime timestamp) => DataReceived?.Invoke(sender, new DataReceivedEventArgs((T)data, timestamp));
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/Events/IDataEventManager.cs b/OBD.NET/OBD.NET.Common/Events/IDataEventManager.cs
index 6ba08fd..a15963e 100644
--- a/OBD.NET/OBD.NET.Common/Events/IDataEventManager.cs
+++ b/OBD.NET/OBD.NET.Common/Events/IDataEventManager.cs
@@ -1,7 +1,7 @@
using System;
-using OBD.NET.OBDData;
+using OBD.NET.Common.OBDData;
-namespace OBD.NET.Events
+namespace OBD.NET.Common.Events
{
public interface IDataEventManager
{
diff --git a/OBD.NET/OBD.NET.Common/Exceptions/SerialException.cs b/OBD.NET/OBD.NET.Common/Exceptions/SerialException.cs
index d6fc529..3fd1d64 100644
--- a/OBD.NET/OBD.NET.Common/Exceptions/SerialException.cs
+++ b/OBD.NET/OBD.NET.Common/Exceptions/SerialException.cs
@@ -1,6 +1,6 @@
using System;
-namespace OBD.NET.Exceptions
+namespace OBD.NET.Common.Exceptions
{
public class SerialException : Exception
{
@@ -16,7 +16,7 @@ namespace OBD.NET.Exceptions
public SerialException(string message, Exception innerException)
: base(message, innerException)
{ }
-
+
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/Exceptions/UnexpectedResultException.cs b/OBD.NET/OBD.NET.Common/Exceptions/UnexpectedResultException.cs
index 5c6dab5..d3f18d3 100644
--- a/OBD.NET/OBD.NET.Common/Exceptions/UnexpectedResultException.cs
+++ b/OBD.NET/OBD.NET.Common/Exceptions/UnexpectedResultException.cs
@@ -1,6 +1,6 @@
using System;
-namespace OBD.NET.Exceptions
+namespace OBD.NET.Common.Exceptions
{
public class UnexpectedResultException : Exception
{
@@ -14,7 +14,7 @@ namespace OBD.NET.Exceptions
#region Constructors
public UnexpectedResultException(string result, string expectedResult)
- :this($"Unexpected result '{result}'. Expected was '{expectedResult}'", result, expectedResult)
+ : this($"Unexpected result '{result}'. Expected was '{expectedResult}'", result, expectedResult)
{
this.Result = result;
this.ExpectedResult = expectedResult;
@@ -33,7 +33,6 @@ namespace OBD.NET.Exceptions
this.Result = result;
this.ExpectedResult = expectedResult;
}
-
#endregion
}
diff --git a/OBD.NET/OBD.NET.Common/Extensions/HexExtension.cs b/OBD.NET/OBD.NET.Common/Extensions/HexExtension.cs
index 82dd90c..2824570 100644
--- a/OBD.NET/OBD.NET.Common/Extensions/HexExtension.cs
+++ b/OBD.NET/OBD.NET.Common/Extensions/HexExtension.cs
@@ -1,24 +1,22 @@
using System;
+using System.Linq;
-namespace OBD.NET.Extensions
+namespace OBD.NET.Common.Extensions
{
public static class HexExtension
{
- public static int GetHexVal(this char hex)
- {
- return hex - (hex < 58 ? 48 : (hex < 97 ? 55 : 87));
- }
+ #region Methods
+
+ public static int GetHexVal(this char hex) => hex - (hex < 58 ? 48 : (hex < 97 ? 55 : 87));
public static int GetHexVal(this string hex)
{
if ((hex.Length % 2) == 1)
throw new ArgumentException("The binary key cannot have an odd number of digits");
- int result = 0;
- foreach (char c in hex)
- result = (result << 4) + (GetHexVal(c));
-
- return result;
+ return hex.Aggregate(0, (current, c) => (current << 4) + (GetHexVal(c)));
}
+
+ #endregion
}
}
diff --git a/OBD.NET/OBD.NET.Common/Logging/IOBDLogger.cs b/OBD.NET/OBD.NET.Common/Logging/IOBDLogger.cs
index 0d5aaf6..c0b3021 100644
--- a/OBD.NET/OBD.NET.Common/Logging/IOBDLogger.cs
+++ b/OBD.NET/OBD.NET.Common/Logging/IOBDLogger.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.Logging
+namespace OBD.NET.Common.Logging
{
public interface IOBDLogger
{
diff --git a/OBD.NET/OBD.NET.Common/Logging/OBDDebugLogger.cs b/OBD.NET/OBD.NET.Common/Logging/OBDDebugLogger.cs
index 949c490..17bf914 100644
--- a/OBD.NET/OBD.NET.Common/Logging/OBDDebugLogger.cs
+++ b/OBD.NET/OBD.NET.Common/Logging/OBDDebugLogger.cs
@@ -1,17 +1,17 @@
-using OBD.NET.Logging;
-using System.Diagnostics;
+using System.Diagnostics;
namespace OBD.NET.Common.Logging
{
///
/// Simple debug logger
///
- ///
+ ///
public class OBDDebugLogger : IOBDLogger
{
- public void WriteLine(string text, OBDLogLevel level)
- {
- Debug.WriteLine($"{level}: {text}");
- }
+ #region Methods
+
+ public void WriteLine(string text, OBDLogLevel level) => Debug.WriteLine($"{level}: {text}");
+
+ #endregion
}
}
diff --git a/OBD.NET/OBD.NET.Common/Logging/OBDLogLevel.cs b/OBD.NET/OBD.NET.Common/Logging/OBDLogLevel.cs
index e04d163..65b118a 100644
--- a/OBD.NET/OBD.NET.Common/Logging/OBDLogLevel.cs
+++ b/OBD.NET/OBD.NET.Common/Logging/OBDLogLevel.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.Logging
+namespace OBD.NET.Common.Logging
{
public enum OBDLogLevel
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/AuxiliaryInputStatus.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/AuxiliaryInputStatus.cs
index dbcca63..bed3fae 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/AuxiliaryInputStatus.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/AuxiliaryInputStatus.cs
@@ -1,10 +1,10 @@
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AuxiliaryInputStatus : AbstractOBDData
{
#region Properties & Fields
- public bool PowerTakeOffStatus => (A & 1 << 0) != 0;
+ public bool PowerTakeOffStatus => (A & (1 << 0)) != 0;
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/CalculatedEngineLoad.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/CalculatedEngineLoad.cs
index 6cbdca8..2ad1db2 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/CalculatedEngineLoad.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/CalculatedEngineLoad.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CalculatedEngineLoad : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/CommandedSecondaryAirStatus.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/CommandedSecondaryAirStatus.cs
index ee9d888..cce88dd 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/CommandedSecondaryAirStatus.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/CommandedSecondaryAirStatus.cs
@@ -1,6 +1,6 @@
using System;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CommandedSecondaryAirStatus : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/EngineCoolantTemperature.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/EngineCoolantTemperature.cs
index 342d196..a03be68 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/EngineCoolantTemperature.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/EngineCoolantTemperature.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EngineCoolantTemperature : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/EngineRPM.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/EngineRPM.cs
index 0ac51b1..1666cb4 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/EngineRPM.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/EngineRPM.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EngineRPM : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/FuelPressure.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/FuelPressure.cs
index 027488a..f49ce79 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/FuelPressure.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/FuelPressure.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelPressure : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/FuelSystemStatus.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/FuelSystemStatus.cs
index ff863f4..5d7b442 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/FuelSystemStatus.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/FuelSystemStatus.cs
@@ -1,6 +1,6 @@
using System;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelSystemStatus : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/IntakeAirTemperature.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/IntakeAirTemperature.cs
index be1230e..eeb5a1a 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/IntakeAirTemperature.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/IntakeAirTemperature.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class IntakeAirTemperature : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/IntakeManifoldAbsolutePressure.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/IntakeManifoldAbsolutePressure.cs
index 519f2d2..c754e81 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/IntakeManifoldAbsolutePressure.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/IntakeManifoldAbsolutePressure.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class IntakeManifoldAbsolutePressure : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/LongTermFuelTrimBank1.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/LongTermFuelTrimBank1.cs
index 9bcf790..a8bdc51 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/LongTermFuelTrimBank1.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/LongTermFuelTrimBank1.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class LongTermFuelTrimBank1 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/LongTermFuelTrimBank2.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/LongTermFuelTrimBank2.cs
index fd1f4b4..c1475f2 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/LongTermFuelTrimBank2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/LongTermFuelTrimBank2.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class LongTermFuelTrimBank2 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/MAFAirFlowRate.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/MAFAirFlowRate.cs
index 712d9c8..d069ed8 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/MAFAirFlowRate.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/MAFAirFlowRate.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class MAFAirFlowRate : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OBDStandards.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OBDStandards.cs
index 6180d1b..9260abb 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OBDStandards.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OBDStandards.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OBDStandards : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor1FuelTrim.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor1FuelTrim.cs
index c87629c..7cddb45 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor1FuelTrim.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor1FuelTrim.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor1FuelTrim : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor2FuelTrim.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor2FuelTrim.cs
index 022d09c..fe093a6 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor2FuelTrim.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor2FuelTrim.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor2FuelTrim : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor3FuelTrim.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor3FuelTrim.cs
index fa13773..80a7c7e 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor3FuelTrim.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor3FuelTrim.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor3FuelTrim : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor4FuelTrim.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor4FuelTrim.cs
index 028089e..6d48ac9 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor4FuelTrim.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor4FuelTrim.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor4FuelTrim : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor5FuelTrim.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor5FuelTrim.cs
index 0267975..8b65f29 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor5FuelTrim.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor5FuelTrim.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor5FuelTrim : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor6FuelTrim.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor6FuelTrim.cs
index 27d1482..d424144 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor6FuelTrim.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor6FuelTrim.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor6FuelTrim : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor7FuelTrim.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor7FuelTrim.cs
index 43a586a..598e527 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor7FuelTrim.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor7FuelTrim.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor7FuelTrim : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor8FuelTrim.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor8FuelTrim.cs
index 2608d76..2dc4da2 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor8FuelTrim.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensor8FuelTrim.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor8FuelTrim : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensorPresent.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensorPresent.cs
index 24ddd51..7d45460 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensorPresent.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensorPresent.cs
@@ -1,17 +1,17 @@
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensorPresent : AbstractOBDData
{
#region Properties & Fields
- public bool IsSensor1Present => (A & 1 << 0) != 0;
- public bool IsSensor2Present => (A & 1 << 1) != 0;
- public bool IsSensor3Present => (A & 1 << 2) != 0;
- public bool IsSensor4Present => (A & 1 << 3) != 0;
- public bool IsSensor5Present => (A & 1 << 4) != 0;
- public bool IsSensor6Present => (A & 1 << 5) != 0;
- public bool IsSensor7Present => (A & 1 << 6) != 0;
- public bool IsSensor8Present => (A & 1 << 7) != 0;
+ public bool IsSensor1Present => (A & (1 << 0)) != 0;
+ public bool IsSensor2Present => (A & (1 << 1)) != 0;
+ public bool IsSensor3Present => (A & (1 << 2)) != 0;
+ public bool IsSensor4Present => (A & (1 << 3)) != 0;
+ public bool IsSensor5Present => (A & (1 << 4)) != 0;
+ public bool IsSensor6Present => (A & (1 << 5)) != 0;
+ public bool IsSensor7Present => (A & (1 << 6)) != 0;
+ public bool IsSensor8Present => (A & (1 << 7)) != 0;
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensorsPresent2.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensorsPresent2.cs
index cb28605..2696538 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensorsPresent2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/OxygenSensorsPresent2.cs
@@ -1,17 +1,17 @@
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensorPresent2 : AbstractOBDData
{
#region Properties & Fields
- public bool IsSensor1Present => (A & 1 << 0) != 0;
- public bool IsSensor2Present => (A & 1 << 1) != 0;
- public bool IsSensor3Present => (A & 1 << 2) != 0;
- public bool IsSensor4Present => (A & 1 << 3) != 0;
- public bool IsSensor5Present => (A & 1 << 4) != 0;
- public bool IsSensor6Present => (A & 1 << 5) != 0;
- public bool IsSensor7Present => (A & 1 << 6) != 0;
- public bool IsSensor8Present => (A & 1 << 7) != 0;
+ public bool IsSensor1Present => (A & (1 << 0)) != 0;
+ public bool IsSensor2Present => (A & (1 << 1)) != 0;
+ public bool IsSensor3Present => (A & (1 << 2)) != 0;
+ public bool IsSensor4Present => (A & (1 << 3)) != 0;
+ public bool IsSensor5Present => (A & (1 << 4)) != 0;
+ public bool IsSensor6Present => (A & (1 << 5)) != 0;
+ public bool IsSensor7Present => (A & (1 << 6)) != 0;
+ public bool IsSensor8Present => (A & (1 << 7)) != 0;
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/PidsSupported01_20.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/PidsSupported01_20.cs
index ab2edfd..dd8d80f 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/PidsSupported01_20.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/PidsSupported01_20.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class PidsSupported01_20 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/RunTimeSinceEngineStart.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/RunTimeSinceEngineStart.cs
index da09f56..f459def 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/RunTimeSinceEngineStart.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/RunTimeSinceEngineStart.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class RunTimeSinceEngineStart : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/ShortTermFuelTrimBank1.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/ShortTermFuelTrimBank1.cs
index 9255d88..e522f82 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/ShortTermFuelTrimBank1.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/ShortTermFuelTrimBank1.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class ShortTermFuelTrimBank1 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/ShortTermFuelTrimBank2.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/ShortTermFuelTrimBank2.cs
index d1da873..88659b8 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/ShortTermFuelTrimBank2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/ShortTermFuelTrimBank2.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class ShortTermFuelTrimBank2 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/ThrottlePosition.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/ThrottlePosition.cs
index 0f20e40..ee0962e 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/ThrottlePosition.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/ThrottlePosition.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class ThrottlePosition : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/TimingAdvance.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/TimingAdvance.cs
index cf14a75..975c231 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/TimingAdvance.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/TimingAdvance.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class TimingAdvance : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/00-1F/VehicleSpeed.cs b/OBD.NET/OBD.NET.Common/OBDData/00-1F/VehicleSpeed.cs
index 308c5fd..f3e69fc 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/00-1F/VehicleSpeed.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/00-1F/VehicleSpeed.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class VehicleSpeed : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/AbsoluteBarometricPressure.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/AbsoluteBarometricPressure.cs
index 4c12979..c052343 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/AbsoluteBarometricPressure.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/AbsoluteBarometricPressure.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AbsoluteBarometricPressure : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank1Sensor1.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank1Sensor1.cs
index 23b2581..efef198 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank1Sensor1.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank1Sensor1.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CatalystTemperatureBank1Sensor1 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank1Sensor2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank1Sensor2.cs
index dfdb6ab..46510ae 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank1Sensor2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank1Sensor2.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CatalystTemperatureBank1Sensor2 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank2Sensor1.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank2Sensor1.cs
index 8917a77..4967a95 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank2Sensor1.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank2Sensor1.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CatalystTemperatureBank2Sensor1 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank2Sensor2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank2Sensor2.cs
index c3d691e..1c2f8c0 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank2Sensor2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CatalystTemperatureBank2Sensor2.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CatalystTemperatureBank2Sensor2 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CommandedEGR.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CommandedEGR.cs
index 6570dc0..0cecfb9 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CommandedEGR.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CommandedEGR.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CommandedEGR : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CommandedEvaporativePurge.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CommandedEvaporativePurge.cs
index 8161658..debd741 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/CommandedEvaporativePurge.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/CommandedEvaporativePurge.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CommandedEvaporativePurge : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/DistanceTraveledSinceCodesCleared.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/DistanceTraveledSinceCodesCleared.cs
index 8eeecf4..f91123e 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/DistanceTraveledSinceCodesCleared.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/DistanceTraveledSinceCodesCleared.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class DistanceTraveledSinceCodesCleared : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/DistanceTraveledWithMILOn.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/DistanceTraveledWithMILOn.cs
index 543bbb6..82ffc4a 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/DistanceTraveledWithMILOn.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/DistanceTraveledWithMILOn.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class DistanceTraveledWithMILOn : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/EGRError.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/EGRError.cs
index 424cb12..bb55382 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/EGRError.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/EGRError.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EGRError : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/EvapSystemVaporPressure.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/EvapSystemVaporPressure.cs
index 48c19a0..131747a 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/EvapSystemVaporPressure.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/EvapSystemVaporPressure.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EvapSystemVaporPressure : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelRailGaugePressure.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelRailGaugePressure.cs
index 3979fe6..29565cb 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelRailGaugePressure.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelRailGaugePressure.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelRailGaugePressure : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelRailPressure.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelRailPressure.cs
index 741d1af..ed72216 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelRailPressure.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelRailPressure.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelRailPressure : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelTankLevelInput.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelTankLevelInput.cs
index 1b82960..b49ed0d 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelTankLevelInput.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/FuelTankLevelInput.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelTankLevelInput : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor1FuelAir.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor1FuelAir.cs
index f936ced..89815d5 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor1FuelAir.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor1FuelAir.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor1FuelAir : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor1FuelAir2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor1FuelAir2.cs
index 8f2dd3b..26419e5 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor1FuelAir2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor1FuelAir2.cs
@@ -1,13 +1,13 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor1FuelAir2 : AbstractOBDData
{
#region Properties & Fields
public Ratio FuelAirEquivalenceRatio => new Ratio((2.0 / 25536.0) * ((256 * A) + B), 0, 2 - double.Epsilon);
- public Milliampere Current => new Milliampere(C + (D / 256.0) - 128, -128, 128 - double.Epsilon);
+ public Milliampere Current => new Milliampere((C + (D / 256.0)) - 128, -128, 128 - double.Epsilon);
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor2FuelAir.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor2FuelAir.cs
index 9f4cb35..1a2c532 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor2FuelAir.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor2FuelAir.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor2FuelAir : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor2FuelAir2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor2FuelAir2.cs
index be0a7f9..7294908 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor2FuelAir2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor2FuelAir2.cs
@@ -1,13 +1,13 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor2FuelAir2 : AbstractOBDData
{
#region Properties & Fields
public Ratio FuelAirEquivalenceRatio => new Ratio((2.0 / 25536.0) * ((256 * A) + B), 0, 2 - double.Epsilon);
- public Milliampere Current => new Milliampere(C + (D / 256.0) - 128, -128, 128 - double.Epsilon);
+ public Milliampere Current => new Milliampere((C + (D / 256.0)) - 128, -128, 128 - double.Epsilon);
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor3FuelAir.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor3FuelAir.cs
index a994879..0dedf70 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor3FuelAir.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor3FuelAir.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor3FuelAir : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor3FuelAir2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor3FuelAir2.cs
index a3ba63b..b96e8d3 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor3FuelAir2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor3FuelAir2.cs
@@ -1,13 +1,13 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor3FuelAir2 : AbstractOBDData
{
#region Properties & Fields
public Ratio FuelAirEquivalenceRatio => new Ratio((2.0 / 25536.0) * ((256 * A) + B), 0, 2 - double.Epsilon);
- public Milliampere Current => new Milliampere(C + (D / 256.0) - 128, -128, 128 - double.Epsilon);
+ public Milliampere Current => new Milliampere((C + (D / 256.0)) - 128, -128, 128 - double.Epsilon);
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor4FuelAir.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor4FuelAir.cs
index 9121e38..a8353c9 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor4FuelAir.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor4FuelAir.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor4FuelAir : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor4FuelAir2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor4FuelAir2.cs
index 506a044..76169c9 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor4FuelAir2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor4FuelAir2.cs
@@ -1,13 +1,13 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor4FuelAir2 : AbstractOBDData
{
#region Properties & Fields
public Ratio FuelAirEquivalenceRatio => new Ratio((2.0 / 25536.0) * ((256 * A) + B), 0, 2 - double.Epsilon);
- public Milliampere Current => new Milliampere(C + (D / 256.0) - 128, -128, 128 - double.Epsilon);
+ public Milliampere Current => new Milliampere((C + (D / 256.0)) - 128, -128, 128 - double.Epsilon);
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor5FuelAir.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor5FuelAir.cs
index ea1e834..c345af9 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor5FuelAir.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor5FuelAir.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor5FuelAir : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor5FuelAir2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor5FuelAir2.cs
index a2ee939..b38a1e4 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor5FuelAir2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor5FuelAir2.cs
@@ -1,13 +1,13 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor5FuelAir2 : AbstractOBDData
{
#region Properties & Fields
public Ratio FuelAirEquivalenceRatio => new Ratio((2.0 / 25536.0) * ((256 * A) + B), 0, 2 - double.Epsilon);
- public Milliampere Current => new Milliampere(C + (D / 256.0) - 128, -128, 128 - double.Epsilon);
+ public Milliampere Current => new Milliampere((C + (D / 256.0)) - 128, -128, 128 - double.Epsilon);
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor6FuelAir.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor6FuelAir.cs
index fd54d20..3da3133 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor6FuelAir.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor6FuelAir.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor6FuelAir : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor6FuelAir2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor6FuelAir2.cs
index 0896f78..e0c14c8 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor6FuelAir2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor6FuelAir2.cs
@@ -1,13 +1,13 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor6FuelAir2 : AbstractOBDData
{
#region Properties & Fields
public Ratio FuelAirEquivalenceRatio => new Ratio((2.0 / 25536.0) * ((256 * A) + B), 0, 2 - double.Epsilon);
- public Milliampere Current => new Milliampere(C + (D / 256.0) - 128, -128, 128 - double.Epsilon);
+ public Milliampere Current => new Milliampere((C + (D / 256.0)) - 128, -128, 128 - double.Epsilon);
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor7FuelAir.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor7FuelAir.cs
index b6fd22b..8762c24 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor7FuelAir.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor7FuelAir.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor7FuelAir : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor7FuelAir2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor7FuelAir2.cs
index 07763c1..f27c645 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor7FuelAir2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor7FuelAir2.cs
@@ -1,13 +1,13 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor7FuelAir2 : AbstractOBDData
{
#region Properties & Fields
public Ratio FuelAirEquivalenceRatio => new Ratio((2.0 / 25536.0) * ((256 * A) + B), 0, 2 - double.Epsilon);
- public Milliampere Current => new Milliampere(C + (D / 256.0) - 128, -128, 128 - double.Epsilon);
+ public Milliampere Current => new Milliampere((C + (D / 256.0)) - 128, -128, 128 - double.Epsilon);
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor8FuelAir.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor8FuelAir.cs
index 439d8ac..2560c2a 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor8FuelAir.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor8FuelAir.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor8FuelAir : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor8FuelAir2.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor8FuelAir2.cs
index 2f4c9a9..9feef5a 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor8FuelAir2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/OxygenSensor8FuelAir2.cs
@@ -1,13 +1,13 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class OxygenSensor8FuelAir2 : AbstractOBDData
{
#region Properties & Fields
public Ratio FuelAirEquivalenceRatio => new Ratio((2.0 / 25536.0) * ((256 * A) + B), 0, 2 - double.Epsilon);
- public Milliampere Current => new Milliampere(C + (D / 256.0) - 128, -128, 128 - double.Epsilon);
+ public Milliampere Current => new Milliampere((C + (D / 256.0)) - 128, -128, 128 - double.Epsilon);
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/PidsSupported21_40.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/PidsSupported21_40.cs
index ee87c35..28bb249 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/PidsSupported21_40.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/PidsSupported21_40.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class PidsSupported21_40 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/20-3F/WarmUpsSinceCodesCleared.cs b/OBD.NET/OBD.NET.Common/OBDData/20-3F/WarmUpsSinceCodesCleared.cs
index db659f1..b4f0212 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/20-3F/WarmUpsSinceCodesCleared.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/20-3F/WarmUpsSinceCodesCleared.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class WarmUpsSinceCodesCleared : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteEvapSystemVaporPressure.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteEvapSystemVaporPressure.cs
index 447def9..50889a1 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteEvapSystemVaporPressure.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteEvapSystemVaporPressure.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AbsoluteEvapSystemVaporPressure : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteLoadValue.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteLoadValue.cs
index a00b9ae..3078823 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteLoadValue.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteLoadValue.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AbsoluteLoadValue : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteThrottlePositionB.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteThrottlePositionB.cs
index 0341c0c..3981eba 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteThrottlePositionB.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteThrottlePositionB.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AbsoluteThrottlePositionB : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteThrottlePositionC.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteThrottlePositionC.cs
index 0da5f6c..398a9b2 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteThrottlePositionC.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AbsoluteThrottlePositionC.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AbsoluteThrottlePositionC : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionD.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionD.cs
index b3ccba9..b00b429 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionD.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionD.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AcceleratorPedalPositionD : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionE.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionE.cs
index edcf213..7ff3770 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionE.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionE.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AcceleratorPedalPositionE : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionF.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionF.cs
index 1d4fbc3..9666405 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionF.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AcceleratorPedalPositionF.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AcceleratorPedalPositionF : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AmbientAirTemperature.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AmbientAirTemperature.cs
index 5bab4b3..55f6bf4 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/AmbientAirTemperature.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/AmbientAirTemperature.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class AmbientAirTemperature : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/CommandedThrottleActuator.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/CommandedThrottleActuator.cs
index fabe7c0..7d7863c 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/CommandedThrottleActuator.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/CommandedThrottleActuator.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class CommandedThrottleActuator : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/ControlModuleVoltage.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/ControlModuleVoltage.cs
index 5e2f4f4..70dd960 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/ControlModuleVoltage.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/ControlModuleVoltage.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class ControlModuleVoltage : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/EngineFuelRate.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/EngineFuelRate.cs
index 0318bcf..a339117 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/EngineFuelRate.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/EngineFuelRate.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EngineFuelRate : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/EngineOilTemperature.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/EngineOilTemperature.cs
index 8f3a504..315138e 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/EngineOilTemperature.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/EngineOilTemperature.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EngineOilTemperature : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/EthanolFuel.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/EthanolFuel.cs
index 30f1150..e501671 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/EthanolFuel.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/EthanolFuel.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EthanolFuel : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/EvapSystemVaporPressure2.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/EvapSystemVaporPressure2.cs
index c677962..12fa933 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/EvapSystemVaporPressure2.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/EvapSystemVaporPressure2.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EvapSystemVaporPressure2 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelAirCommandedEquivalenceRatio.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelAirCommandedEquivalenceRatio.cs
index 8a6a75d..c4720ff 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelAirCommandedEquivalenceRatio.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelAirCommandedEquivalenceRatio.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelAirCommandedEquivalenceRatio : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelInjectionTiming.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelInjectionTiming.cs
index 3d583b5..4d56b93 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelInjectionTiming.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelInjectionTiming.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelInjectionTiming : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelRailAbsolutePressure.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelRailAbsolutePressure.cs
index 813ee11..ba3df3f 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelRailAbsolutePressure.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelRailAbsolutePressure.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelRailAbsolutePressure : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelType.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelType.cs
index 041ac13..fe938ee 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelType.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/FuelType.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class FuelType : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/HybridBatteryPackRemainingLife.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/HybridBatteryPackRemainingLife.cs
index 39c2253..10450c9 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/HybridBatteryPackRemainingLife.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/HybridBatteryPackRemainingLife.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class HybridBatteryPackRemainingLife : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/LongTermSecondaryOxygenSensorTrimBank13.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/LongTermSecondaryOxygenSensorTrimBank13.cs
index 9b5ee7f..ac27427 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/LongTermSecondaryOxygenSensorTrimBank13.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/LongTermSecondaryOxygenSensorTrimBank13.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class LongtTermSecondaryOxygenSensorTrimBank13 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/LongTermSecondaryOxygenSensorTrimBank24.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/LongTermSecondaryOxygenSensorTrimBank24.cs
index 741a051..707e44d 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/LongTermSecondaryOxygenSensorTrimBank24.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/LongTermSecondaryOxygenSensorTrimBank24.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class LongTermSecondaryOxygenSensorTrimBank24 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/MaximumValueForAirFlowRate.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/MaximumValueForAirFlowRate.cs
index 4457e4e..f6d3301 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/MaximumValueForAirFlowRate.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/MaximumValueForAirFlowRate.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class MaximumValueForAirFlowRate : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/MaximumValues.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/MaximumValues.cs
index c549c30..d0cfb49 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/MaximumValues.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/MaximumValues.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class MaximumValues : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/MonitorStatusThisDriveCycle.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/MonitorStatusThisDriveCycle.cs
index 6b1dbc9..c858580 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/MonitorStatusThisDriveCycle.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/MonitorStatusThisDriveCycle.cs
@@ -1,41 +1,41 @@
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class MonitorStatusThisDriveCycle : AbstractOBDData
{
#region Properties & Fields
- public bool IsComponentsTestAvailable => (B & 1 << 3) != 0;
- public bool IsComponentsTestComplete => (B & 1 << 7) == 0;
+ public bool IsComponentsTestAvailable => (B & (1 << 3)) != 0;
+ public bool IsComponentsTestComplete => (B & (1 << 7)) == 0;
- public bool IsFuelSystemTestAvailable => (B & 1 << 1) != 0;
- public bool IsFuelSystemTestComplete => (B & 1 << 5) == 0;
+ public bool IsFuelSystemTestAvailable => (B & (1 << 1)) != 0;
+ public bool IsFuelSystemTestComplete => (B & (1 << 5)) == 0;
- public bool IsMisfireTestAvailable => (B & 1 << 0) != 0;
- public bool IsMisfireTestComplete => (B & 1 << 4) == 0;
+ public bool IsMisfireTestAvailable => (B & (1 << 0)) != 0;
+ public bool IsMisfireTestComplete => (B & (1 << 4)) == 0;
- public bool IsEGRSystemTestAvailable => (C & 1 << 7) != 0;
- public bool IsEGRSystemTestComplete => (D & 1 << 7) == 0;
+ public bool IsEGRSystemTestAvailable => (C & (1 << 7)) != 0;
+ public bool IsEGRSystemTestComplete => (D & (1 << 7)) == 0;
- public bool IsOxygenSensorHeaterTestAvailable => (C & 1 << 6) != 0;
- public bool IsOxygenSensorHeaterTestComplete => (D & 1 << 6) == 0;
+ public bool IsOxygenSensorHeaterTestAvailable => (C & (1 << 6)) != 0;
+ public bool IsOxygenSensorHeaterTestComplete => (D & (1 << 6)) == 0;
- public bool IsOxygenSensorTestAvailable => (C & 1 << 5) != 0;
- public bool IsOxygenSensorTestComplete => (D & 1 << 5) == 0;
+ public bool IsOxygenSensorTestAvailable => (C & (1 << 5)) != 0;
+ public bool IsOxygenSensorTestComplete => (D & (1 << 5)) == 0;
- public bool IsACRefrigerantTestAvailable => (C & 1 << 4) != 0;
- public bool IsACRefrigerantTestComplete => (D & 1 << 4) == 0;
+ public bool IsACRefrigerantTestAvailable => (C & (1 << 4)) != 0;
+ public bool IsACRefrigerantTestComplete => (D & (1 << 4)) == 0;
- public bool IsSecondaryAirSystemTestAvailable => (C & 1 << 3) != 0;
- public bool IsSecondaryAirSystemTestComplete => (D & 1 << 3) == 0;
+ public bool IsSecondaryAirSystemTestAvailable => (C & (1 << 3)) != 0;
+ public bool IsSecondaryAirSystemTestComplete => (D & (1 << 3)) == 0;
- public bool IsEvaporativeSystemTestAvailable => (C & 1 << 2) != 0;
- public bool IsEvaporativeSystemTestComplete => (D & 1 << 2) == 0;
+ public bool IsEvaporativeSystemTestAvailable => (C & (1 << 2)) != 0;
+ public bool IsEvaporativeSystemTestComplete => (D & (1 << 2)) == 0;
- public bool IsHeatedCatalystTestAvailable => (C & 1 << 1) != 0;
- public bool IsHeatedCatalystTestComplete => (D & 1 << 1) == 0;
+ public bool IsHeatedCatalystTestAvailable => (C & (1 << 1)) != 0;
+ public bool IsHeatedCatalystTestComplete => (D & (1 << 1)) == 0;
- public bool IsCatalystAvailable => (C & 1 << 0) != 0;
- public bool IsCatalystComplete => (D & 1 << 0) == 0;
+ public bool IsCatalystAvailable => (C & (1 << 0)) != 0;
+ public bool IsCatalystComplete => (D & (1 << 0)) == 0;
#endregion
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/PidsSupported41_60.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/PidsSupported41_60.cs
index 6b5a386..50ca9b2 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/PidsSupported41_60.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/PidsSupported41_60.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class PidsSupported41_60 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/RelativeAcceleratorPedalPosition.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/RelativeAcceleratorPedalPosition.cs
index 692c5f6..7aea5e3 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/RelativeAcceleratorPedalPosition.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/RelativeAcceleratorPedalPosition.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class RelativeAcceleratorPedalPosition : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/RelativeThrottlePosition.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/RelativeThrottlePosition.cs
index 0aedcb7..1c0736b 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/RelativeThrottlePosition.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/RelativeThrottlePosition.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class RelativeThrottlePosition : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/ShortTermSecondaryOxygenSensorTrimBank13.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/ShortTermSecondaryOxygenSensorTrimBank13.cs
index 1b641cc..4f5aaab 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/ShortTermSecondaryOxygenSensorTrimBank13.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/ShortTermSecondaryOxygenSensorTrimBank13.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class ShortTermSecondaryOxygenSensorTrimBank13 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/ShortTermSecondaryOxygenSensorTrimBank24.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/ShortTermSecondaryOxygenSensorTrimBank24.cs
index 7920a34..513ce34 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/ShortTermSecondaryOxygenSensorTrimBank24.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/ShortTermSecondaryOxygenSensorTrimBank24.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class ShortTermSecondaryOxygenSensorTrimBank24 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/TimeRunWithMILOn.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/TimeRunWithMILOn.cs
index b5f95c6..673a8f3 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/TimeRunWithMILOn.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/TimeRunWithMILOn.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class TimeRunWithMILOn : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/40-5F/TimeSinceTroubleCodesCleared.cs b/OBD.NET/OBD.NET.Common/OBDData/40-5F/TimeSinceTroubleCodesCleared.cs
index e7dbcb1..2368a58 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/40-5F/TimeSinceTroubleCodesCleared.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/40-5F/TimeSinceTroubleCodesCleared.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class TimeSinceTroubleCodesCleared : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/60-7F/ActualEnginePercentTorque.cs b/OBD.NET/OBD.NET.Common/OBDData/60-7F/ActualEnginePercentTorque.cs
index 0891a2f..4113f19 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/60-7F/ActualEnginePercentTorque.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/60-7F/ActualEnginePercentTorque.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class ActualEnginePercentTorque : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/60-7F/DriversDemandEnginePercentTorque.cs b/OBD.NET/OBD.NET.Common/OBDData/60-7F/DriversDemandEnginePercentTorque.cs
index 2139f79..0649476 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/60-7F/DriversDemandEnginePercentTorque.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/60-7F/DriversDemandEnginePercentTorque.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class DriversDemandEnginePercentTorque : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/60-7F/EnginePercentTorqueData.cs b/OBD.NET/OBD.NET.Common/OBDData/60-7F/EnginePercentTorqueData.cs
index a6935f7..9cc5021 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/60-7F/EnginePercentTorqueData.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/60-7F/EnginePercentTorqueData.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EnginePercentTorqueData : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/60-7F/EngineReferenceTorque.cs b/OBD.NET/OBD.NET.Common/OBDData/60-7F/EngineReferenceTorque.cs
index a71fa62..6c5bb7c 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/60-7F/EngineReferenceTorque.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/60-7F/EngineReferenceTorque.cs
@@ -1,6 +1,6 @@
-using OBD.NET.DataTypes;
+using OBD.NET.Common.DataTypes;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class EngineReferenceTorque : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/60-7F/PidsSupported61_80.cs b/OBD.NET/OBD.NET.Common/OBDData/60-7F/PidsSupported61_80.cs
index b08282c..ebbbb4b 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/60-7F/PidsSupported61_80.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/60-7F/PidsSupported61_80.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class PidsSupported61_80 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/80-9F/PidsSupported81_A0.cs b/OBD.NET/OBD.NET.Common/OBDData/80-9F/PidsSupported81_A0.cs
index d9890a0..d4dd9ca 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/80-9F/PidsSupported81_A0.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/80-9F/PidsSupported81_A0.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class PidsSupported81_A0 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/A0-BF/PidsSupportedA1_C0.cs b/OBD.NET/OBD.NET.Common/OBDData/A0-BF/PidsSupportedA1_C0.cs
index dad7d21..989f4f0 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/A0-BF/PidsSupportedA1_C0.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/A0-BF/PidsSupportedA1_C0.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class PidsSupportedA1_C0 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/AbstractOBDData.cs b/OBD.NET/OBD.NET.Common/OBDData/AbstractOBDData.cs
index cded95d..d8a94e7 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/AbstractOBDData.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/AbstractOBDData.cs
@@ -1,23 +1,24 @@
using System;
-using OBD.NET.Extensions;
+using OBD.NET.Common.Extensions;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public abstract class AbstractOBDData : IOBDData
{
#region Properties & Fields
public byte PID { get; }
- private int _length;
+ private readonly int _length;
private byte[] _rawData;
public byte[] RawData
{
- get { return _rawData; }
+ get => _rawData;
set
{
if (value.Length != _length)
throw new ArgumentException("The provided raw-data is not valid", nameof(value));
+
_rawData = value;
}
}
@@ -34,13 +35,13 @@ namespace OBD.NET.OBDData
#region Constructors
- public AbstractOBDData(byte pid, int length)
+ protected AbstractOBDData(byte pid, int length)
{
this.PID = pid;
this._length = length;
}
- public AbstractOBDData(byte pid, int length, byte[] rawData)
+ protected AbstractOBDData(byte pid, int length, byte[] rawData)
: this(pid, length)
{
this.RawData = rawData;
diff --git a/OBD.NET/OBD.NET.Common/OBDData/C0-DF/PidsSupportedC1_E0.cs b/OBD.NET/OBD.NET.Common/OBDData/C0-DF/PidsSupportedC1_E0.cs
index c091848..2c7c287 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/C0-DF/PidsSupportedC1_E0.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/C0-DF/PidsSupportedC1_E0.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public class PidsSupportedC1_E0 : AbstractOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/OBDData/IOBDData.cs b/OBD.NET/OBD.NET.Common/OBDData/IOBDData.cs
index 64c59c6..2d2a10d 100644
--- a/OBD.NET/OBD.NET.Common/OBDData/IOBDData.cs
+++ b/OBD.NET/OBD.NET.Common/OBDData/IOBDData.cs
@@ -1,4 +1,4 @@
-namespace OBD.NET.OBDData
+namespace OBD.NET.Common.OBDData
{
public interface IOBDData
{
diff --git a/OBD.NET/OBD.NET.Common/Util/AsyncManulResetEvent.cs b/OBD.NET/OBD.NET.Common/Util/AsyncManulResetEvent.cs
index 4f8f34f..acbf9e9 100644
--- a/OBD.NET/OBD.NET.Common/Util/AsyncManulResetEvent.cs
+++ b/OBD.NET/OBD.NET.Common/Util/AsyncManulResetEvent.cs
@@ -1,23 +1,26 @@
using System.Threading;
using System.Threading.Tasks;
-namespace OBD.NET.Util
+namespace OBD.NET.Common.Util
{
///
/// Notifies one or more waiting awaiters that an event has occurred
///
public class AsyncManualResetEvent
{
+ #region Properties & Fields
+
private volatile TaskCompletionSource _tcs = new TaskCompletionSource();
+ #endregion
+
+ #region Methods
+
///
/// Waits the async.
///
///
- public Task WaitAsync()
- {
- return _tcs.Task;
- }
+ public Task WaitAsync() => _tcs.Task;
//public void Set() { m_tcs.TrySetResult(true); }
///
@@ -25,9 +28,10 @@ namespace OBD.NET.Util
///
public void Set()
{
- var tcs = _tcs;
+ TaskCompletionSource tcs = _tcs;
Task.Factory.StartNew(s => ((TaskCompletionSource)s).TrySetResult(true),
- tcs, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default);
+ tcs, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default);
+
tcs.Task.Wait();
}
@@ -38,11 +42,13 @@ namespace OBD.NET.Util
{
while (true)
{
- var tcs = _tcs;
+ TaskCompletionSource tcs = _tcs;
if (!tcs.Task.IsCompleted ||
- Interlocked.CompareExchange(ref _tcs, new TaskCompletionSource(), tcs) == tcs)
+ (Interlocked.CompareExchange(ref _tcs, new TaskCompletionSource(), tcs) == tcs))
return;
}
}
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/OBD.NET/ODB.NET.ConsoleClient/App.config b/OBD.NET/ODB.NET.ConsoleClient/App.config
index d1428ad..bae5d6d 100644
--- a/OBD.NET/ODB.NET.ConsoleClient/App.config
+++ b/OBD.NET/ODB.NET.ConsoleClient/App.config
@@ -1,6 +1,6 @@
-
+
diff --git a/OBD.NET/ODB.NET.ConsoleClient/ODB.NET.ConsoleClient.csproj b/OBD.NET/ODB.NET.ConsoleClient/ODB.NET.ConsoleClient.csproj
index 950d5eb..a8ae99f 100644
--- a/OBD.NET/ODB.NET.ConsoleClient/ODB.NET.ConsoleClient.csproj
+++ b/OBD.NET/ODB.NET.ConsoleClient/ODB.NET.ConsoleClient.csproj
@@ -8,7 +8,7 @@
Exe
ODB.NET.ConsoleClient
ODB.NET.ConsoleClient
- v4.5
+ v4.6.1
512
true
diff --git a/OBD.NET/ODB.NET.ConsoleClient/Program.cs b/OBD.NET/ODB.NET.ConsoleClient/Program.cs
index f8f8e02..1dbed58 100644
--- a/OBD.NET/ODB.NET.ConsoleClient/Program.cs
+++ b/OBD.NET/ODB.NET.ConsoleClient/Program.cs
@@ -1,44 +1,32 @@
-using OBD.NET.Common.Logging;
-using OBD.NET.Communication;
-using OBD.NET.Devices;
-using OBD.NET.Logging;
-using OBD.NET.OBDData;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System;
using System.Threading;
using System.Threading.Tasks;
+using OBD.NET.Common.Devices;
+using OBD.NET.Common.Logging;
+using OBD.NET.Common.OBDData;
+using ODB.NET.Desktop.Communication;
+using ODB.NET.Desktop.Logging;
namespace ODB.NET.ConsoleClient
{
- ///
- /// Console test client
- ///
- class Program
+ public class Program
{
- static void Main(string[] args)
+ public static void Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Parameter ComPort needed.");
return;
}
-
- var comPort = args[0];
+
+ string comPort = args[0];
using (SerialConnection connection = new SerialConnection(comPort))
using (ELM327 dev = new ELM327(connection, new OBDConsoleLogger(OBDLogLevel.Debug)))
{
- dev.SubscribeDataReceived((sender, data) =>
- {
- Console.WriteLine("EngineRPM: " + data.Data.Rpm);
- });
+ dev.SubscribeDataReceived((sender, data) => Console.WriteLine("EngineRPM: " + data.Data.Rpm));
- dev.SubscribeDataReceived((sender, data) =>
- {
- Console.WriteLine("VehicleSpeed: " + data.Data.Speed);
- });
+ dev.SubscribeDataReceived((sender, data) => Console.WriteLine("VehicleSpeed: " + data.Data.Speed));
dev.Initialize();
dev.RequestData();
@@ -48,12 +36,13 @@ namespace ODB.NET.ConsoleClient
dev.RequestData();
Thread.Sleep(1000);
}
- Console.ReadLine();
}
+ Console.ReadLine();
//Async example
MainAsync(comPort).Wait();
-
+
+ Console.ReadLine();
}
///
@@ -67,18 +56,15 @@ namespace ODB.NET.ConsoleClient
using (ELM327 dev = new ELM327(connection, new OBDConsoleLogger(OBDLogLevel.Debug)))
{
dev.Initialize();
- var data = await dev.RequestDataAsync();
+ EngineRPM data = await dev.RequestDataAsync();
Console.WriteLine("Data: " + data.Rpm);
data = await dev.RequestDataAsync();
Console.WriteLine("Data: " + data.Rpm);
- var data2 = await dev.RequestDataAsync();
+ VehicleSpeed data2 = await dev.RequestDataAsync();
Console.WriteLine("Data: " + data2.Speed);
data = await dev.RequestDataAsync();
Console.WriteLine("Data: " + data.Rpm);
-
}
}
}
-
-
}
diff --git a/OBD.NET/ODB.NET.ConsoleClient/Properties/AssemblyInfo.cs b/OBD.NET/ODB.NET.ConsoleClient/Properties/AssemblyInfo.cs
index 95594b5..5873adc 100644
--- a/OBD.NET/ODB.NET.ConsoleClient/Properties/AssemblyInfo.cs
+++ b/OBD.NET/ODB.NET.ConsoleClient/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
diff --git a/OBD.NET/ODB.NET.Desktop/Communication/EnhancedSerialPort.cs b/OBD.NET/ODB.NET.Desktop/Communication/EnhancedSerialPort.cs
index f92267b..74f66a4 100644
--- a/OBD.NET/ODB.NET.Desktop/Communication/EnhancedSerialPort.cs
+++ b/OBD.NET/ODB.NET.Desktop/Communication/EnhancedSerialPort.cs
@@ -18,9 +18,10 @@ using System.IO;
using System.IO.Ports;
using System.Reflection;
using System.Runtime.InteropServices;
+using System.Threading;
// Source: http://antanas.veiverys.com/mono-serialport-datareceived-event-workaround-using-a-derived-class/
-namespace OBD.NET.Communication
+namespace ODB.NET.Desktop.Communication
{
[DesignerCategory("Code")]
public class EnhancedSerialPort : SerialPort
@@ -31,6 +32,7 @@ namespace OBD.NET.Communication
private int _fd;
private FieldInfo _disposedFieldInfo;
private object _dataReceived;
+ private Thread _thread;
#endregion
@@ -85,12 +87,18 @@ namespace OBD.NET.Communication
if (!IsWindows)
{
FieldInfo fieldInfo = BaseStream.GetType().GetField("fd", BindingFlags.Instance | BindingFlags.NonPublic);
+ if (fieldInfo == null) throw new NotSupportedException("Unable to initialize SerialPort - 'fd'-field is missing.");
_fd = (int)fieldInfo.GetValue(BaseStream);
+
_disposedFieldInfo = BaseStream.GetType().GetField("disposed", BindingFlags.Instance | BindingFlags.NonPublic);
+ if (_disposedFieldInfo == null) throw new NotSupportedException("Unable to initialize SerialPort - 'disposed'-field is missing.");
+
fieldInfo = typeof(SerialPort).GetField("data_received", BindingFlags.Instance | BindingFlags.NonPublic);
+ if (fieldInfo == null) throw new NotSupportedException("Unable to initialize SerialPort - 'data_received'-field is missing.");
_dataReceived = fieldInfo.GetValue(this);
- new System.Threading.Thread(EventThreadFunction).Start();
+ _thread = new Thread(EventThreadFunction);
+ _thread.Start();
}
}
diff --git a/OBD.NET/ODB.NET.Desktop/Communication/SerialConnection.cs b/OBD.NET/ODB.NET.Desktop/Communication/SerialConnection.cs
index 6f8b161..b20bdfc 100644
--- a/OBD.NET/ODB.NET.Desktop/Communication/SerialConnection.cs
+++ b/OBD.NET/ODB.NET.Desktop/Communication/SerialConnection.cs
@@ -1,11 +1,12 @@
using System;
+using OBD.NET.Common.Communication.EventArgs;
using System.IO.Ports;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
-using OBD.NET.Common.Communication.EventArgs;
+using OBD.NET.Common.Communication;
-namespace OBD.NET.Communication
+namespace ODB.NET.Desktop.Communication
{
public class SerialConnection : ISerialConnection
{
@@ -36,6 +37,7 @@ namespace OBD.NET.Communication
Handshake handshake = Handshake.None, int timeout = 5000)
{
this._timeout = timeout;
+
_serialPort = new EnhancedSerialPort(port, baudRate, parity)
{
StopBits = stopBits,
@@ -51,40 +53,21 @@ namespace OBD.NET.Communication
#region Methods
- public void Connect()
- {
- _serialPort.Open();
- }
+ public void Connect() => _serialPort.Open();
private void SerialPortOnDataReceived(object sender, SerialDataReceivedEventArgs serialDataReceivedEventArgs)
{
int count = _serialPort.Read(_readBuffer, 0, _serialPort.BytesToRead);
- DataReceived?.Invoke(this,new DataReceivedEventArgs(count, _readBuffer));
+ DataReceived?.Invoke(this, new DataReceivedEventArgs(count, _readBuffer));
}
-
- public void Dispose()
- {
- _serialPort?.Dispose();
- }
+ public void Dispose() => _serialPort?.Dispose();
- public Task ConnectAsync()
- {
- throw new NotSupportedException("Asynchronous operations not supported");
- }
+ public Task ConnectAsync() => throw new NotSupportedException("Asynchronous operations not supported");
- public Task WriteAsync(byte[] data)
- {
- throw new NotSupportedException("Asynchronous operations not supported");
- }
+ public Task WriteAsync(byte[] data) => throw new NotSupportedException("Asynchronous operations not supported");
-
- public void Write(byte[] data)
- {
- _serialPort.Write(data, 0, data.Length);
- }
-
-
+ public void Write(byte[] data) => _serialPort.Write(data, 0, data.Length);
#endregion
}
diff --git a/OBD.NET/ODB.NET.Desktop/Logging/ODBConsoleLogger.cs b/OBD.NET/ODB.NET.Desktop/Logging/ODBConsoleLogger.cs
index 0e69e0b..6f88164 100644
--- a/OBD.NET/ODB.NET.Desktop/Logging/ODBConsoleLogger.cs
+++ b/OBD.NET/ODB.NET.Desktop/Logging/ODBConsoleLogger.cs
@@ -1,35 +1,39 @@
-using OBD.NET.Logging;
-using System;
-using System.Diagnostics;
+using System;
+using OBD.NET.Common.Logging;
-namespace OBD.NET.Common.Logging
+namespace ODB.NET.Desktop.Logging
{
///
/// Simple console logger
///
- ///
+ ///
public class OBDConsoleLogger : IOBDLogger
{
+ #region Properties & Fields
+
public OBDLogLevel LogLevel { get; set; }
- public OBDConsoleLogger()
+ #endregion
+
+ #region Constructors
+
+ public OBDConsoleLogger(OBDLogLevel level = OBDLogLevel.None)
{
- LogLevel = OBDLogLevel.None;
+ this.LogLevel = level;
}
- public OBDConsoleLogger(OBDLogLevel level)
- {
- LogLevel = level;
- }
+ #endregion
+
+ #region Methods
public void WriteLine(string text, OBDLogLevel level)
{
if (LogLevel == OBDLogLevel.None) return;
- if((int)level >= (int)LogLevel)
- {
- Console.WriteLine($"{DateTime.Now.ToString()} - {level} - {text}");
- }
+ if ((int)level >= (int)LogLevel)
+ Console.WriteLine($"{DateTime.Now:G} - {level} - {text}");
}
+
+ #endregion
}
}
diff --git a/OBD.NET/ODB.NET.Desktop/ODB.NET.Desktop.csproj b/OBD.NET/ODB.NET.Desktop/ODB.NET.Desktop.csproj
index 57966b5..09a6f13 100644
--- a/OBD.NET/ODB.NET.Desktop/ODB.NET.Desktop.csproj
+++ b/OBD.NET/ODB.NET.Desktop/ODB.NET.Desktop.csproj
@@ -9,7 +9,7 @@
Properties
ODB.NET.Desktop
ODB.NET.Desktop
- v4.5
+ v4.6.1
512
@@ -46,14 +46,14 @@
+
+
+
{d985b70e-cdf3-4cf1-ab5d-8d19c7fe7b31}
OBD.NET.Common
-
-
-
\ No newline at end of file
diff --git a/OBD.NET/ODB.NET.Desktop/Properties/AssemblyInfo.cs b/OBD.NET/ODB.NET.Desktop/Properties/AssemblyInfo.cs
index 9d5a6e1..a5f7008 100644
--- a/OBD.NET/ODB.NET.Desktop/Properties/AssemblyInfo.cs
+++ b/OBD.NET/ODB.NET.Desktop/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following