Skip to content

CanIdRange Class

Validated construction/checking for 11-bit (Standard) and 29-bit (Extended) CAN IDs (arc42 "Adressierungs-Helfer"; SRS FR-RAW-040).

public static class CanIdRange

Inheritance Object → CanIdRange

Remarks

Every layer that already masks an ID (CanFrame/CanFrameView, IsoTpEndpoint) does so silently (id & mask) rather than rejecting an out-of-range value — appropriate on a hot path, but it means a caller-supplied ID that is too wide is truncated without any signal. These helpers are the opposite: an explicit, throwing check for call sites (configuration, protocol-instance setup) where silently accepting a truncated ID would be the wrong failure mode.

Fields

CanIdRange.ExtendedMax Field

Largest valid 29-bit extended CAN ID (inclusive).

public const uint ExtendedMax = 536870911;

Field Value

UInt32

CanIdRange.StandardMax Field

Largest valid 11-bit standard CAN ID (inclusive).

public const uint StandardMax = 2047;

Field Value

UInt32

Methods

CanIdRange.IsValidExtended(uint) Method

True when id fits in 29 bits.

public static bool IsValidExtended(uint id);

Parameters

id UInt32

Returns

Boolean

CanIdRange.IsValidStandard(uint) Method

True when id fits in 11 bits.

public static bool IsValidStandard(uint id);

Parameters

id UInt32

Returns

Boolean

CanIdRange.ValidateExtended(uint) Method

Returns id unchanged if it fits in 29 bits, otherwise throws.

public static uint ValidateExtended(uint id);

Parameters

id UInt32

Returns

UInt32

CanIdRange.ValidateStandard(uint) Method

Returns id unchanged if it fits in 11 bits, otherwise throws.

public static uint ValidateStandard(uint id);

Parameters

id UInt32

Returns

UInt32