Represents the bit-coded status byte of a diagnostic event and provides type-safe check methods for status bits.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c0a8a1df20deProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Represents the bit-coded status byte of a diagnostic event and provides type-safe check methods for status bits.
The struct ara::diag::EventStatusByte encapsulates the bit-coded status byte of a single diagnostic event within the Adaptive Platform [SWS_DM_00644]. It provides methods for type-safe querying of set or unset status bits as well as compound check states [SWS_DM_01755]. Because the computation always reflects the specific event, it remains unaffected by higher-level DTC event combinations. As a lightweight value object, all read accesses are exception-safe and concurrently readable, whereas mutating assignments must be synchronized externally.
Context
The struct ara::diag::EventStatusByte encapsulates the bit-coded status byte of a diagnostic event in the fault memory of the AUTOSAR Adaptive Diagnostic Management [SWS_DM_00644]. According to the specification, the EventStatusByte always precisely represents the state of the assigned individual event and is not influenced by any event combination (Event Combination) during computation (AUTOSAR_AP_SWS_Diagnostics p. 234). Primary interaction partners include the Diagnostic Management Core (DM), which determines the UDS DTC status upon event status updates [SWS_DM_01109] and informs via configured callbacks [SWS_DM_01110]. Interpretation: Via the type alias ara::diag::EventStatusByteNotifier[SWS_DM_02118], this status change is likely reported to registered application functions so that they can react to state changes. Question Q-8fd114acd74569ee (open)
Lifecycle
Instances of ara::diag::EventStatusByte are lightweight value objects defined in header ara/diag/event_types.h[SWS_DM_01753]. Creation takes place either by copying, moving, or via a variadic template constructor that accepts an arbitrary set of EventStatusBits to be set [SWS_DM_01753]. Because constructors and assignment operators are declared as constexpr and noexcept, objects can already be constructed at compile time (AUTOSAR_AP_SWS_Diagnostics §8.47.2.1.1 “Special Member Functions”).
Regarding ownership and lifetime, the object is typically passed by value (by-value) or constant reference to notifiers. The move constructor [SWS_DM_01751] and the copy constructor [SWS_DM_01752] guarantee exception safety and thread safety. In contrast, the copy assignment operator [SWS_DM_01750] and the move assignment operator [SWS_DM_01749] are explicitly classified as not thread-safe (not thread-safe) in the specification. Multiple concurrent read accesses to an existing status byte are thread-safely possible; mutating assignments to a shared instance, however, require external synchronization.
Usage Path
A typical use case consists of checking a status byte transmitted by Diagnostic Management for specific diagnostic criteria. For this purpose, the class provides specialized evaluation methods:
Checking for fault test: With IsFailedAndTested(), it can be checked directly whether both the bit kTestFailed and kTestFailedThisOperationCycle are set [SWS_DM_01757]. Interpretation: This signals to the application that the event has already been tested in the current operation cycle and assessed as defective. Question (open)
Checking for fault-free test: The method IsPassedAndTested() returns true provided that neither kTestFailed nor kTestNotCompletedThisOperationCycle are set [SWS_DM_01756].
Generic bit checks: Via the template IsSet(bits...), it can be verified whether all passed status bits are set [SWS_DM_01755]. Complementary to this, IsNotSet(bits...) checks whether none of the passed bits are active [SWS_DM_01754].
When resetting faults through a clearDTC operation, Diagnostic Management cleanses all referenced events regardless of whether event combinations are configured [SWS_DM_01108]. The following sequence diagram illustrates the interaction during a status update and subsequent evaluation in the application.
Because ara::diag::EventStatusByte is an elementary data container, all member functions are specified as noexcept and fully exception-safe ([SWS_DM_01749] to [SWS_DM_01757]). Neither are C++ exceptions thrown nor are error codes returned in the form of ara::core::Result.
Error situations in the application thus do not arise from API error codes, but rather from semantic misinterpretations or synchronization errors. Typical risks are concurrent write accesses via assignment operators without mutex protection ([SWS_DM_01749], [SWS_DM_01750]) or an erroneous assumption that the EventStatusByte is modified by combined DTCs, even though according to the specification it remains strictly bound to the single event (AUTOSAR_AP_SWS_Diagnostics p. 234).
This guide is based on the specification AUTOSAR Adaptive R25-11 and summarizes the properties of the class according to the document AUTOSAR_AP_SWS_Diagnostics.
gemini-3.8-flash-low· 2026-10-13 · German original