Skip to content

TxConfirmation Struct

Result of SendConfirmed(CanFrame, Nullable<TimeSpan>, CancellationToken): a uniform "was this frame actually sent" answer regardless of whether the underlying adapter supports hardware TX echo (arc42 §5.3/§6.3, ADR-7; FR-RAW-030..034).

public readonly record struct TxConfirmation : System.IEquatable<CanKit.Pro.RawCan.TxConfirmation>

Implements IEquatable<TxConfirmation>

Remarks

A TxConfirmation value is only ever produced for a *resolved* outcome — the returned Task<TxConfirmation> never completes successfully while the send is still pending. Confirmed is true only for an actual driver-accepted send (approximated) or an actually-matched echo frame (real); for every other outcome (timeout, bus-off, outright rejection) Confirmed is false and FailureReason explains why (FR-RAW-033). Explicit caller-supplied CancellationToken cancellation is reported as task cancellation (standard .NET convention), not as a TxConfirmation value.

Properties

TxConfirmation.Confirmed Property

True if the send was confirmed — either by a matched hardware echo, or (when the adapter has no echo capability enabled) by the driver accepting the frame. See IsApproximated to tell the two apart.

public bool Confirmed { get; init; }

Property Value

Boolean

TxConfirmation.FailureReason Property

Why the send was not confirmed; None when Confirmed is true.

public CanKit.Pro.RawCan.TxConfirmFailureReason FailureReason { get; init; }

Property Value

TxConfirmFailureReason

TxConfirmation.HostTransmitTimestamp Property

GetTimestamp reading taken immediately after the driver accepted the frame, or zero when nothing was handed to the driver (an outright rejection). Monotonic, and comparable with the HostArrivalTimestamp the demux puts on received frames.

public long HostTransmitTimestamp { get; init; }

Property Value

Int64

Remarks

Timestamp answers "when was this result produced" and is a wall-clock reading; this answers "when did the frame go out", which is a different question and needs a different clock. A caller whose response deadline starts at transmission has no other way to learn that instant: by the time the returned task completes it is behind the echo wait, and reading the clock then starts the deadline late enough to let a late response pass for a punctual one (#92).

TxConfirmation.IsApproximated Property

True when Confirmed reflects driver acceptance rather than an actual hardware echo (FR-RAW-032) — i.e. "best-effort acknowledgment", not a guarantee the frame reached the wire. Always false when Confirmed is false.

public bool IsApproximated { get; init; }

Property Value

Boolean

TxConfirmation.Timestamp Property

UTC timestamp of when this result was produced (confirmation or failure).

public System.DateTime Timestamp { get; init; }

Property Value

DateTime