1
0
mirror of https://github.com/DarthAffe/OBD.NET.git synced 2025-12-13 01:08:30 +00:00
OBD.NET/OBD.NET/OBD.NET.Common/OBDData/00-1F/PidsSupported01_20.cs
Roman Lumetsberger 9dd42cba6f Moved common parts into ODB.NET.Common
re-factored SerialConnection to ISerialConnection interface and removed stuff which is not compatible with NetStandard
2017-05-07 09:25:57 +02:00

49 lines
1.4 KiB
C#

using System.Collections.Generic;
namespace OBD.NET.OBDData
{
public class PidsSupported01_20 : AbstractOBDData
{
#region Properties & Fields
public int[] SupportedPids
{
get
{
List<int> supportedPids = new List<int>();
for (int i = 0x01; i < 0x20; i++)
switch ((int)(i / 8.0))
{
case 0:
if ((A << (7 - i)) != 0)
supportedPids.Add(PID + i);
break;
case 1:
if ((B << (15 - i)) != 0)
supportedPids.Add(PID + i);
break;
case 2:
if ((C << (23 - i)) != 0)
supportedPids.Add(PID + i);
break;
case 3:
if ((D << (31 - i)) != 0)
supportedPids.Add(PID + i);
break;
}
return supportedPids.ToArray();
}
}
#endregion
#region Constructors
public PidsSupported01_20()
: base(0x00, 4)
{ }
#endregion
}
}