Enables applications to perform status-related monitoring, debouncing, and DTC querying of diagnostic events.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 2f3253efefb6ProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables applications to perform status-related monitoring, debouncing, and DTC querying of diagnostic events.
In AUTOSAR Adaptive, the class ara::diag::Event provides operations for monitoring diagnostic events and their debouncing and error status. Applications instantiate the object via an InstanceSpecifier, register optional change notifications, and retrieve diagnostic and DTC information asynchronously [SWS_DM_00647]. As a central constraint, the instance is neither copyable nor movable, and due to a lack of thread safety, most query methods require application-side synchronization during concurrent access [SWS_DM_00649].
Context
The class ara::diag::Event serves as the primary interface for interacting with diagnostic events in the AUTOSAR Adaptive Platform. It acts as a link between application-specific software and central diagnostic management. Applications use this interface to monitor the current diagnostic and debouncing status of an event or to be notified of status changes.
In the system context, essentially three parties are involved in the interaction:
Application software: Instantiates the class, initiates status queries, and receives asynchronous status updates.
ara::diag::Event: Encapsulates the typed diagnostic port (PortPrototype of a DiagnosticEventInterface) and provides cross-thread and cross-process query methods.
Diagnostic Management (DM): Executes error detection, DTC mappings, and debouncing behavior on the server side.
Context diagram: Placement of the Event class between application software and Diagnostic Management. Sources: [SWS_DM_00647], [SWS_DM_00653]
Lifecycle
Instantiation is performed explicitly by passing an ara::core::InstanceSpecifier[SWS_DM_00647]. The identifier must refer to a PortPrototype typed via an DiagnosticEventInterface. The constructor is exception-safe and thread-safe [SWS_DM_00647].
With regard to ownership, ara::diag::Event is defined as a non-copyable and non-movable single instance: both the copy constructor [SWS_DM_01681] and the move constructor [SWS_DM_01682] as well as the associated assignment operators ([SWS_DM_01679], [SWS_DM_01680]) are explicitly deleted (=delete). An InstanceSpecifier must not be instantiated multiple times per process [SWS_DM_00647].
Destruction takes place via the destructor ~Event()[SWS_DM_00648]. Unlike the constructor, the destructor is not thread-safe. The remaining member functions (with the exception of GetDTCNumber) are also specified as not thread-safe, which is why concurrent calls on the same instance must be synchronized on the application side. In Release R25-11, the terminology in this regard was harmonized from reentrancy to concurrency AUTOSAR_AP_SWS_Diagnostics §1 “Change History”.
Usage Path
A typical use case is divided into the following calls:
Initialization: The application creates the instance via its InstanceSpecifier[SWS_DM_00647]. The binding is expected to establish the connection to the diagnostic daemon at initialization time. Question Q-78e4462a0d147cfb (open)
Registering notifier: For monitoring purposes, a callback is optionally registered via SetEventStatusChangedNotifier[SWS_DM_00650]. A subsequent call overwrites the previously set notifier.
State queries: During operation, the application queries diagnostic data asynchronously via ara::core::Future:
GetEventStatus() determines the current status byte [SWS_DM_00649].
GetDebouncingStatus() returns the current debouncing state [SWS_DM_00654].
GetFaultDetectionCounter() retrieves the fault detection counter (FDC) [SWS_DM_00656].
GetTestComplete() checks whether the test has completed (FDC reaches -128 or 127) [SWS_DM_00655].
GetDTCNumber(dtcFormat) provides the associated DTC number in the selected format and is designed to be thread-safe [SWS_DM_00653].
Register a notifier function which is called if a diagnostic event is changed. A consecutive call of this method will overwrite the previous registered notifier.
InstanceSpeci- InstanceSpecifier either cannot be resolved in the model in the fierMappingIn- context of your executable, or it refers to a model element other tegrityViolation than a PortPrototype. PortInterfaceMap- A PortPrototype that is referenced by a pingViolation DiagnosticEventPortMapping needs to be typed by a DiagnosticEventInterface. ProcessMappingVio- Matching InstanceRef exists, but no matching (modelled) Process lation found that matches the (runtime) process. InstanceSpecifier- Violation message that is sent in case a constructor in the ara AlreadyInUseViola- framework was called with an InstanceSpecifier already in use in tion this process.
Parameter (in)
Parameter
Beschreibung
specifier
InstanceSpecifier to a PortPrototype of a DiagnosticEventInterface.
Request a governed re-review of this record. The record is not changed immediately.
Register a notifier function which is called if a diagnostic event is changed. A consecutive call of this method will overwrite the previous registered notifier.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 07bc53ae711cProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Via the method [SWS_DM_00650] of class ara::diag::Event (header file ara/diag/event.h), an Adaptive Application registers a callback function of type EventStatusByteNotifier. After successful registration, Diagnostic Management (DM) calls this notifier on every status change of the associated diagnostic event [SWS_DM_01029]. A consecutive call of the method overwrites the previously registered notifier [SWS_DM_00650]. The function has the signature ara::core::Result<void> SetEventStatusChangedNotifier(EventStatusByteNotifier notifier) noexcept and returns an empty result on success [SWS_DM_00650].
If an error occurs during processing, the method returns the error code DiagErrc::kInvalidArgument[SWS_DM_00650]. Although the interface is declared exception-safe (exception safe), it is explicitly considered not thread-safe (not thread-safe) [SWS_DM_00650]. Interpretation: Competing accesses to the same instance must be synchronized on the application side; presumably, registration should therefore preferably be performed during the initialization phase of the application. Question Q-d8ed099eaed6b197 (open)
gemini-3.8-flash-low· 2026-10-13 · German original