mirror of
https://github.com/DarthAffe/OBD.NET.git
synced 2025-12-12 16:58:30 +00:00
Small refactorings to make the code fit the code-style of the library
This commit is contained in:
parent
b4f7a3480e
commit
b9da9787ba
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OBD.NET.Common.OBDData
|
||||
namespace OBD.NET.Common.OBDData
|
||||
{
|
||||
public class PidsSupported01_20 : AbstractPidsSupported
|
||||
{
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OBD.NET.Common.OBDData
|
||||
namespace OBD.NET.Common.OBDData
|
||||
{
|
||||
public class PidsSupported21_40 : AbstractPidsSupported
|
||||
{
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OBD.NET.Common.OBDData
|
||||
namespace OBD.NET.Common.OBDData
|
||||
{
|
||||
public class PidsSupported41_60 : AbstractPidsSupported
|
||||
{
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OBD.NET.Common.OBDData
|
||||
namespace OBD.NET.Common.OBDData
|
||||
{
|
||||
public class PidsSupported61_80 : AbstractPidsSupported
|
||||
{
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OBD.NET.Common.OBDData
|
||||
namespace OBD.NET.Common.OBDData
|
||||
{
|
||||
public class PidsSupported81_A0 : AbstractPidsSupported
|
||||
{
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OBD.NET.Common.OBDData
|
||||
namespace OBD.NET.Common.OBDData
|
||||
{
|
||||
public class PidsSupportedA1_C0 : AbstractPidsSupported
|
||||
{
|
||||
|
||||
@ -1,35 +1,34 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OBD.NET.Common.OBDData
|
||||
{
|
||||
public abstract class AbstractPidsSupported : AbstractOBDData
|
||||
{
|
||||
public AbstractPidsSupported(byte pid, int length) : base(pid, length)
|
||||
{
|
||||
|
||||
}
|
||||
#region Properties & Fields
|
||||
|
||||
public int[] SupportedPids
|
||||
{
|
||||
get
|
||||
{
|
||||
List<int> supportedPids = new List<int>();
|
||||
byte[] byteArray = new byte[] { D, C, B, A };
|
||||
var bitArray = new BitArray(byteArray);
|
||||
BitArray bitArray = new BitArray(new[] { D, C, B, A });
|
||||
|
||||
for (int i = 0x01; i <= 0x20; i++)
|
||||
{
|
||||
if (bitArray.Get(bitArray.Length - i))
|
||||
{
|
||||
supportedPids.Add(PID + i);
|
||||
}
|
||||
}
|
||||
|
||||
return supportedPids.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public AbstractPidsSupported(byte pid, int length) : base(pid, length)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OBD.NET.Common.OBDData
|
||||
namespace OBD.NET.Common.OBDData
|
||||
{
|
||||
public class PidsSupportedC1_E0 : AbstractPidsSupported
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user