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.
Field Value¶
J1939Name.FunctionInstanceMax Field¶
Largest valid function instance value.
Field Value¶
J1939Name.IdentityNumberMax Field¶
Largest valid identity number value.
Field Value¶
J1939Name.IndustryGroupMax Field¶
Largest valid industry group value.
Field Value¶
J1939Name.ManufacturerCodeMax Field¶
Largest valid manufacturer code value.
Field Value¶
J1939Name.VehicleSystemInstanceMax Field¶
Largest valid vehicle system instance value.
Field Value¶
J1939Name.VehicleSystemMax Field¶
Largest valid vehicle system value.
Field Value¶
Properties¶
J1939Name.ArbitraryAddressCapable Property¶
Arbitrary Address Capable field, bit 63.
Property Value¶
J1939Name.EcuInstance Property¶
ECU Instance field, bits 32-34.
Property Value¶
J1939Name.Function Property¶
Function field, bits 40-47.
Property Value¶
J1939Name.FunctionInstance Property¶
Function Instance field, bits 35-39.
Property Value¶
J1939Name.IdentityNumber Property¶
Identity Number field, bits 0-20.
Property Value¶
J1939Name.IndustryGroup Property¶
Industry Group field, bits 60-62.
Property Value¶
J1939Name.ManufacturerCode Property¶
Manufacturer Code field, bits 21-31.
Property Value¶
J1939Name.Reserved Property¶
Reserved field, bit 48.
Property Value¶
J1939Name.Value Property¶
Raw 64-bit NAME value.
Property Value¶
J1939Name.VehicleSystem Property¶
Vehicle System field, bits 49-55.
Property Value¶
J1939Name.VehicleSystemInstance Property¶
Vehicle System Instance field, bits 56-59.
Property Value¶
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.
Parameters¶
other J1939Name
Returns¶
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¶
J1939Name.Decompose(ulong) Method¶
Decomposes a raw 64-bit NAME value into field accessors.
Parameters¶
value UInt64
Returns¶
J1939Name.Equals(J1939Name) Method¶
Returns true when both NAME values are identical.
Parameters¶
other J1939Name
Returns¶
J1939Name.Equals(object) Method¶
Indicates whether this instance and a specified object are equal.
Parameters¶
obj Object
The object to compare with the current instance.
Returns¶
Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.
J1939Name.FromBytes(byte[], int) Method¶
Reads a NAME from eight bytes, least significant first, at offset in source -- the data field of an Address Claimed message. See ToBytes().
Parameters¶
offset Int32
Returns¶
Exceptions¶
ArgumentNullException
source is null.
ArgumentOutOfRangeException
Fewer than eight bytes from offset.
J1939Name.GetHashCode() Method¶
Returns the hash code for this instance.
Returns¶
Int32
A 32-bit signed integer that is the hash code for this instance.
J1939Name.HasHigherClaimPriorityThan(J1939Name) Method¶
Returns true when this NAME wins address claiming arbitration against another NAME.
Parameters¶
other J1939Name
Returns¶
J1939Name.HasLowerClaimPriorityThan(J1939Name) Method¶
Returns true when this NAME loses address claiming arbitration against another NAME.
Parameters¶
other J1939Name
Returns¶
J1939Name.ToBytes() Method¶
The NAME as it travels in the data field of an Address Claimed message: eight bytes, least significant first (SAE J1939-81 §4.1 -- byte 1 carries bits 1-8 of the Identity Number, byte 8 the Industry Group and the Arbitrary Address Capable bit). Fixed by the standard, not by the host: a platform-endian conversion of Value is wrong on a big-endian host (#55).
Returns¶
J1939Name.ToString() Method¶
Returns the fully qualified type name of this instance.
Returns¶
String
The fully qualified type name.
J1939Name.WriteTo(byte[], int) Method¶
Writes the NAME's eight bytes, least significant first, into destination at offset. See ToBytes().
Parameters¶
offset Int32
Exceptions¶
ArgumentNullException
destination is null.
ArgumentOutOfRangeException
Fewer than eight bytes from offset.
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¶
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¶
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¶
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¶
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¶
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