Skip to content

J1939Name Struct

Represents the 64-bit SAE J1939 NAME used by address claiming.

public readonly struct J1939Name : System.IComparable<CanKit.Pro.Addressing.J1939Name>, System.IEquatable<CanKit.Pro.Addressing.J1939Name>

Implements IComparable<J1939Name>, IEquatable<J1939Name>

Remarks

Bit layout from least-significant to most-significant bit: IdentityNumber(21) | ManufacturerCode(11) | EcuInstance(3) | FunctionInstance(5) | Function(8) | Reserved(1) | VehicleSystem(7) | VehicleSystemInstance(4) | IndustryGroup(3) | ArbitraryAddressCapable(1).

Constructors

J1939Name(uint, ushort, byte, byte, byte, bool, byte, byte, byte, bool) Constructor

Initializes a NAME from individual SAE J1939 fields.

public J1939Name(uint identityNumber, ushort manufacturerCode, byte ecuInstance, byte functionInstance, byte function, bool reserved, byte vehicleSystem, byte vehicleSystemInstance, byte industryGroup, bool arbitraryAddressCapable);

Parameters

identityNumber UInt32

manufacturerCode UInt16

ecuInstance Byte

functionInstance Byte

function Byte

reserved Boolean

vehicleSystem Byte

vehicleSystemInstance Byte

industryGroup Byte

arbitraryAddressCapable Boolean

Fields

J1939Name.EcuInstanceMax Field

Largest valid ECU instance value.

public const byte EcuInstanceMax = 7;

Field Value

Byte

J1939Name.FunctionInstanceMax Field

Largest valid function instance value.

public const byte FunctionInstanceMax = 31;

Field Value

Byte

J1939Name.IdentityNumberMax Field

Largest valid identity number value.

public const uint IdentityNumberMax = 2097151;

Field Value

UInt32

J1939Name.IndustryGroupMax Field

Largest valid industry group value.

public const byte IndustryGroupMax = 7;

Field Value

Byte

J1939Name.ManufacturerCodeMax Field

Largest valid manufacturer code value.

public const ushort ManufacturerCodeMax = 2047;

Field Value

UInt16

J1939Name.VehicleSystemInstanceMax Field

Largest valid vehicle system instance value.

public const byte VehicleSystemInstanceMax = 15;

Field Value

Byte

J1939Name.VehicleSystemMax Field

Largest valid vehicle system value.

public const byte VehicleSystemMax = 127;

Field Value

Byte

Properties

J1939Name.ArbitraryAddressCapable Property

Arbitrary Address Capable field, bit 63.

public bool ArbitraryAddressCapable { get; }

Property Value

Boolean

J1939Name.EcuInstance Property

ECU Instance field, bits 32-34.

public byte EcuInstance { get; }

Property Value

Byte

J1939Name.Function Property

Function field, bits 40-47.

public byte Function { get; }

Property Value

Byte

J1939Name.FunctionInstance Property

Function Instance field, bits 35-39.

public byte FunctionInstance { get; }

Property Value

Byte

J1939Name.IdentityNumber Property

Identity Number field, bits 0-20.

public uint IdentityNumber { get; }

Property Value

UInt32

J1939Name.IndustryGroup Property

Industry Group field, bits 60-62.

public byte IndustryGroup { get; }

Property Value

Byte

J1939Name.ManufacturerCode Property

Manufacturer Code field, bits 21-31.

public ushort ManufacturerCode { get; }

Property Value

UInt16

J1939Name.Reserved Property

Reserved field, bit 48.

public bool Reserved { get; }

Property Value

Boolean

J1939Name.Value Property

Raw 64-bit NAME value.

public ulong Value { get; }

Property Value

UInt64

J1939Name.VehicleSystem Property

Vehicle System field, bits 49-55.

public byte VehicleSystem { get; }

Property Value

Byte

J1939Name.VehicleSystemInstance Property

Vehicle System Instance field, bits 56-59.

public byte VehicleSystemInstance { get; }

Property Value

Byte

Methods

J1939Name.CompareClaimPriority(J1939Name, J1939Name) Method

Compares two NAMEs for SAE J1939-81 address claiming priority.

public static int CompareClaimPriority(CanKit.Pro.Addressing.J1939Name left, CanKit.Pro.Addressing.J1939Name right);

