DarthAffe / OBD.NET

C#-Library to read data from car through an ELM327-/STN1170-Adapter
GNU General Public License v2.0
178 stars 82 forks source link

PID 01 For MIL lamp status #21

Open nikolaj99 opened 2 years ago

nikolaj99 commented 2 years ago

I cant seem to find a method for getting the MIL lamp status, what i mean by this is i want to get to see is it on or off. If someone could reply i would be very gretful.

DarthAffe commented 2 years ago

Hey, message 0x01 isn't implemented currently. If you only care about the MIL status you should be able to get it with this (not tested though):

public class MILStatus : AbstractOBDData
{
    #region Properties & Fields

    public bool MILStatus => (A & (1 << 7)) != 0;

    #endregion

    #region Constructors

    public MILStatus()
        : base(0x01, 4)
    { }

    #endregion

    #region Methods

    public override string ToString() => MILStatus.ToString();

    #endregion
}
nikolaj99 commented 2 years ago

Thanks for the reply , will try it first thing in the morning with a vehicle.