mirror of
https://github.com/DarthAffe/OBD.NET.git
synced 2025-12-12 16:58:30 +00:00
55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace OBD.NET.Common.OBDData
|
|
{
|
|
public class PidsSupported81_A0 : 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 PidsSupported81_A0()
|
|
: base(0x80, 4)
|
|
{ }
|
|
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
public override string ToString() => string.Join(",", SupportedPids);
|
|
|
|
#endregion
|
|
}
|
|
}
|