Provides standardized interfaces for synchronized time bases, high-precision timestamps, and status monitoring.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: aa3b87a713ceProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Provides standardized interfaces for synchronized time bases, high-precision timestamps, and status monitoring.
The namespace ara::tsync provides interfaces for synchronized time access on the Adaptive Platform by connecting applications to configured time bases via SynchronizedTimeBaseConsumer. Time acquisition is performed using high-precision timestamps of type Timestamp based on a nanosecond resolution [SWS_TS_01251]. Applications monitor synchronicity via status indicators such as SynchronizationStatus[SWS_TS_01050]. As an essential constraint, the asynchronous notification callbacks are not designed to be thread-safe, and connection losses to the time daemon must be handled.
Context
Within the AUTOSAR Adaptive Platform, the namespace ara::tsync provides the interfaces for high-precision time synchronization. It enables applications to read synchronized time points, monitor the synchronization state, and log measured values for validation purposes. The central role for consuming applications is assumed by class SynchronizedTimeBaseConsumer, which encapsulates access to a time base configured via a InstanceSpecifier. On the provider side, SynchronizedTimeBaseProvider serves as the access point for providing and controlling time bases.
The basis of the temporal representation is the pseudo-clock TimeBase, via which the type alias Timestamp is defined as std::chrono::time_point<TimeBase, std::chrono::nanoseconds>[SWS_TS_01251]. The actual synchronization work and connection to bus protocols such as IEEE 802.1AS or PTP typically occurs via a background service. Interpretation: This time daemon communicates cross-process with the instances of ara::tsync, which is evidenced by the specific error TsyncErrc::kDaemonConnectionLost[SWS_TS_00901]. Question Q-dd9d1a36f7573a03 (open) The architecture is complemented by interfaces such as ConsumerTimeBaseValidationNotification and ProviderTimeBaseValidationNotification as well as data structures for runtime and precision measurements (e.g., TimeMasterMeasurementType, TimeSlaveMeasurementType, PdelayInitiatorMeasurementType, and PdelayResponderMeasurementType).
Context diagram: Interaction between applications, interface classes, and time daemon in namespace ara::tsync. Sources: [SWS_TS_00901], [SWS_TS_01251].
Lifecycle
The lifecycle of a synchronized time base is determined by state structures and discrete status transitions. A snapshot of the temporal state including all metadata is represented by SynchronizedTimeBaseStatus. The communication and synchronization state is controlled via the enumeration SynchronizationStatus[SWS_TS_01050]:
kNotSynchronizedUntilStartup: Initial state before the first successful synchronization after system start.
kSynchronized: The time base is synchronous with the time master.
kSynchToGateway: Synchronization is performed via a gateway.
kTimeOut: No synchronization could be established or maintained within a defined time window.
In addition to the communication status, the enumeration LeapJump[SWS_TS_01051] records abrupt corrections of the time base: kTimeLeapNone signals continuous running without threshold violation, while kTimeLeapFuture and kTimeLeapPast indicate significant corrections into the future and past, respectively.
Regarding concurrency, it should be noted that callback types such as SynchronizationNotifier[SWS_TS_14222], SynchronizedTimeBaseNotifier[SWS_TS_14221], and TimePrecisionNotifier[SWS_TS_14223] are classified as not thread-safe according to the specification. State transitions, in particular the occurrence of timeouts or re-synchronizations, therefore require application-side synchronization.
State diagram: Lifecycle and communication states of a synchronized time base. Sources: [SWS_TS_01050].
Usage Path
The typical sequence for using a synchronized time base by a consumer application is divided into the following steps:
Initialization and binding: The application instantiates SynchronizedTimeBaseConsumer for the desired time base, specifying the appropriate InstanceSpecifier.
Registration of notifications: To monitor the synchronization state, the application passes callback functions. These include SynchronizationNotifier[SWS_TS_14222] for changes to SynchronizationStatus, SynchronizedTimeBaseNotifier[SWS_TS_14221] for detailed status snapshots (SynchronizedTimeBaseStatus), and TimePrecisionNotifier[SWS_TS_14223] for precision measurement data (TimePrecisionMeasurement).
Timestamp querying: If the state is kSynchronized or kSynchToGateway[SWS_TS_01050], the application reads high-precision time values of type Timestamp[SWS_TS_01251].
Reaction to status and time steps: If notifications signal a LeapJump not equal to kTimeLeapNone[SWS_TS_01051] or a transition to kTimeOut[SWS_TS_01050], the application adjusts internal timers or transitions into a degraded mode.
Transmission of user data: If user-specific payload data is transmitted as part of the time synchronization, the structure UserData is used.
Error Scenarios
Error handling of the namespace follows the AUTOSAR standard model via the error domain TsyncErrorDomain. Access to this global domain is provided via GetTsyncErrorDomain()[SWS_TS_00909]. Error causes are described by the enumeration type TsyncErrc[SWS_TS_00901]:
kDaemonConnectionLost: The requested operation fails because the connection to the time sync daemon is interrupted.
kLimitsExceeded: A passed or calculated value is outside the permitted value range.
kFunctionNotSupported: The requested function is not supported in the current configuration or platform environment.
kInvalidUserDataSize: The length of the passed user data exceeds the maximum currently defined by UserData::kMaxUserDataSize of 3 bytes.
Instances of ara::core::ErrorCode are created via the helper function MakeErrorCode[SWS_TS_00910]. The function is declared as noexcept and is thread-safe. For exception-based architectures, the namespace provides the exception class TsyncException.
This guide is based on the AUTOSAR Adaptive Platform R25-11 specification for the tsync module.
KI-gestützte Gruppierung auf Basis der Records und Spezifikationsauszüge; keine Gliederung aus der AUTOSAR-Spezifikation.
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.
=0 The TB is not synchronized until startup (inital state)
kTimeOut
= 0x1 The TB was not synchronized within a certain time frame.
kSynchronized
= 0x2 The TB is in sync with the time master.
kSynchToGateway
= 0x3 The TB is in sync with the gateway.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 2b617e90b13fProvenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The enumeration SynchronizationStatus expresses the communication and synchronization status of a time base in namespace ara::tsync[SWS_TS_01050]. The type is based on std::uint32_t and is provided via the header file ara/tsync/synchronized_time_base_status.h as well as the forwarding header ara/tsync/tsync_fwd.h[SWS_TS_01050]. The enumeration defines four states:
kNotSynchronizedUntilStartup (= 0): The time base is not synchronized prior to system startup (initial state) [SWS_TS_01050].
kTimeOut (= 0x1): The time base was not synchronized within a specified time window [SWS_TS_01050].
kSynchronized (= 0x2): The time base is synchronous with the Time Master [SWS_TS_01050].
kSynchToGateway (= 0x3): The time base is synchronous with the gateway [SWS_TS_01050].
The synchronous retrieval of the status is performed via the method GetSynchronizationStatus() of class ara::tsync::SynchronizedTimeBaseStatus, which provides the state at the time of creation of the status object in a thread-safe and exception-safe manner (noexcept) [SWS_TS_01053]. For notifications upon status changes, the type alias SynchronizationNotifier (std::function<void(const SynchronizationStatus &)>) exists in ara/tsync/synchronized_time_base_consumer.h, which is explicitly specified as not thread-safe [SWS_TS_14222].
In case of an error or in the absence of synchronization, the behavior of associated methods must be considered: If the time base has never been synchronized and exhibits the status kNotSynchronizedUntilStartup, the method GetCreationTime() returns an empty ara::core::Optional, since no valid creation timestamp exists in synchronized time [SWS_TS_01055].
This text was generated by an AI system and relies exclusively on the specification data from AUTOSAR R25-11.
Implementer's Guide to follow (complexity I1)
Request a governed re-review of this record. The record is not changed immediately.
=1 The action cannot be executed, because the connection to time sync daemon is currently lost.
kLimitsExceeded
=2 The value exceeds valid value range
kFunctionNotSupported
=3 The requested function is not supported
kInvalidUserDataSize
=4 The length of the user data exceeded the maximum allowed size, defined by UserData::kMaxUserDataSize (currently 3 bytes).
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: bf6ea0154525ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The enumeration TsyncErrc defines the standardized error codes of the Time Synchronization functional cluster [SWS_TS_00901]. It is based on ara::core::ErrorDomain::CodeType and is declared within the namespace ara::tsync; an alias is also available via ara::tsync::TsyncErrorDomain::Errc[SWS_TS_01266]. The thread-safe function MakeErrorCode, which combines a TsyncErrc value with vendor-specific additional data into a ara::core::ErrorCode, is used to create complete error objects [SWS_TS_00910].
The specification defines four concrete error values [SWS_TS_00901]:
kDaemonConnectionLost (=1): The action cannot be performed because the connection to the Time-Sync Daemon is interrupted.
kLimitsExceeded (=2): A passed parameter exceeds the permitted value range. This occurs, for example, in SetRateCorrection if the requested rate correction is invalid [SWS_TS_01110].
kFunctionNotSupported (=3): The requested function is not supported. Interpretation: This is likely to affect implementations where optional hardware or interface functions are not available. Question Q-e22067d84fd6adb4 (open)
kInvalidUserDataSize (=4): The length of the payload exceeds the maximum size of 3 bytes specified by UserData::kMaxUserDataSize. This error occurs with SetTime[SWS_TS_01107] as well as SetUserData[SWS_TS_01112].
Methods for updating time and data such as SetTime, UpdateTime, SetRateCorrection, and SetUserData of class ara::tsync::SynchronizedTimeBaseProvider return results synchronously via ara::core::Result<void> and are specified as non-threadsafe [SWS_TS_01107][SWS_TS_01108][SWS_TS_01110][SWS_TS_01112]. In case of an error, according to the specification, no rollback semantics apply (no_rollback_semantics) [SWS_TS_01107][SWS_TS_01110][SWS_TS_01112].
This text was created by an AI and is based on the R25-11 specification status.
Implementer's Guide to follow (complexity I1)
Request a governed re-review of this record. The record is not changed immediately.
Returns a reference to the global TsyncErrorDomain object.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 3848538f31e7ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The synchronous function GetTsyncErrorDomain belongs to the namespace ara::tsync and is included via the header file ara/tsync/tsync_error_domain.h[SWS_TS_00909]. The call takes no parameters and serves the purpose of retrieving a reference to the global TsyncErrorDomain object of the time synchronization [SWS_TS_00909].
As a return value, the function provides a constant reference to this global error domain object of type const ara::core::ErrorDomain &[SWS_TS_00909]. Interpretation: In the error handling concept of AUTOSAR Adaptive, the provided instance likely serves as a reference point for identifying, assigning, or comparing module-specific error codes from the time synchronization domain with other error domains. Question Q-cf1fce412576bca3 (open)
Error Handling and Exception Safety
The function signature is explicitly declared as noexcept and specified as exception-safe (exception safe) [SWS_TS_00909]. This means that no exceptions can be thrown during execution. Since the function merely returns the reference to the already existing global domain object, no internal error states occur, and neither specific error codes nor error messages exist for the call [SWS_TS_00909].
Concurrency and Limitations
According to the specification, GetTsyncErrorDomain is classified as thread-safe (thread-safe) [SWS_TS_00909]. Calls can therefore be performed concurrently from different threads without prior synchronization or locking mechanisms. According to the specification, no special ordering conditions or preconditions exist for the call [SWS_TS_00909].
This text was generated by an AI and is based on AUTOSAR specifications.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: ad8052caa2c8Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The function MakeErrorCode serves to synchronously create an ara::core::ErrorCode object for the time synchronization error domain in the namespace ara::tsync[SWS_TS_00910]. It is available via the header ara/tsync/tsync_error_domain.h and translates time synchronization error numbers into the standardized error handling model of AUTOSAR Adaptive.
Parameters and Return Value
code (ara::tsync::TsyncErrc): Designates the specific error number of the domain [SWS_TS_00910].
data (ara::core::ErrorDomain::SupportDataType): Passes vendor-specific additional data on the occurred error [SWS_TS_00910].
Return value: Returns an initialized ara::core::ErrorCode object [SWS_TS_00910].
Concurrency and Execution Safety
The function is declared with noexcept and classified as exception-safe [SWS_TS_00910]; it throws no exceptions at runtime. In addition, the implementation is specified as thread-safe[SWS_TS_00910], which is why it may be called in parallel from multiple threads without additional synchronization measures.
Interaction
In addition to this basic function, the related requirement [SWS_TS_14213] specifies an analogous overload for TsyncFvmErrc in namespace apext::tsync (header apext/tsync/fvm_error_domain.h), which is defined as constexpr.
This text was generated by an AI based on the AUTOSAR R25-11 specification.
gemini-3.8-flash-low· 2026-10-13 · German original