mirror of
https://github.com/DarthAffe/OBD.NET.git
synced 2025-12-13 01:08:30 +00:00
re-factored SerialConnection to ISerialConnection interface and removed stuff which is not compatible with NetStandard
49 lines
1.4 KiB
C#
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
|
|
}
|
|
}
|