DEENESPTFRRUARHIKOZHNL

namespace ara::sm

User GuideAI-GENERATED

Provides error domain and error codes for controlling system states and suspend-to-RAM sequences.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 83e4718c6e9f Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Provides error domain and error codes for controlling system states and suspend-to-RAM sequences.

Namespace ara::sm provides domain-specific error handling and coordination structures for State Management in AUTOSAR Adaptive (AUTOSAR_AP_SWS_StateManagement §7.5 p. 34). Via SmErrc, SmErrorDomain, and MakeErrorCode, it defines standardized mechanisms for detecting communication errors, timeouts, and rejections during synchronized state transitions such as Suspend-to-RAM ([SWS_SM_81240], [SWS_SM_81244]). An essential constraint is the mutual exclusivity between automated state machine control and direct API access to coordination instances ([SWS_SM_00684]).

Context

Namespace ara::sm forms the fundamental interface for state management (State Management) of the AUTOSAR Adaptive Platform and provides types for error handling and for controlling machine-wide state configurations. In addition to the central error domain SmErrorDomain and the associated exception type SmException, the module includes functional mechanisms for synchronizing system states, in particular within the scope of the Suspend-to-RAM functionality according to AUTOSAR_AP_SWS_StateManagement §7.5 “Interaction with Suspend-to-RAM Functionality” p. 34. Key interaction partners include control applications such as the SMControlApplication, the internal StateMachine controller of the State Management daemon, and processes connected via satellites (AUTOSAR_AP_SWS_StateManagement §7.5.1 “S2R Hub” p. 35).

The architecture strictly separates declarative state machines from programmatic control: if the system follows the StateMachine approach, the control entity integrates the coordination internally, so that external applications are denied direct access to the C++ API of S2RHub ([SWS_SM_00684]; AUTOSAR_AP_SWS_StateManagement §7.7.15 p. 96). Safety- and security-relevant interactions are also subject to Identity and Access Management (IAM) checks to ensure that only authorized processes are permitted to perform registrations or request state changes ([SWS_SM_00706], [SWS_SM_00714], [SWS_SM_00715]).

G app SMControlApplication or StateMachine hub S2RHub / State Management Daemon app->hub S2RHub-Steuerung [SWS_SM_00684] errdomain SmErrorDomain (ara::sm) app->errdomain Error check [SWS_SM_81251] satellite S2RSatellite (Prozesskontext) hub->satellite Suspend-Trigger [SWS_SM_00701] hub->errdomain Fehlercode erzeugen [SWS_SM_81240] satellite->hub Offer / Status [SWS_SM_00710]

Context diagram: Distribution of roles and interaction paths between control application, State Management daemon, satellites, and error domain. Sources: [SWS_SM_00684], [SWS_SM_00701], [SWS_SM_00710], [SWS_SM_81240], [SWS_SM_81251].

Usage Path

Typical usage of the namespace is structured into registering application-side processes, triggering coordinated transitions, and evaluating resulting error codes. For processes that possess suspend-to-RAM capabilities, the cycle begins with providing their interface via Offer ([SWS_SM_00710]). Prior to the transition of the operating system into the sleep state, the controlling entity sends a request to all registered satellites by means of RequestToEnterSuspendMode, whereupon their callback EnterSuspendMode is triggered ([SWS_SM_00701], [SWS_SM_00711]).

The coordinating function blocks or monitors the transition until all involved satellites have responded or have been deregistered ([SWS_SM_00702]). Upon wake-up, the call to RequestToLeaveSuspendMode takes place analogously, which restores normal operation via LeaveSuspendMode ([SWS_SM_00703], [SWS_SM_00711]). If aborts occur during communication or state changes, the module resorts to the free function MakeErrorCode ([SWS_SM_81244]) to create specific ara::core::ErrorCode instances based on the enumeration SmErrc and provide them to the calling application.

Suspend-to-RAM coordination sequence and error handlingSMControlApplicationS2RHubS2RSatelliteSmErrorDomainUse Case: Suspend-AnforderungRequestToEnterSuspendMode()EnterSuspendMode() CallbackaltSatelliten quittieren erfolgreichAcknowledgment without errorSuccess return (result positive)At least one satellite rejectsFeedback kRejectedMakeErrorCode(SmErrc::kAtLeastOneRejected)ara::core::ErrorCodeFehlercode kAtLeastOneRejected

Sequence diagram: Typical sequence of suspend coordination with satellites and error handling. Sources: [SWS_SM_00701], [SWS_SM_00702], [SWS_SM_00707], [SWS_SM_81240], [SWS_SM_81244].

Error Scenarios

Error handling in ara::sm is strictly typed and based on the enumeration SmErrc ([SWS_SM_81240]). The defined error codes include:

  • kOfferFailed: The service could not be offered because communication with the State Management daemon failed ([SWS_SM_81240]).
  • kCommunicationFailed: Error on the lower transport layers during communication with satellites ([SWS_SM_81240]).
  • kCommunicationTimeout: An addressed satellite exceeded the specified response time ([SWS_SM_81240], [SWS_SM_00707]).
  • kAtLeastOneRejected: At least one satellite could not enter the suspend state properly ([SWS_SM_81240]).
  • kAtLeastOneHadIssuesToLeave: At least one satellite reported kRejected when leaving suspend mode ([SWS_SM_81240], [SWS_SM_00707]).
  • kAuthenticationRequired: IAM authentication is enforced and requires an explicit identity check of the satellite ([SWS_SM_81240], [SWS_SM_00716]).

