Serves to execute diagnostic monitorings and report status to Diagnostic Management.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 49f63d89472dProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Serves to execute diagnostic monitorings and report status to Diagnostic Management.
The class ara::diag::Monitor provides the functional interface for implementing diagnostic monitoring functions and connecting them to Diagnostic Management [SWS_DM_00548]. After binding to a port prototype, the application signals its readiness to receive via Offer() and continuously transmits test results via ReportMonitorAction()[SWS_DM_01088], [SWS_DM_00543]. Monitor instances are neither copyable nor movable, and all operations are specified as not thread-safe [SWS_DM_01685].
Context
The class ara::diag::Monitor represents the standardized C++ interface for realizing diagnostic monitoring functions (monitors) within the Adaptive Platform [SWS_DM_00548]. A monitor is responsible for detecting and reporting fault symptoms in functional software components and transmits their states to the Diagnostic Management (DM) module.
Binding to the AUTOSAR system model is performed via an ara::core::InstanceSpecifier, which must mandatory reference a PortPrototype typed by a DiagnosticMonitorInterface[SWS_DM_00548]. Essentially three components are involved in the overall execution: the application-specific function monitoring (Application), the local interface instance of ara::diag::Monitor, and the platform module Diagnostic Management (DM), which accepts events and requests re-initializations.
Instantiation of a monitor depends on the debouncing mechanism defined in the model. The Adaptive Platform provides four constructor variants for this purpose:
Monitor-internal debouncing with registration of a InitMonitorNotifier callback and a function pointer for querying the Fault Detection Counter (std::function<std::int8_t()> getFaultDetectionCounter) [SWS_DM_00548].
Counter-based debouncing by passing parameters of type CounterBased[SWS_DM_00549].
Time-based debouncing by passing parameters of type TimeBased[SWS_DM_00550].
Direct monitoring without debouncing algorithm [SWS_DM_01972].
Instances of ara::diag::Monitor are firmly bound to their original storage location: copy constructor [SWS_DM_01685] and copy assignment operator [SWS_DM_01683] are deleted (delete). Likewise, move constructor [SWS_DM_01686] and move assignment [SWS_DM_01684] are explicitly deleted.
After creation, the instance is in the Unoffered state. Only through the explicit call of Offer() does the application declare its readiness to receive and process diagnostic callouts such as initMonitor[SWS_DM_01088]. With StopOffer(), the forwarding of diagnostic requests from the DM is deactivated again [SWS_DM_01089]. After calling StopOffer(), resuming operation later by calling Offer() again would presumably be possible. Question Q-136565db34b28ae6 (open) Prior to the final destruction of the monitor object, the application would presumably have to execute StopOffer() to reliably prevent pending notifications.
State diagram: Lifecycle states and transitions during service offering of ara::diag::Monitor. Sources: [SWS_DM_01088], [SWS_DM_01089]
Usage Path
The regular sequence for monitoring a fault path comprises the following steps:
Instantiation: The application creates the Monitor instance by specifying the InstanceSpecifier, the callback initMonitor, and any required debouncing parameters or the FDC callback [SWS_DM_00548], [SWS_DM_00549].
Service offering: Via Offer(), the monitor registers with the DM as ready to receive [SWS_DM_01088].
Initialization: Diagnostic Management informs the application about pending initialization events via the registered InitMonitorNotifier callback [SWS_DM_01088].
Cyclic/event-based reporting: During operative operation, the application continuously reports the status of the monitoring path via ReportMonitorAction(action)[SWS_DM_00543]. The passed action contains either test results (qualified/unqualified) or commands for debounce control or prestorage. If monitor-internal debouncing was configured, the DM queries the fault detection value via the registered callback if needed [SWS_DM_00548].
Service termination: Prior to shutdown or upon deactivation of the diagnostic function, the application calls StopOffer() to prevent incoming DM messages [SWS_DM_01089].
Error situations manifest themselves in ara::diag::Monitor on two different levels: as an error code via ara::core::Result or as runtime violations of the framework.
The method Offer() returns a ara::core::Result<void>. If the monitor is already in the offered state, the call fails and returns the error code DiagOfferErrc::kAlreadyOffered[SWS_DM_01088].
Severe configuration or call errors trigger defined violation messages:
InstanceSpecifierMappingIntegrityViolation: The InstanceSpecifier cannot be resolved in the model context of the process or does not reference a PortPrototype[SWS_DM_00548].
PortInterfaceMappingViolation: The referenced port is not typed by a DiagnosticMonitorInterface[SWS_DM_00548].
ProcessMappingViolation: No matching modeled process exists for the runtime instance [SWS_DM_00548].
InstanceSpecifierAlreadyInUseViolation: The InstanceSpecifier is already used by another monitor within the current process [SWS_DM_00548].
InvalidDebouncingAlgorithmViolation: The debouncing mechanism selected in the constructor deviates from the debouncing method modeled in the DEXT diagnostic descriptions [SWS_DM_00548], [SWS_DM_00549], [SWS_DM_00550].
UnexpectedMonitorActionHandlingViolation: An action value that is not supported for the configured debouncing algorithm is passed to the method ReportMonitorAction()[SWS_DM_00543].
This guide is based on the specification AUTOSAR Adaptive Platform Release R25-11.
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 DiagnosticMonitorPortMapping needs to be typed by a DiagnosticMonitorInterface. 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.
InvalidDebouncin- Mismatching Debounce Algorithm in DEXT i.e gAlgorithmViola- DiagnosticEventToDebounceAlgorithmMapping shall be tion mapped to DiagnosticEventToDebounceAlgorithmMapping. DiagnosticDebounceAlgorithmProps which aggregates DiagEventDebounceMonitorInternal or DiagnosticEventToDebounceAlgorithmMapping shall not exist.
Parameter (in)
Parameter
Beschreibung
specifier
InstanceSpecifier to a PortPrototype of a DiagnosticMonitorInterface.
initMonitor
Possibility to register an InitMonitor callback
getFaultDetectionCounter
Possibility to register a function to get the current FDC for this event.
Request a governed re-review of this record. The record is not changed immediately.
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 DiagnosticMonitorPortMapping needs to be typed by a DiagnosticMonitorInterface. 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. InvalidDebouncin- Mismatching Debounce Algorithm in DEXT i.e gAlgorithmViola- DiagnosticEventToDebounceAlgorithmMapping shall be tion mapped to DiagnosticEventToDebounceAlgorithmMapping. DiagnosticDebounceAlgorithmProps which aggregates DiagEventDebounceCounterBased.
Parameter (in)
Parameter
Beschreibung
specifier
InstanceSpecifier to a PortPrototype of a DiagnosticMonitorInterface.
initMonitor
Possibility to register an InitMonitor callback
defaultValues
Default values for CounterBased debouncing
Request a governed re-review of this record. The record is not changed immediately.
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 DiagnosticMonitorPortMapping needs to be typed by a DiagnosticMonitorInterface. 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. InvalidDebouncin- Mismatching Debounce Algorithm in DEXT i.e gAlgorithmViola- DiagnosticEventToDebounceAlgorithmMapping shall be tion mapped to DiagnosticEventToDebounceAlgorithmMapping. DiagnosticDebounceAlgorithmProps which aggregates DiagEventDebounceTimeBased.
Parameter (in)
Parameter
Beschreibung
specifier
InstanceSpecifier to a PortPrototype of a DiagnosticMonitorInterface.
initMonitor
Possibility to register an InitMonitor callback
defaultValues
Default values for TimeBased debouncing
Request a governed re-review of this record. The record is not changed immediately.
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 DiagnosticMonitorPortMapping needs to be typed by a DiagnosticMonitorInterface. 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. InvalidDebouncin- Mismatching Debounce Algorithm in DEXT i.e gAlgorithmViola- DiagnosticEventToDebounceAlgorithmMapping shall be tion mapped to DiagnosticEventToDebounceAlgorithmMapping. DiagnosticDebounceAlgorithmProps which aggregates DiagEventDebounceMonitorInternal or DiagnosticEventToDebounceAlgorithmMapping shall not exist.
Parameter (in)
Parameter
Beschreibung
specifier
InstanceSpecifier to a PortPrototype of a DiagnosticMonitorInterface.
initMonitor
Possibility to register an InitMonitor callback
Request a governed re-review of this record. The record is not changed immediately.
With the Offer the application states that it is ready to receive and process initMonitor callouts.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 2e8d03769af8Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
By calling the method Offer, an Adaptive Application signals to Diagnostic Management (DM) that it is ready to receive and process initMonitor callouts [SWS_DM_01088]. The method of class ara::diag::Monitor has no parameters and returns ara::core::Result<void>[SWS_DM_01088]. Although the name was chosen in reference to ara::com, it is a specific implementation of the diagnostic component and must not be confused with communication services AUTOSAR_AP_SWS_Diagnostics §7.3.4.1.2 “Monitors”.
In case of an error, the method returns the error code DiagOfferErrc::kAlreadyOffered if the service was already offered previously [SWS_DM_01088]. This corresponds to the enumerator for reporting already active offers within the diagnostic error domains [SWS_DM_00514]. Upon a successful call, the return object contains no error.
Regarding concurrency, the method is specified as not thread-safe, meaning concurrent calls on the same instance must be synchronized on the application side [SWS_DM_01088]. In addition, the function is declared as exception-safe (exception safe) and with noexcept[SWS_DM_01088].
Function to report the status information being relevant for error monitoring paths.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 8334da733b55Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The synchronous method ReportMonitorAction of class ara::diag::Monitor reports status and monitoring information of a diagnostic check to the error monitoring of the Diagnostic Management daemon [SWS_DM_00543]. Via parameter action of type MonitorAction, the application passes either a qualified or unqualified test result, or control commands for controlling debouncing and triggering prestorage [SWS_DM_00543]. The function returns no value (void) and is declared as noexcept as well as exception-safe [SWS_DM_00543].
If ReportMonitorAction is called with a value for action that is not supported by the configured debouncing algorithm of the diagnostic event, the Diagnostic Manager triggers a process violation [SWS_DM_01988]. In addition, the system defines internal error codes in type DiagErrc, for example kReportIgnored for situations in which enable conditions are not fulfilled [SWS_DM_00514].
The following boundary conditions apply to integration and concurrency:
Thread safety: The function is not thread-safe (not thread-safe) [SWS_DM_00543]. Concurrent calls on the same monitor instance must be synchronized on the caller side (in contrast to MultipleMonitor, where thread safety is configurable via the constructor [SWS_DM_01698]).
Enable conditions: If an enable condition assigned to the diagnostic event is not fulfilled, the call to ReportMonitorAction is ignored SWS Diagnostics §7.3.4.1.4 “EnableConditions”.
Debouncing: Reported actions such as kPrefailed modify the internal debouncing counter according to the configured step size [SWS_DM_00875], until the error is classified as kFinallyDefective when the threshold is reached [SWS_DM_00024].
This usage note was generated automatically based on specification AUTOSAR AP R25-11.
UnexpectedMoni- ara::diag::Monitor::ReportMonitorAction is called with torActionHan- a parameter action value that is not supported by the used dlingViolation debouncing method.
Parameter (in)
Parameter
Beschreibung
action
Contains either the last (un-)qualified test result of the diagnostic monitor or commands to control the debouncing or to force a prestorage.
Rückgabewert
Typ
Beschreibung
None
Request a governed re-review of this record. The record is not changed immediately.
This StopOffer will disable the forwarding of request messages from DM.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: e17ef3becf1dProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method ara::diag::Monitor::StopOffer disables the forwarding of requests and messages from Diagnostic Management (DM) to the respective monitor instance ([SWS_DM_01089]). The call is executed synchronously, requires no input parameters, and has no return value ([SWS_DM_01089]). The operation serves as the counterpart to Offer and allows an Adaptive Application to suspend active monitoring if the associated system part does not need to be monitored temporarily (AUTOSAR_AP_SWS_Diagnostics §7.3.4.1.2 “Monitors”). Although the identifier is oriented toward the interfaces from ara::com, the specification explicitly emphasizes that it is an independent implementation of ara::diag::Monitor (AUTOSAR_AP_SWS_Diagnostics §7.3.4.1.2 “Monitors”).
Regarding error handling, the function is declared as noexcept and considered exception safe; specific error codes or error messages do not exist ([SWS_DM_01089]). As a key constraint, StopOffer is classified as not thread-safe ([SWS_DM_01089]). Interpretation: In the case of concurrent accesses to the same monitor object, the caller is likely responsible for suitable synchronization itself. Question Q-3ead3049b4378083 (open)
In the overall system, StopOffer fits into a uniform pattern of the diagnostic module: Analogous interfaces for disabling DM message forwarding can be found, among others, in GenericRoutine ([SWS_DM_00558]), CommunicationControl ([SWS_DM_00810]), EcuResetRequest ([SWS_DM_01017]), and Authentication ([SWS_DM_01131]).
This usage note was automatically generated and is based on the specifications of AUTOSAR Adaptive R25-11.
gemini-3.8-flash-low· 2026-10-13 · German original