Enables applications to perform generic processing of UDS RoutineControl services with asynchronous data transfer.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: ed3ab770d945ProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables applications to perform generic processing of UDS RoutineControl services with asynchronous data transfer.
The class provides a generic handler for UDS RoutineControl services and forwards requests for different routine identifiers to adaptive applications [SWS_DM_00552]. Developers implement the required routine actions via asynchronous methods such as Start and activate message forwarding by Offer[SWS_DM_00557]. Because instances are neither copyable nor movable, lifecycle and concurrency must be controlled precisely via the constructor and the interface configuration. Ongoing operations support cooperative cancellations as well as standardized UDS error codes.
Context
The class ara::diag::GenericRoutine provides the generic interface for processing diagnostic routines according to ISO 14229-1 (UDS RoutineControl, Service 0x31) in the AUTOSAR Adaptive Platform. It acts as a link between the central Diagnostic Management (DM) and the adaptive application. An instance of this class is bound to a modeled port prototype of type DiagnosticRoutineGenericInterface, which must be referenced via a DiagnosticServiceGenericMapping in the model [SWS_DM_00552]. In contrast to type-specific routine interfaces, GenericRoutine passes the raw data of the diagnostic request as ara::core::Span<const std::uint8_t> together with the concrete routine identifier (routineId) to the application [SWS_DM_00554], [SWS_DM_00555], [SWS_DM_00556]. This allows a single handler to serve multiple routines flexibly.
Lifecycle
Instances of GenericRoutine are bound to their specific port and must neither be copied nor moved; copy and move constructors as well as assignment operators are explicitly deleted [SWS_DM_01637], [SWS_DM_01638], [SWS_DM_01635], [SWS_DM_01636]. Initialization is performed via the constructor by specifying the ara::core::InstanceSpecifier as well as the concurrency behavior (ConcurrencyType: kConcurrent or kNotConcurrent) [SWS_DM_00552]. This parameter defines whether the virtual execution methods must be implemented in a thread-safe manner.
After creation, the DM initially does not forward any messages to the handler. Only by calling Offer() is forwarding activated [SWS_DM_00557]. Via StopOffer(), forwarding can be deactivated again [SWS_DM_00558] before the instance is released by the virtual destructor ~GenericRoutine()[SWS_DM_00553]. While the constructor is thread-safe, Offer(), StopOffer(), and the destructor are not thread-safe and require external synchronization [SWS_DM_00552], [SWS_DM_00557], [SWS_DM_00558], [SWS_DM_00553].
To provide a generic routine, an application derives from GenericRoutine and overrides the required virtual methods. The method Start (UDS subfunction 0x01) is pure virtual (pure virtual) and must be implemented mandatory [SWS_DM_00554]. The methods Stop (subfunction 0x02) [SWS_DM_00555] and RequestResults (subfunction 0x03) [SWS_DM_00556] are virtual methods; interpretation: Since they are not pure virtual, they would presumably only need to be overridden if the respective routine functionally supports stopping or separate result querying. Question (open)
The regular sequence comprises the following phases:
Instantiation: Creating the derived handler with port reference and concurrency mode [SWS_DM_00552].
Activation: Calling Offer() to enable for the DM [SWS_DM_00557].
Execution: Upon incoming UDS requests, the DM calls Start, Stop, or RequestResults. The application receives routineId, requestData, metaInfo as well as a CancellationHandler and returns a ara::core::Future<OperationOutput>[SWS_DM_00554], [SWS_DM_00555], [SWS_DM_00556]. The validity of requestData is guaranteed until the associated promise is fulfilled or the operation is cancelled [SWS_DM_00554].
Cancellation handling: The application can check the cancellation status via cancellationHandler.IsCanceled() or register a callback via cancellationHandler.SetNotifier()[SWS_DM_00554]. Interpretation: In the event of a cancellation, the application would presumably terminate running background activities prematurely and resolve the promise promptly. Question (open)
Deactivation: Stopping forwarding via StopOffer()[SWS_DM_00558] prior to destruction of the object.
Errors can occur both during configuration and during runtime and execution:
Model and mapping violations: If resolution of the InstanceSpecifier in the model fails, if it is not identified as PortPrototype, or if no matching DiagnosticServiceGenericMapping exists, the framework reports violations such as InstanceSpecifierMappingIntegrityViolation, PortInterfaceMappingViolation, ProcessMappingViolation, or InstanceSpecifierAlreadyInUseViolation[SWS_DM_00552].
Provisioning errors: If Offer() is called even though the service is already offered, the call fails and returns the error code DiagOfferErrc::kAlreadyOffered[SWS_DM_00557].
Diagnostic error codes (NRC): If a routine operation cannot be completed successfully or if the request contains invalid parameters, the application fulfills the returned future not with OperationOutput, but with an appropriate UDS Negative Response Code (NRC) from DiagUdsNrcErrc according to ISO 14229-1 [SWS_DM_00554], [SWS_DM_00555], [SWS_DM_00556].
This class guide is based on the specification AUTOSAR Adaptive Platform R25-11 and was generated automatically.
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 typed by a pingViolation DiagnosticRoutineGenericInterface needs to be referenced by a DiagnosticServiceGenericMapping. 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 DiagnosticRoutineGenericInterface.
concurrencyType
Specifies if the interface is implemented as thread safe ( kConcurrent) or non-thread safe (kNotConcurrent).
Request a governed re-review of this record. The record is not changed immediately.
This Offer will enable the DM to forward request messages to this handler.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 36b2772d0811ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The function Offer of class ara::diag::GenericRoutine enables Diagnostic Management (DM) to forward incoming diagnostic request messages for a routine to the registered handler [SWS_DM_00557]. The call is synchronous, takes no parameters, and returns a ara::core::Result<void>[SWS_DM_00557]. Since the method is declared with the specification noexcept, it is considered exception safe (exception safe) [SWS_DM_00557].
Error handling
If offering fails, the method returns a negative result. If the routine was already previously offered for the instance in question, the method returns the specific error code DiagOfferErrc::kAlreadyOffered[SWS_DM_00557]. Rollback semantics are defined for this error case so that the state remains unchanged [SWS_DM_00557]. The error identifier kAlreadyOffered is also anchored in the internal error domains for diagnostic calls [SWS_DM_00514].
Concurrency and Limitations
The interface is explicitly specified as not thread-safe (not thread-safe) [SWS_DM_00557]. If multiple threads of an application access the same handler, the call must be synchronized. Interpretation: The call would typically occur during initialization, since no requests can be received prior to executing Offer. Question Q-0c42f415bcb0de20 (open)
Interaction
Offering functionalities via Offer is a central pattern in the AUTOSAR Adaptive diagnostic cluster; it is analogously used for type-specific routine interfaces [SWS_DM_00594], generic UDS services [SWS_DM_00619], and data identifiers [SWS_DM_00638]. Despite sharing the name with ara::com, this represents a specific Diagnostic Management implementation SWS Diagnostics §7.3.4.1.2 “Monitors”.
This usage note was curated by an AI and is based exclusively on the AUTOSAR specification R25-11.
Called for RoutineControl with SubFunction RequestResults (0x03) request for this Diagnostic RoutineIdentifier.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f4080ca4c8cdProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method RequestResults of class ara::diag::GenericRoutine is called by the diagnostic server instance to generically process UDS RoutineControl requests of service 0x31 with subfunction requestRoutineResults (0x03) for the parameterized diagnostic routine identifier ([SWS_DM_00575], [SWS_DM_00556]).
During the call, routine identifier routineId, request-specific metadata metaInfo, and input data requestData are passed ([SWS_DM_00556]). The validity of span requestData is strictly limited to until the corresponding Promise is fulfilled or execution is cancelled ([SWS_DM_00556]). A passed cancellationHandler allows querying the cancellation status via IsCanceled as well as registering a notification function via SetNotifier ([SWS_DM_00556]).
The result is returned asynchronously as ara::core::Future<OperationOutput> ([SWS_DM_00556]). Interpretation: The provision of output data is likely typically done asynchronously via an application-side ara::core::Promise. Question Q-f50c8509d7515e3f (open) In the event of success, the future provides a OperationOutput, whereas in the event of an error, a matching UDS NRC according to ISO 14229-1 is transmitted via DiagUdsNrcErrc ([SWS_DM_00556]). The function is declared as noexcept and is considered exception-safe ([SWS_DM_00556]).
Regarding concurrency, thread safety is conditional (conditional): Whether the method must be implemented thread-safe is bindingly controlled via the ConcurrencyType passed to the constructor ([SWS_DM_00556]).
This usage note was generated automatically based on the AUTOSAR specification.
conditional whether the function has to be implemented thread safe or non-thread safe is determined by the ConcurrencyType given in the constructor
Parameter (in)
Parameter
Beschreibung
routineId
the corresponding RoutineIdentifier
requestData
Content of request message (without RoutineIdentifier), Lifetime: Valid until Promise is fulfilled or the processing is cancelled by the cancellationHandler.
metaInfo
MetaInfo of the request.
cancellationHandler
This parameter is used to • Query the current cancellation status by calling cancellationHandler.IsCanceled. Returns TRUE in case, the current conversation has been cancelled and FALSE otherwise. • Register a notifier function by calling cancellationHandler.SetNotifier. The registered notifier is called if the current conversation is cancelled.
Called for RoutineControl with SubFunction Start (0x01) request for this DiagnosticRoutine Identifier.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9e819a027940Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method Start of class ara::diag::GenericRoutine is called as soon as a diagnostic request for RoutineControl with the sub-function Start (0x01) for the specified routineId is received [SWS_DM_00554]. In contrast to the typed routine interface according to [SWS_DM_00591], this generic interface accepts the raw data of the request message as a byte span.
The following requirements and interface properties apply to the implementation:
Call context and parameters: In addition to routineId and the metadata (metaInfo), the parameter requestData is passed. The lifetime of the request data remains valid until the promise is fulfilled or processing is canceled by the cancellationHandler[SWS_DM_00554].
Cancellation handling: The routine can query the current cancellation status using cancellationHandler.IsCanceled() or register a notifier function via cancellationHandler.SetNotifier() that is called when the conversation is canceled [SWS_DM_00554].
Asynchronous semantics: Processing takes place non-blocking via ara::core::Future<OperationOutput>. Upon successful execution, OperationOutput provides the payload for the positive response [SWS_DM_00554].
Error handling: If execution fails, the future must be completed with a matching Negative Response Code (NRC) according to ISO 14229-1 using DiagUdsNrcErrc[SWS_DM_00554].
Concurrency: The function is declared exception-safe (noexcept). Whether the provision must be thread-safe is determined by the ConcurrencyType passed to the constructor [SWS_DM_00554].
This usage note was generated automatically based on the AUTOSAR specification.
conditional whether the function has to be implemented thread safe or non-thread safe is determined by the ConcurrencyType given in the constructor
Parameter (in)
Parameter
Beschreibung
routineId
the corresponding RoutineIdentifier
requestData
Content of request message (without RoutineIdentifier). Lifetime: Valid until Promise is fulfilled or the processing is cancelled by the cancellationHandler.
metaInfo
MetaInfo of the request.
cancellationHandler
This parameter is used to • Query the current cancellation status by calling cancellationHandler.IsCanceled. Returns TRUE in case, the current conversation has been cancelled and FALSE otherwise. • Register a notifier function by calling cancellationHandler.SetNotifier. The registered notifier is called if the current conversation is cancelled.
Called for RoutineControl with SubFunction Stop (0x02) request for this DiagnosticRoutine Identifier.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: d8c6cb55284bProvenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Method Stop is called upon a UDS RoutineControl request with subfunction Stop (0x02) for the respective generic diagnostic routine [SWS_DM_00555]. Compared to typed routine interfaces [SWS_DM_00592], it accepts the routine identifier routineId and the request data as a raw data span requestData[SWS_DM_00555].
When using the method, the following parameter and flow rules must be observed [SWS_DM_00555]:
Lifetime of the input data span: The memory area of requestData remains valid until the associated Promise is fulfilled or execution has been canceled via cancellationHandler[SWS_DM_00555].
Cancellation handling: The application can check via cancellationHandler.IsCanceled() whether the current diagnostic conversation was canceled, or register a notification function via cancellationHandler.SetNotifier that is triggered upon cancellation [SWS_DM_00555].
Asynchrony and return: The function operates asynchronously and returns a ara::core::Future<OperationOutput> that, in the case of success, contains the output data for the positive UDS response [SWS_DM_00555].
Error handling is performed via negative diagnostic return values: If stopping the routine fails, the future must be completed with a matching UDS NRC error code according to ISO 14229-1 via DiagUdsNrcErrc[SWS_DM_00555].
Regarding concurrency, the method is specified as noexcept and exception-safe. Whether the concrete implementation must be designed to be thread-safe depends on ConcurrencyType, which was passed in the constructor during instantiation [SWS_DM_00555].
This usage note is based exclusively on the specifications of Adaptive AUTOSAR release R25-11.
conditional whether the function has to be implemented thread safe or non-thread safe is determined by the ConcurrencyType given in the constructor
Parameter (in)
Parameter
Beschreibung
routineId
the corresponding RoutineIdentifier
requestData
Content of request message (without RoutineIdentifier). Lifetime: Valid until Promise is fulfilled or the processing is cancelled by the cancellationHandler.
metaInfo
MetaData of the request.
cancellationHandler
This parameter is used to • Query the current cancellation status by calling cancellationHandler.IsCanceled. Returns TRUE in case, the current conversation has been cancelled and FALSE otherwise. • Register a notifier function by calling cancellationHandler.SetNotifier. The registered notifier is called if the current conversation is cancelled.
This StopOffer will disable the forwarding of request messages from DM.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 73588f5f0b57ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The method ara::diag::GenericRoutine::StopOffer disables the forwarding of incoming diagnostic requests from Diagnostic Management (DM) to the corresponding routine instance [SWS_DM_00558]. The function has the signature void StopOffer() noexcept;, takes no parameters, and returns no value [SWS_DM_00558]. The call is processed synchronously and signals to the DM that the routine will no longer accept requests from this point forward.
Error handling
The operation is specified as exception safe and declared with noexcept[SWS_DM_00558]. No error codes or C++ exceptions occur during execution. Specific notifications to development or diagnostic event managers (DET/DEM) are not provided for this interface in the diagnostic module.
Concurrency and Limitations
Regarding threading behavior, the method is designated as not thread-safe[SWS_DM_00558]. Concurrent calls on the same instance of ara::diag::GenericRoutine must therefore be synchronized by the application. Interpretation: A call would primarily take place when a routine is temporarily deactivated or the application is shut down in a controlled manner after an offering call has previously occurred. Question Q-e110ce01110699e3 (open)
Interaction
The naming conceptually follows the service offering of ara::com, but represents an independent implementation within ara::diag and must not be confused with communication offers (AUTOSAR_AP_SWS_Diagnostics §7.3.4.1.2 “Monitors”). The same offering pattern for disabling request forwarding is also used module-wide by further diagnostic classes such as ara::diag::GenericUDSService[SWS_DM_00620], ara::diag::GenericDataIdentifier[SWS_DM_00639], routine interfaces [SWS_DM_00595], and ara::diag::Monitor[SWS_DM_01089].
This text was created by an AI and is based exclusively on the specification documents of AUTOSAR R25-11.
gemini-3.8-flash-low· 2026-10-13 · German original