Provides applications with transport- and protocol-related metadata for an ongoing diagnostic request.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 4cec228b1decProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Provides applications with transport- and protocol-related metadata for an ongoing diagnostic request.
The class ara::diag::MetaInfo provides Adaptive Applications with relevant meta information such as source address, target address, and protocol context of an ongoing diagnostic request (AUTOSAR_AP_SWS_Diagnostics §7.3.1.1 “MetaInfo class”). Applications query these values synchronously via inspection methods during a callback invocation initiated by Diagnostic Management. The guaranteed lifetime of the object is strictly limited to the execution time of the active callback function, which is why storing it beyond this call leads to undefined behavior ([SWS_DM_01345]).
Context
The class ara::diag::MetaInfo provides a standardized mechanism to convey transport- and protocol-specific meta information from Diagnostic Management (DM) to interested Adaptive Applications (AUTOSAR_AP_SWS_Diagnostics §7.3.1.1 “MetaInfo class”). In the AUTOSAR Adaptive diagnostic architecture, the DM acts as an intermediary between external diagnostic clients and internal functional clusters or applications. When a diagnostic request arrives via a UDS transport protocol or SOVD, the DM extracts relevant protocol data and passes it on to the application's interfaces during method calls ([SWS_DM_02094]).
The core tasks of ara::diag::MetaInfo include providing the invocation context as well as specific key-value pairs. Via the interface, application services receive information about the source address (SA) of the diagnostic client using the key kSA ([SWS_DM_02094]), the target address (TA) of the diagnostic server via kTA ([SWS_DM_02095]), and the UDS addressing mode (physical or functional) via the key kTAType ([SWS_DM_02096]). The invocation context is typed via the type ara::diag::MetaInfo::Context ([SWS_DM_00977]). Possible contexts are regular diagnostic communication kDiagnosticCommunication ([SWS_DM_01342]), fault memory access kFaultMemory ([SWS_DM_01343]), DoIP initial queries such as reading the vehicle identification number kDoIP ([SWS_DM_01344]), and service requests in the SOVD context kSovd ([SWS_DM_01818]).
The creation and management of ara::diag::MetaInfo instances is entirely the responsibility of Diagnostic Management. The parameterless default constructor is explicitly deleted ([SWS_DM_00972]). Consequently, an application can neither instantiate its own instances directly nor duplicate them via copy operations, as both the copy constructor ([SWS_DM_00973]) and the copy assignment operator ([SWS_DM_00975]) are deleted. Instantiation is presumably performed internally by the DM before calling the application callbacks. Question Q-f695f92296527ce8 (open)ara::diag::MetaInfo supports move semantics: the move constructor ([SWS_DM_00974]) and the move assignment operator ([SWS_DM_00976]) are available. Destruction occurs via the standard destructor ([SWS_DM_00980]).
With regard to ownership and validity period, a strict binding to the active method call applies: for each method directed from the DM to the application with a MetaInfo object as a parameter, the guaranteed lifetime is strictly limited to the duration of this method call ([SWS_DM_01345], AUTOSAR_AP_SWS_Diagnostics §7.3.1.1.2 “Lifetime of MetaInfo”). After the function returns, continued use or storage of the object is inadmissible.
The typical usage path extends from the reception of a diagnostic call to the evaluation of the passed metadata:
Invocation by the DM: Diagnostic Management calls a callback method of the application, passing a reference to ara::diag::MetaInfo ([SWS_DM_01345]).
Determine context: The application calls GetContext() ([SWS_DM_00979]) to determine whether the call occurs, for example, in the context of regular diagnostic communication (kDiagnosticCommunication, [SWS_DM_01342]) or fault memory access (kFaultMemory, [SWS_DM_01343]).
Query key values: By means of GetValue() ([SWS_DM_00978]), the application specifically queries required attributes, such as the sender address with kSA ([SWS_DM_02094]), the target address with kTA ([SWS_DM_02095]), or the addressing mode with kTAType ([SWS_DM_02096]).
Process result:GetValue() returns a ara::core::Optional<ara::core::StringView> ([SWS_DM_00978]). If the value is present, the application evaluates the character string synchronously to perform access checks or addressing logic.
Completion of the call: The application completes processing and returns from the callback method, whereby the lifetime of the passed metadata ends ([SWS_DM_01345]).
When using ara::diag::MetaInfo, developers must observe specific preconditions and postconditions:
Storage beyond the callback duration: If an application stores the MetaInfo object or a ara::core::StringView returned by GetValue() beyond the execution time of the callback function, this leads to undefined behavior ([SWS_DM_01345], AUTOSAR_AP_SWS_Diagnostics §7.3.1.1.2 “Lifetime of MetaInfo”). Values that are required asynchronously or permanently must be persisted as separate string copies.
Querying non-existent keys: If a key is passed that is not provided in the current context, GetValue() does not throw an exception, but returns an empty ara::core::Optional ([SWS_DM_00978]). Both access methods are declared with noexcept and are exception-safe ([SWS_DM_00978], [SWS_DM_00979]).
gemini-3.8-flash-low· 2026-10-13 · German original