DEENESPTFRRUARHIKOZHNL

class apext::sm::PowerStateInterface

[SWS_SM_71000] Upstream: RS_SM_00402

class PowerStateInterface {...};

class for power state coordination with OS

Header-Datei#include "apext/sm/power_state_interface.h"
Forwarding-Header#include "apext/sm/sm_fwd.h"
Scopenamespace apext::sm

User GuideAI-GENERATED

Coordinates power states with the operating system and informs State Management about wakeup events.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 142a6058cb95 Provenance Open questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Coordinates power states with the operating system and informs State Management about wakeup events.

As an OS wrapper, the interface coordinates power states between State Management and the operating system ([SWS_SM_71000]). Via it, State Management registers callback handlers for wakeup events in advance and forwards specific state requests to the operating system ([SWS_SM_71001]). After reactivation has occurred, the handler registration in the OS wrapper can be canceled. An essential functional constraint is that all method calls are not thread-safe and therefore must strictly be serialized by the caller.

Context

C++ class apext::sm::PowerStateInterface acts as the functional interface of the State Management module for coordinating power states with the operating system ([SWS_SM_71000], SWS StateManagement §C.1.2 “Class: PowerStateInterface”). In the system architecture, it takes on the role of an OS wrapper that forwards requests from State Management to the underlying operating system and receives feedback. Three core components are involved in the overall interaction: State Management as the coordinating instance, class PowerStateInterface as the mediator, and the host operating system, which executes the hardware-related power management ([SWS_SM_71001]).

sm State Management (SM) psi PowerStateInterface (OS-Wrapper) sm->psi Zustandsanforderung & Handler-Registrierung psi->sm WakeUpHandler-Aufruf os Betriebssystem (OS) psi->os Energiezustands- weiterleitung os->psi Aufwachsignal

Context diagram: Coordination of power states and wakeup signals between State Management, OS wrapper, and operating system. Sources: [SWS_SM_71000], [SWS_SM_71001], [SWS_SM_71003].

Lifecycle

The creation and destruction of instances of class PowerStateInterface is not governed via explicit factory methods in the specification documents. According to the interpretation, instantiation is likely performed by State Management during its initialization phase to provide the OS wrapper. Question Q-15bde6ce044e9bc3 (open) Header apext/sm/power_state_interface.h is intended for including the class ([SWS_SM_71001], SWS StateManagement §C.1.2.1.1 “Member Functions”).

With regard to internal state, the object manages the registration of a handler for wakeup events. This state remains active until the handler is explicitly removed again ([SWS_SM_71005]). Regarding concurrency, all member functions are classified as not thread-safe (not-threadsafe) ([SWS_SM_71001], [SWS_SM_71003], [SWS_SM_71005]). The calling State Management must therefore ensure under its own responsibility that calls to an instance are strictly serialized and that no unprotected parallel accesses occur from multiple threads.

Usage Path

A typical usage path for controlling power states and receiving wakeup signals proceeds in several coordinated steps:

  • Handler registration: Prior to initiating a power-saving state, State Management registers a callback function of type apext::sm::WakeUpHandler in the OS wrapper by means of RegisterWakeUpHandler ([SWS_SM_71003], SWS StateManagement §C.1.2.1.1.1 “RegisterWakeUpHandler”). This defines how State Management is informed about subsequent wakeup processes.
  • State request: Subsequently, State Management calls method SetPowerState with the desired target state apext::sm::PowerState ([SWS_SM_71001], SWS StateManagement §C.1.2.1.1.2 “SetPowerState”). The interface forwards this request directly to the operating system. The technical implementation of the transition presumably takes place in a platform-specific manner in the operating system. Question Q-29345b74ba3bedf2 (open)
  • Wakeup notification: If the operating system detects a wakeup event, the notification is reported to the OS wrapper. The wrapper executes the previously registered WakeUpHandler. According to the interpretation, the invocation is likely to occur asynchronously in the execution context of the reactivation process. Question (open)
  • Handler deregistration: As soon as the wakeup process is completed or State Management requires no further notifications, the registered callback is removed from the OS wrapper via UnregisterWakeUpHandler ([SWS_SM_71005], SWS StateManagement §C.1.2.1.1.3 “UnregisterWakeUpHandler”).
Coordination of power states and wake-up signalsState Management (SM)PowerStateInterfaceBetriebssystem (OS)RegisterWakeUpHandler(handler)SetPowerState(state)Energiezustand weiterleitenUse Case: AufwachvorgangAufwachereignishandler()Use Case: BereinigungUnregisterWakeUpHandler()

Sequence diagram: Typical sequence of handler registration, state forwarding to the operating system, and deregistration. Sources: [SWS_SM_71001], [SWS_SM_71003], [SWS_SM_71005].

Error Scenarios

The interface methods RegisterWakeUpHandler, SetPowerState, and UnregisterWakeUpHandler have the return type void and do not define specific error return codes ([SWS_SM_71001], [SWS_SM_71003], [SWS_SM_71005]). All functions are declared as noexcept and guarantee full exception safety (exception safe).

Erroneous system states can arise primarily from violations of preconditions. These include violation of the required thread safety through unprotected parallel method calls. Furthermore, as a precondition for RegisterWakeUpHandler, State Management must ensure that the passed function object is valid and remains in memory until removal by UnregisterWakeUpHandler ([SWS_SM_71003], [SWS_SM_71005]).

This guide is based exclusively on the specification requirements of AUTOSAR Adaptive Platform Release R25-11.

Member map

Class diagram

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G napext__sm__PowerStateInterface528 PowerStateInterface + RegisterWakeUpHandler() + SetPowerState() + UnregisterWakeUpHandler()

Detail view

Select an entry in the outline.

Methods

Register wake-up handler function in the OS-Wrapper to inform SM about wake-up.

void RegisterWakeUpHandler (apext::sm::WakeUpHandler handler) noexcept; DIRECTION NOT handler -- DEFINED
SetPowerState function

Forward the power state request to OS.

void SetPowerState (apext::sm::PowerState state) noexcept; DIRECTION NOT state -- DEFINED

Unregister wake-up handler in OS-Wrapper.

void UnregisterWakeUpHandler () noexcept;

Method documentation

function RegisterWakeUpHandler [SWS_SM_71003] Upstream: RS_SM_00402

void RegisterWakeUpHandler (apext::sm::WakeUpHandler handler) noexcept; DIRECTION NOT           handler                    -- DEFINED

Register wake-up handler function in the OS-Wrapper to inform SM about wake-up.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 55d0e17f0920 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function RegisterWakeUpHandler of class apext::sm::PowerStateInterface serves to register a callback function of type apext::sm::WakeUpHandler in the OS wrapper to notify State Management (SM) about wake-up events [SWS_SM_71003]. The interface is defined in header #include "apext/sm/power_state_interface.h" and addresses the high-level requirement [RS_SM_00402] AUTOSAR_AP_SWS_StateManagement §C.1.2.1.1.1 “RegisterWakeUpHandler”.

Usage and Call Context

The declaration is void RegisterWakeUpHandler (apext::sm::WakeUpHandler handler) noexcept [SWS_SM_71003]. The call is performed synchronously for passing the function pointer or callback via the parameter handler. Since the function has no return value (void), it does not provide status feedback on the completion of the registration [SWS_SM_71003].

Error Handling and Exception Safety

The interface is specified as exception safe (exception safe) and annotated with noexcept [SWS_SM_71003]. Callers therefore do not need to catch C++ exceptions. Specific error codes, return values for error indication, or notifications to diagnostic or error managers are not defined for this API [SWS_SM_71003].

Concurrency and Limitations

  • Thread safety: The function is explicitly classified as not thread-safe (not-threadsafe) [SWS_SM_71003]. Calling instances must ensure that calls do not occur unprotected from competing threads. Interpretation: The registration should expediently take place once during the sequential initialization phase of the OS wrapper before wake-up events occur. Question Q-268ab61374f98e7a (open)
  • Development status: The function definition has the status DRAFT AUTOSAR_AP_SWS_StateManagement §C.1.2.1.1.1 “RegisterWakeUpHandler” in Release R25-11, which is why modifications in future specification versions are possible.

This usage note was generated automatically based on the AUTOSAR specification for R25-11.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "apext/sm/power_state_interface.h"
Scopeclass apext::sm::PowerStateInterface
Exception-Sicherheitexception safe
Thread-Sicherheitnot-threadsafe

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_SM_71003
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_71003@rel:R25-11#bc05c3e2
Content hash
bc05c3e2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_71003
Status: valid/unmigrated Version: rel:R25-11#bc05c3e2 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_71003@rel:R25-11#bc05c3e2
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 SetPowerState [SWS_SM_71001] Upstream: RS_SM_00402

void SetPowerState (apext::sm::PowerState state) noexcept; DIRECTION NOT           state                      -- DEFINED

Forward the power state request to OS.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 527ed282abbf Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The member function SetPowerState of class apext::sm::PowerStateInterface serves to forward a request to change the system power state to the operating system [SWS_SM_71001]. It implements the high-level requirement [RS_SM_00402] and is provided via the header apext/sm/power_state_interface.h (SWS StateManagement §C.1.2.1.1.2 “SetPowerState”).

The following framework conditions apply to the usage and integration into the call context:

  • Parameters and return value: The function takes the target state state of type apext::sm::PowerState by value. There is no return value (void) [SWS_SM_71001].
  • Exception safety and error handling: The operation is declared as noexcept and is considered exception safe (exception safe) [SWS_SM_71001]. Since no specific error codes or exceptions are provided, the request processing in the operating system is likely performed asynchronously. Question Q-03a3ae7693c3cfee (open)
  • Concurrency: The function interface is classified as not thread-safe (not-threadsafe) [SWS_SM_71001]. Concurrent calls on the same instance must be guarded by the caller using external synchronization measures.
  • Specification status: The interface is marked with the status DRAFT (SWS StateManagement §C.1.2.1.1.2 “SetPowerState”), which is why future modifications to the signature or behavior are possible.

This usage note was created automatically and is based on the specification AUTOSAR Adaptive Platform Release R25-11.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "apext/sm/power_state_interface.h"
Scopeclass apext::sm::PowerStateInterface
Exception-Sicherheitexception safe
Thread-Sicherheitnot-threadsafe

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_SM_71001
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_71001@rel:R25-11#be2610a0
Content hash
be2610a0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_71001
Status: valid/unmigrated Version: rel:R25-11#be2610a0 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_71001@rel:R25-11#be2610a0
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 UnregisterWakeUpHandler [SWS_SM_71005] Upstream: RS_SM_00402

void UnregisterWakeUpHandler () noexcept;

Unregister wake-up handler in OS-Wrapper.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: da45ea3a78d7 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Call Context

The function UnregisterWakeUpHandler belongs to the scope of class apext::sm::PowerStateInterface and is provided via the header file #include "apext/sm/power_state_interface.h" [SWS_SM_71005]. Its purpose is to deregister a previously established wake-up handler in the OS wrapper [SWS_SM_71005]. The call is synchronous, requires no input parameters, and has no return value (void) [SWS_SM_71005].

Error handling

The operation is declared with the identifier noexcept and specified as exception safe (exception safe) [SWS_SM_71005]. Specific error codes, DEM, or DET entries are not defined. Interpretation: In the absence of a return type or error indicators, the function is unlikely to report any internal errors in the OS wrapper directly to the caller. Question Q-0d692808f97a0fb5 (open)

Concurrency and Constraints

With respect to the execution environment, UnregisterWakeUpHandler is explicitly classified as not thread-safe (not-threadsafe) [SWS_SM_71005]. Simultaneous calls from multiple threads must not take place unprotected and must be synchronized on the application side.

Interaction and Specification Status

The function serves to fulfill the high-level requirement RS_SM_00402 AUTOSAR_AP_SWS_StateManagement §C.1.2.1.1.3 “UnregisterWakeUpHandler”. During integration, it must be taken into account that the interface definition in the present specification still has the status DRAFT AUTOSAR_AP_SWS_StateManagement §C.1.2.1.1.3 “UnregisterWakeUpHandler”.

This usage note was automatically generated based on AUTOSAR R25-11.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "apext/sm/power_state_interface.h"
Scopeclass apext::sm::PowerStateInterface
Exception-Sicherheitexception safe
Thread-Sicherheitnot-threadsafe

Rückgabewert

TypBeschreibung
None

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

Record
AUTOSAR/AP/record/SWS_SM_71005
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_71005@rel:R25-11#ef4ae762
Content hash
ef4ae762
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_71005
Status: valid/unmigrated Version: rel:R25-11#ef4ae762 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_71005@rel:R25-11#ef4ae762
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