Providing the global error domain via GetSmDomain ([SWS_SM_81251]) and creating error codes via MakeErrorCode ([SWS_SM_81244]) are declared as noexcept and guarantee exception safety as well as thread safety. Interpretation: Throwing an SmException is likely used primarily when callers wish to convert error codes of SmErrorDomain into exception-based control flows, whereas functional interfaces regularly return ara::core::ErrorCode in case of an error. Question Q-5afcc13f11bdf19b (open)

This guide is based on the AUTOSAR Adaptive R25-11 specification.

Topic map

Types and constants

1

Class diagram

Abgerundete Rahmen = Namespace- bzw. Klassen-Scopes; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = namespace-fremde bzw. externe Basisklassen. Klicken öffnet die jeweilige Klassen- bzw. cppreference-Seite.

G cluster_ns ara::sm nara__sm__SmErrorDomain SmErrorDomain next_ara__core__ErrorDomain ara::core::ErrorDomain nara__sm__SmErrorDomain->next_ara__core__ErrorDomain nara__sm__SmException SmException next_ara__core__Exception ara::core::Exception nara__sm__SmException->next_ara__core__Exception

Detail view

Select an entry in the outline.

Classes

Defines the error domain for State Management.

inherits from ara::core::ErrorDomain

Exception type thrown by State Management.

inherits from ara::core::Exception

Functions

GetSmDomain function

Returns the global SmErrorDomain object.

constexpr const ara::core::ErrorDomain & GetSmDomain () noexcept;
MakeErrorCode function

Creates an error code.

constexpr ara::core::ErrorCode MakeErrorCode (SmErrc code, ara::core::ErrorDomain::SupportDataType data) noexcept;

Types and constants

SmErrc enumeration

Defines an enumeration class for the State Management error codes.

enum class SmErrc : ara::core::ErrorDomain::CodeType {...};

Enumerations

enumeration SmErrc [SWS_SM_81240] Upstream: RS_AP_00119

enum class SmErrc :          ara::core::ErrorDomain::CodeType {...};

Defines an enumeration class for the State Management error codes.

Header-Datei#include "ara/sm/sm_error_domain.h"
Forwarding-Header#include "ara/sm/sm_fwd.h"
Scopenamespace ara::sm
SymbolSmErrc
Basistypara::core::ErrorDomain::CodeType

Werte

EnumeratorBeschreibung
kOfferFailed=2 Service could not be offered due to failure of communication with Sm daemon
kCommunicationFailed=3 Communication to satellites failed on lower layers.
kCommunicationTimeout=4 Timeout of communication with satellites.
kAtLeastOneRejected=5 At least one Satellite instance had issues to enter Suspend Mode.
kAtLeastOneHadIssuesToLeave=6 At least one Satellite instance had issues to leave Suspend Mode.
kRejected=7 Issue to enter or leave the Suspend Mode.
kAuthenticationRequired=8 S2R Satellite requires IAM authentication. ara::sm::s2r:: S2RSatellite::S2RSatellite has to be used instead.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_SM_81240
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81240@rel:R25-11#5d63dfbc
Content hash
5d63dfbc
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81240
Status: valid/unmigrated Version: rel:R25-11#5d63dfbc Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_SM_81240@rel:R25-11#5d63dfbc
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

Documentation of free functions

function GetSmDomain [SWS_SM_81251] Upstream: RS_AP_00119, RS_AP_00159

constexpr const ara::core::ErrorDomain & GetSmDomain () noexcept;

Returns the global SmErrorDomain object.

Header-Datei#include "ara/sm/sm_error_domain.h"
Scopenamespace ara::sm
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
const ara::core::ErrorDomain &The global SmErrorDomain object.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_SM_81251
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81251@rel:R25-11#e09ae583
Content hash
e09ae583
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81251
Status: valid/unmigrated Version: rel:R25-11#e09ae583 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_SM_81251@rel:R25-11#e09ae583
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function MakeErrorCode [SWS_SM_81244] Upstream: RS_AP_00119, RS_AP_00159

constexpr ara::core::ErrorCode MakeErrorCode (SmErrc code, ara::core::ErrorDomain::SupportDataType data) noexcept;

Creates an error code.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9557f5fb3cd6 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The helper function MakeErrorCode serves, according to [SWS_SM_81244] in namespace ara::sm, to create an ara::core::ErrorCode object for State Management. The function is declared in the header file #include "ara/sm/sm_error_domain.h" and has the documentation status DRAFT (AUTOSAR_AP_SWS_StateManagement §8.1.2.1.2 “MakeErrorCode”).

For creation, the synchronous function accepts two input parameters:

  • code: the specific error code of type SmErrc as error number.
  • data: vendor-specific additional data (type ara::core::ErrorDomain::SupportDataType) associated with the error.

As return value, the function returns a complete ara::core::ErrorCode object ([SWS_SM_81244]). Being marked as constexpr allows evaluation already at compile time, and the keyword noexcept guarantees that no exceptions are raised during execution.

With regard to concurrency and reliability, the function is specified as thread-safe and exception safe ([SWS_SM_81244]). It can therefore be used without additional synchronization from arbitrary concurrent call contexts.

This text was generated by an AI and serves as guidance based on the specification.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/sm/sm_error_domain.h"
Scopenamespace ara::sm
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
codeError code number.
dataVendor defined data associated with the error.

Rückgabewert

TypBeschreibung
ara::core::ErrorCodeAn ErrorCode object.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_SM_81244
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_81244@rel:R25-11#7c0ada43
Content hash
7c0ada43
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_81244
Status: valid/unmigrated Version: rel:R25-11#7c0ada43 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_SM_81244@rel:R25-11#7c0ada43
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill