Skip to content

UdsNegativeResponseException Class

Raised when the ECU replies with a Negative Response (0x7F, requestSid, NRC). The three raw bytes are surfaced verbatim so callers can log / branch on any NRC value, not just the ones named in UdsNegativeResponseCode (SRS FR-UDS-010).

public sealed class UdsNegativeResponseException : CanKit.Pro.Uds.UdsException

Inheritance ObjectExceptionCanKitExceptionUdsException → UdsNegativeResponseException

Constructors

UdsNegativeResponseException(UdsServiceId, byte) Constructor

Creates a structured NRC exception.

public UdsNegativeResponseException(CanKit.Pro.Uds.UdsServiceId requestedService, byte code);

Parameters

requestedService UdsServiceId

code Byte

Properties

UdsNegativeResponseException.Code Property

Raw NRC byte returned by the ECU (byte 3 of the NRC frame).

public byte Code { get; }

Property Value

Byte

UdsNegativeResponseException.CodeAsEnum Property

The named NRC value when Code matches one of the entries in UdsNegativeResponseCode; null otherwise. Callers should still branch on Code for values not covered by the enum.

public System.Nullable<CanKit.Pro.Uds.UdsNegativeResponseCode> CodeAsEnum { get; }

Property Value

Nullable<UdsNegativeResponseCode>

UdsNegativeResponseException.CodeName Property

Human-readable NRC name (e.g. "requestOutOfRange") when the code is known, otherwise a hex literal. Handy for log lines.

public string CodeName { get; }

Property Value

String

UdsNegativeResponseException.RequestedService Property

Service the request targeted (the byte returned as byte 2 of the NRC frame).

public CanKit.Pro.Uds.UdsServiceId RequestedService { get; }

Property Value

UdsServiceId