Skip to content

Adding a new PID, struggling...., c# newbie #16

Description

@MartinParis

I have created a new class for Odometer.
It needs a PID value of 3B6 (CAN message: 3B64597BF00). The whole technical architecture seems to be made around a PID of one byte so I need somehow to make AbstractOBDData.cs aware of this larger PID, but I fail because my knowledge of c# is not enough.
Can anyone give a pointer for this?
And I think I also need to convince AbstractPidsSupported.cs of this larger PID and adding it to the supported list.
I want to use this library to get Odometer from my Tesla Model 3 Vehicle Bus through the OBDLINK MX+.

`using OBD.NET.Common.DataTypes;

namespace OBD.NET.Common.OBDData
{
public class Odometer : AbstractOBDData
{
#region Properties & Fields

    public Kilometre Odom => new Kilometre((D + C << 8) + (B << 16) + (A << 24), 0, 0);

    #endregion

    #region Constructors

    public Odometer()
        : base(0x3B6, 4)
    { }

    #endregion

    #region Methods

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

    #endregion
}

}
`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions