time_daemon Documentation#
This documentation describes the time_daemon and the score::time module.
Overview#
time_daemon is a non-AUTOSAR adaptive process designed to provide synchronized vehicle time to client applications. It supports multiple time bases including in-vehicle synchronized time (PTP - Precision Time Protocol) and external synchronized time (absolute time base). The daemon retrieves time information from the respective time sources, verifies and validates the timepoints, and distributes this time information across multiple clients through efficient IPC mechanisms.
The main responsibilities of time_daemon include:
Providing current Vehicle time to different applications
Setting synchronization qualifiers (e.g., Synchronized, Timeout, etc.)
Providing diagnostic information for system monitoring
Supporting additional verification mechanisms such as QualifiedVehicleTime (QVT) for safety-critical applications
For a detailed concept and architectural design, please refer to the time_daemon Concept Documentation.
Project Layout#
This module follows the Eclipse SCORE component structure:
score/time_daemon/src/: Time daemon process sources
score/time_slave/src/: Time slave process sources
score/time/: Client-facing time base libraries
score/ts_client/: Time synchronization client library
examples/: Usage examples
docs/features/: Feature-level documentation
.github/workflows/: CI/CD pipelines
Quick Start#
To build the module:
bazel build //score/...
To run tests:
bazel test //score/...
To build the documentation:
bazel build //:docs
Dependency lock file
After modifying MODULE.bazel (adding or bumping a dependency), update the lock file:
bazel mod tidy
Commit both MODULE.bazel and MODULE.bazel.lock together. The
Process / Bzlmod Lock Check CI job enforces this — see
eclipse-score/score#2628.
Formatting
Check formatting for all files (Python, Starlark, YAML, C++):
bazel test //:format.check
Auto-fix formatting for all files:
bazel run //:format.fix
Static Code Analysis
Run clang-tidy (powered by score_cpp_policies):
bazel test --config=clang-tidy //score/...
Sanitizers
Run address, undefined-behaviour and leak sanitizers (powered by score_cpp_policies):
bazel test --config=asan_ubsan_lsan --config=time-x86_64-linux //score/...
Individual sanitizer aliases are also available: --config=asan, --config=ubsan, --config=lsan.
Configuration#
The project_config.bzl file defines metadata used by Bazel macros.
Example:
PROJECT_CONFIG = {
"asil_level": "QM",
"source_code": ["cpp", "rust"]
}
This enables conditional behavior (e.g., choosing clang-tidy for C++ or clippy for Rust).