Parameters

left J1939Name

right J1939Name

Returns

Int32
A negative value when left has higher claim priority and wins because its unsigned 64-bit NAME is numerically lower; zero when both NAMEs are identical; a positive value when right wins.

J1939Name.CompareTo(J1939Name) Method

Compares NAMEs by their raw numeric value, which is also J1939-81 claim priority order.

public int CompareTo(CanKit.Pro.Addressing.J1939Name other);

Parameters

other J1939Name

Returns

Int32

J1939Name.Compose(uint, ushort, byte, byte, byte, bool, byte, byte, byte, bool) Method

Composes a raw 64-bit NAME value from individual SAE J1939 fields.

public static ulong Compose(uint identityNumber, ushort manufacturerCode, byte ecuInstance, byte functionInstance, byte function, bool reserved, byte vehicleSystem, byte vehicleSystemInstance, byte industryGroup, bool arbitraryAddressCapable);

Parameters

identityNumber UInt32

manufacturerCode UInt16

ecuInstance Byte

functionInstance Byte

function Byte

reserved Boolean

vehicleSystem Byte

vehicleSystemInstance Byte

industryGroup Byte

arbitraryAddressCapable Boolean

Returns

UInt64

J1939Name.Decompose(ulong) Method

Decomposes a raw 64-bit NAME value into field accessors.

public static CanKit.Pro.Addressing.J1939Name Decompose(ulong value);

Parameters

value UInt64

Returns

J1939Name

J1939Name.Equals(J1939Name) Method

Returns true when both NAME values are identical.

public bool Equals(CanKit.Pro.Addressing.J1939Name other);

Parameters

other J1939Name

Returns

Boolean

J1939Name.HasHigherClaimPriorityThan(J1939Name) Method

Returns true when this NAME wins address claiming arbitration against another NAME.

public bool HasHigherClaimPriorityThan(CanKit.Pro.Addressing.J1939Name other);

Parameters

other J1939Name

Returns

Boolean

J1939Name.HasLowerClaimPriorityThan(J1939Name) Method

Returns true when this NAME loses address claiming arbitration against another NAME.

public bool HasLowerClaimPriorityThan(CanKit.Pro.Addressing.J1939Name other);

Parameters

other J1939Name

Returns

Boolean

Operators

J1939Name.operator ==(J1939Name, J1939Name) Operator

Returns true when both NAME values are identical.

public static bool operator ==(CanKit.Pro.Addressing.J1939Name left, CanKit.Pro.Addressing.J1939Name right);

Parameters

left J1939Name

right J1939Name

Returns

Boolean

J1939Name.operator >(J1939Name, J1939Name) Operator

Returns true when the left NAME has lower claim priority than the right NAME.

public static bool operator >(CanKit.Pro.Addressing.J1939Name left, CanKit.Pro.Addressing.J1939Name right);

Parameters

left J1939Name

right J1939Name

Returns

Boolean

J1939Name.operator >=(J1939Name, J1939Name) Operator

Returns true when the left NAME is equal to or has lower claim priority than the right NAME.

public static bool operator >=(CanKit.Pro.Addressing.J1939Name left, CanKit.Pro.Addressing.J1939Name right);

Parameters

left J1939Name

right J1939Name

Returns

Boolean

J1939Name.operator !=(J1939Name, J1939Name) Operator

Returns true when the NAME values differ.

public static bool operator !=(CanKit.Pro.Addressing.J1939Name left, CanKit.Pro.Addressing.J1939Name right);

Parameters

left J1939Name

right J1939Name

Returns

Boolean

J1939Name.operator <(J1939Name, J1939Name) Operator

Returns true when the left NAME has higher claim priority than the right NAME.

public static bool operator <(CanKit.Pro.Addressing.J1939Name left, CanKit.Pro.Addressing.J1939Name right);

Parameters

left J1939Name

right J1939Name

Returns

Boolean

J1939Name.operator <=(J1939Name, J1939Name) Operator

Returns true when the left NAME is equal to or has higher claim priority than the right NAME.

public static bool operator <=(CanKit.Pro.Addressing.J1939Name left, CanKit.Pro.Addressing.J1939Name right);

Parameters

left J1939Name

right J1939Name

Returns

Boolean