Coordinates Suspend-to-RAM notifications for satellites and initiates the sleep state of the operating system.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c63fb68c31f7ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Coordinates Suspend-to-RAM notifications for satellites and initiates the sleep state of the operating system.
In State Management, class ara::sm::s2r::S2RHub coordinates entering and leaving the Suspend-to-RAM state for registered satellite applications (AUTOSAR_AP_EXP_SWArchitecture §9.2.2.1.4 “Interfaces for Suspend-to-Ram Notifications”). It allows a control application to request satellite preparation prior to putting the operating system into sleep mode and to return them to normal operation after wake-up ([SWS_SM_00701], [SWS_SM_81112]). Use of the C++ API strictly precludes the internal StateMachine approach and requires verified IAM permissions ([SWS_SM_00684], [SWS_SM_00706]).
An instance of ara::sm::s2r::S2RHub is created explicitly via a ara::core::InstanceSpecifier ([SWS_SM_81103]). Mandatory IAM authorization checking occurs during construction, where the calling process context is validated against the model mapping (SuspendToRamHubMapping.process) ([SWS_SM_00706], [SWS_SM_00714]). Copy operations are completely prohibited for the class ([SWS_SM_81107], [SWS_SM_81109]). However, the class supports move semantics via move constructor and move assignment operator ([SWS_SM_81106], [SWS_SM_81108]).
Regarding concurrency, the parameterized constructor and the move operations are specified as thread-safe ([SWS_SM_81103], [SWS_SM_81106], [SWS_SM_81108]). By contrast, the virtual destructor ~S2RHub() and the operational methods for suspend coordination are not thread-safe ([SWS_SM_81105], [SWS_SM_81110], [SWS_SM_81111], [SWS_SM_81112]). Callers must therefore ensure that destruction and execution of transitions occur sequentially and without concurrent calls.
Usage Path
The regular sequence for initiating and terminating Suspend-to-RAM is divided into three consecutive phases:
Preparation of the suspend state: Prior to suspending the operating system, function groups with non-supporting processes must be shut down (AUTOSAR_AP_SWS_StateManagement §7.5). Subsequently, the control application calls RequestToEnterSuspendMode() on the hub ([SWS_SM_81110]). The hub notifies all satellites registered via Offer through EnterSuspendMode ([SWS_SM_00701], [SWS_SM_00710], [SWS_SM_00711]). The method returns a ara::core::Future<void> that completes only once all addressed satellites have responded, unregistered, or timed out ([SWS_SM_00702], [SWS_SM_81110]).
Triggering the system suspend: After successful feedback from all satellites, the caller triggers the operating system via the synchronous function EnterSuspendToRamOs() to put the machine into Suspend-to-RAM mode ([SWS_SM_81112]).
Resumption after wake-up: As soon as the operating system wakes up again, the control application initiates the resumption of regular operation via RequestToLeaveSuspendMode() ([SWS_SM_81111]). The hub requests all active satellites via their callback function to exit suspend mode ([SWS_SM_00703], [SWS_SM_00711]). The returned future resolves positively if all satellites acknowledge positively or unregister via StopOffer ([SWS_SM_00707], [SWS_SM_81111]).
Depending on the phase, error conditions are signaled in S2RHub via architectural violations or via error codes in the ara::core::Future:
Construction errors and violations: If authorization checking of the calling process fails, violation InsufficientPermissionsViolation and security event SEV_ACCESS_CONTROL_SM_IAM_ACCESS_DENIED are triggered ([SWS_SM_00706], [SWS_SM_81103]). Other defined violations include InstanceSpecifierMappingIntegrityViolation (invalidity of the model specifier), PortInterfaceMappingViolation (incompatible interface type), ProcessMappingViolation (missing process mapping), InstanceSpecifierAlreadyInUseViolation (multiple use in the same process), and AraNotInitializedViolation (missing initialization of the Adaptive Platform) ([SWS_SM_81103]).
Errors when entering the suspend state: If lower-layer communication fails, the future of RequestToEnterSuspendMode() fails with SmErrc::kCommunicationFailed ([SWS_SM_81110]). If at least one satellite does not respond within the configurable time window (default: 1000 ms), this results in SmErrc::kCommunicationTimeout ([SWS_SM_81110]). Both errors have rollback semantics. If at least one satellite reports rejection of the transition, the future returns error SmErrc::kAtLeastOneRejected without rollback semantics ([SWS_SM_81110]).
Errors when leaving the suspend state: Analogously, communication issues or timeouts during RequestToLeaveSuspendMode() lead to SmErrc::kCommunicationFailed or SmErrc::kCommunicationTimeout, respectively ([SWS_SM_00707], [SWS_SM_81111]). If a satellite responds with kRejected, the future reports error code SmErrc::kAtLeastOneHadIssuesToLeave ([SWS_SM_00707], [SWS_SM_81111]).
Rejected satellite registration: Registration attempts by satellites are rejected by the hub if their process context does not match the model configuration ([SWS_SM_00715]).
This guide is based on the specifications of AUTOSAR Adaptive Platform Release R25-11 and summarizes the requirements for the S2RHub class.
The method has the signature void EnterSuspendToRamOs() noexcept;, takes no parameters, and returns no value ([SWS_SM_81112]). It is typically not called directly by user applications, but executed by State Management as soon as a corresponding action element EnterSuspendToRamOs is triggered within a ActionList ([SWS_SM_00692]). A prerequisite for this is a previously created instance of ara::sm::s2r::S2RHub ([SWS_SM_00690]).
With regard to concurrency and constraints, the following applies:
Thread safety: The function is explicitly classified as not thread-safe (not-threadsafe) ([SWS_SM_81112]). Concurrent calls on the same instance must be avoided.
Error handling: The operation is specified as noexcept and exception safe ([SWS_SM_81112]); no error codes are returned and no exceptions are thrown.
Ordering and execution context: Within ActionLists, action elements are started sequentially in the configured order ([SWS_SM_00609]). Prior to OS suspension via EnterSuspendToRamOs, upstream actions (such as EnterSuspendToRam) transition the S2R-capable applications into standby mode (AUTOSAR_AP_SWS_StateManagement §7.7 “Trigger EnterSuspendState”). Multiple occurrences of EnterSuspendToRamOs within the same suspend state of a controller are not intended, as repetition provides no functional benefit and can lead to conflicts (AUTOSAR_AP_SWS_StateManagement §7.7 “Trigger EnterSuspendState”).
This text was created by an AI and is based exclusively on the specifications of Release R25-11.
Function to Request all S2R Satellite to enter suspend state.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 90177316c9e3Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The function RequestToEnterSuspendMode of class ara::sm::s2r::S2RHub requests all actively registered satellites to transition to suspend mode [SWS_SM_81110]. The execution is typically triggered in State Management by an EnterSuspendToRam ActionListItem, where configuration maxActionItemDuration is passed as value for parameter timeout[SWS_SM_00689].
Usage and semantics: After the call, the hub sends a message to all registered S2R Satellite instances, which triggers their callback ara::sm::s2r::S2RSatellite::EnterSuspendMode[SWS_SM_00701]. The function accepts the integer parameter timeout in milliseconds (default value: 1000 ms) and returns a ara::core::Future<void>[SWS_SM_81110]. The operation returns as soon as all addressed satellites have replied, are deregistered, or a timeout has occurred [SWS_SM_00702]. A deregistration via StopOffer is considered a successful response [SWS_SM_00702].
Error handling: The overall result is positive if all satellites agree or deregister [SWS_SM_00702]. If communication on lower layers fails, error SmErrc::kCommunicationFailed is returned with rollback semantics [SWS_SM_00702][SWS_SM_81110]. If at least one satellite does not reply in time, this results in error SmErrc::kCommunicationTimeout with rollback semantics [SWS_SM_00702][SWS_SM_81110]. If a satellite responds with kRejected, the function returns SmErrc::kAtLeastOneRejected without rollback semantics [SWS_SM_00702][SWS_SM_81110].
Concurrency: The method is declared as noexcept and exception safe, but not thread-safe (not-threadsafe) [SWS_SM_81110].
This usage note was generated automatically based on the AUTOSAR R25-11 specification.
ara::core::Future< void > RequestToLeaveSuspendMode (int timeout=1000) noexcept; DIRECTION NOT timeout -- DEFINED
Function to request all registered S2R Satellite to leave suspend state.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 374258ce3ad7Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method RequestToLeaveSuspendMode of class ara::sm::s2r::S2RHub coordinates the waking of applications after a suspend-to-RAM state. According to [SWS_SM_00703], the function sends a message to all actively registered instances of S2R Satellite to call LeaveSuspendMode there. In State Management, the call is executed automatically when the ActionListItem LeaveSuspendToRam is triggered ([SWS_SM_00691]).
Via parameter timeout (default value 1000), the monitoring duration for the feedback from the satellites is defined ([SWS_SM_81111]). The function returns a ara::core::Future<void>, which is ready as soon as all addressed satellites have replied, were deregistered, or timed out ([SWS_SM_00707]). The overall result is considered successful if all satellites confirm positively or deregister regularly via StopOffer.
Error handling
If an error occurs during execution, the future provides corresponding error codes from SmErrc ([SWS_SM_81111]):
SmErrc::kCommunicationTimeout: At least one satellite did not reply in time within the timeout ([SWS_SM_00707]).
SmErrc::kCommunicationFailed: An internal transmission error on lower communication layers has occurred ([SWS_SM_00707]).
SmErrc::kAtLeastOneHadIssuesToLeave: At least one satellite answered the request negatively with kRejected ([SWS_SM_00707]).
Concurrency and Limitations
The interface is specified as noexcept (exception safe), but classified as not-threadsafe ([SWS_SM_81111]). According to design constraint [SWS_SM_CONSTR_00035], the triggering ActionListItem LeaveSuspendToRam must not be assigned to suspend states, but is exclusively intended for controller states that control exiting the suspend-to-RAM mode (SWS StateManagement §7.7 “ActionListItem”).
This usage note was generated automatically based on the specification of AUTOSAR R25-11.
InsufficientPer- Sent in case the caller had insufficient permissions for the missionsViolation requested operation. 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- The type of mapping does not match the expected type of Port pingViolation Interface: {portInterfaceTypeName} referenced by a {mappingType Name}. 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. AraNotInitialized- Violation message that is sent in case a constructor or function Violation checks for an initialized ara and identifies that ara is not initialized.
Parameter (in)
Parameter
Beschreibung
instance
instance specifier to the PPortPrototype of a SM...
Request a governed re-review of this record. The record is not changed immediately.
gemini-3.8-flash-low· 2026-10-13 · German original