Skip to content

IsoTpChannelOptions Class

Configuration for an IIsoTpChannel.

public sealed class IsoTpChannelOptions

Inheritance Object → IsoTpChannelOptions

Remarks

All values are set at channel creation time and treated as immutable for the channel's lifetime. Timeouts follow ISO 15765-2 §6.5 naming and their defaults are intentionally conservative (1 second each) so tests and virtual-loopback sessions never sit for the standard's much larger recommended values (e.g. 1000 ms N_As) when the transport itself is only microseconds slow. Production callers are expected to override the timing values that matter for their bus.

Fields

IsoTpChannelOptions.DefaultTimeout Field

Default value for NAs, NBs, NCr.

public static readonly TimeSpan DefaultTimeout;

Field Value

TimeSpan

Properties

IsoTpChannelOptions.LocalBlockSize Property

Block size (BS) advertised on Flow-Control frames sent by this channel while receiving multi-frame PDUs. 0 means "no additional FCs needed, send all remaining CFs".

public byte LocalBlockSize { get; init; }

Property Value

Byte

IsoTpChannelOptions.LocalStMin Property

STmin advertised on Flow-Control frames sent by this channel while receiving multi-frame PDUs. Encoded per ISO 15765-2 (0..127 ms in 1-ms steps, 100..900 µs in 100-µs steps). Defaults to TimeSpan.Zero (no minimum separation requested). Must be non-negative — a negative value fails channel open via EncodeStMin(TimeSpan).

public System.TimeSpan LocalStMin { get; init; }

Property Value

TimeSpan

IsoTpChannelOptions.NAs Property

N_As — maximum time between the sender handing an SF/FF/CF to the driver and the driver confirming it was sent (ISO 15765-2 §6.5, corresponds to the FR-TP-010 acceptance criterion). Modelled here as the TX-confirmation timeout the channel uses when calling SendConfirmed(CanFrame, Nullable<TimeSpan>, CancellationToken). Defaults to DefaultTimeout.

public System.TimeSpan NAs { get; init; }

Property Value

TimeSpan

IsoTpChannelOptions.NBs Property

N_Bs — maximum time between the sender's FF/last-CF-of-a-block and the peer's Flow Control (ISO 15765-2 §6.5). Expiring aborts the outgoing PDU with a timeout error (FR-TP-010). Defaults to DefaultTimeout.

public System.TimeSpan NBs { get; init; }

Property Value

TimeSpan

IsoTpChannelOptions.NCr Property

N_Cr — maximum time between two Consecutive Frames on the receive side (ISO 15765-2 §6.5). Expiring aborts the incoming reassembly and faults a pending ReceiveAsync(CancellationToken) with IsoTpTimeoutException (FR-TP-010). Defaults to DefaultTimeout.

public System.TimeSpan NCr { get; init; }

Property Value

TimeSpan

IsoTpChannelOptions.PaddingByte Property

Byte used to pad SF/CF/FC frames when UsePadding is true. Defaults to DefaultPaddingByte (0xCC).

public byte PaddingByte { get; init; }

Property Value

Byte

IsoTpChannelOptions.ReceiveBufferCapacity Property

Bounded capacity of the internal receive buffer that holds fully reassembled PDUs waiting for the consumer. When full, the oldest PDU is dropped so the RX loop never stalls. Defaults to 64.

public int ReceiveBufferCapacity { get; init; }

Property Value

Int32

IsoTpChannelOptions.UseCanFd Property

true to build ISO-TP frames as CAN-FD (up to 64-byte per frame); false for classic CAN (8-byte per frame). Must match the underlying ICanBus mode; if the bus is classic-CAN, true here will produce frames the driver rejects.

public bool UseCanFd { get; init; }

Property Value

Boolean

IsoTpChannelOptions.UsePadding Property

true to pad each frame to the next valid CAN/CAN-FD DLC step with PaddingByte; false to send the exact minimum payload. Many ISO 15765-2 stacks expect padding on classic CAN; CAN-FD padding is optional per ISO 15765-2 §5.

public bool UsePadding { get; init; }

Property Value

Boolean

IsoTpChannelOptions.WftMax Property

WFTmax — maximum number of consecutive Wait FCs the sender is willing to accept before aborting (ISO 15765-2 §6.3, FR-TP-011). Defaults to 10.

public int WftMax { get; init; }

Property Value

Int32

Methods

IsoTpChannelOptions.With(Nullable<bool>, Nullable<bool>, Nullable<byte>, Nullable<byte>, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<int>, Nullable<int>) Method

Convenience clone that returns a new instance with the provided overrides. Useful for tests that want to tweak one field of a shared default template.

public CanKit.Pro.IsoTp.IsoTpChannelOptions With(System.Nullable<bool> useCanFd=null, System.Nullable<bool> usePadding=null, System.Nullable<byte> paddingByte=null, System.Nullable<byte> localBlockSize=null, System.Nullable<System.TimeSpan> localStMin=null, System.Nullable<System.TimeSpan> nAs=null, System.Nullable<System.TimeSpan> nBs=null, System.Nullable<System.TimeSpan> nCr=null, System.Nullable<int> wftMax=null, System.Nullable<int> receiveBufferCapacity=null);

Parameters

useCanFd Nullable<Boolean>

usePadding Nullable<Boolean>

paddingByte Nullable<Byte>

localBlockSize Nullable<Byte>

localStMin Nullable<TimeSpan>

nAs Nullable<TimeSpan>

nBs Nullable<TimeSpan>

nCr Nullable<TimeSpan>

wftMax Nullable<Int32>

receiveBufferCapacity Nullable<Int32>

Returns

IsoTpChannelOptions