Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
Platform_RTE

Product: Platform_RTE, the Safe Computing Platform core / RTE of the RBC_Template workspace (repository Platform_RTE). C99, MISRA C:2012, EN 50128 SIL 4 target. Layer: RTE. Assessment unit: Platform core (part of the RTE composition, see ../../docs/safety/CERTIFICATION_PLAN.dox).

Responsibility

Platform_RTE is the only layer through which safety applications reach the OS, the network and each other. It owns:

  • Execution: the cyclic application manager (init, execute, shutdown, optional pre/post hooks and a built-in checkpoint stage) and the setup-phase lock.
  • Redundancy: N-way voting, 2-way cross-comparison, checkpoint rendezvous, the site-role service (ONLINE/STANDBY negotiation between two sites, partner supervision, takeover token check, A/B role agreement, warm-standby sync; ADR-040) over the dual-instance negotiator, state transfer on promotion, redundancy configuration.
  • Safe state: the single place where a transition to SAFE or REBOOT happens. Applications only register a cleanup handler.
  • Communication seam: named channels and Flows over pluggable OSAdapters, checksums and the vital-message envelope.
  • OS abstraction (OAL): timer, NVM, memory, task, mutex, IPC, log, reboot, netlink, platform and clock sync, each reached through an OSAdapter registered at startup (ADR-005), plus the optional FSOU output-permission seam (ADR-041, proposed; no caller yet).
  • Common utilities: status codes, fixed-width types, checked casts, bounded strings, buffer views.

It does not implement any operating-system OSAdapter (Platform_OS_POSIX), any transport protocol (Platform_Protocol_*), any railway logic (RBC_*), or any ERTMS message handling.

Interfaces exposed to other products

Interface Header directory Consumed by Notes
PI-API (rte_flow_*) include/rte/oal/flow/ RBC_GP, RBC_GA Name-addressed publish/subscribe endpoint shaped after OCORA's flows.h; the intended public API of the platform
Application manager include/rte/app/appmanager/ RBC_GP, RBC_GA Lifecycle, stages, cycle hooks, checkpoint result hook
Safe state include/rte/utils/safestate/ all RTE_ASSERT, RTE_SAFESTATE, RTE_REBOOT, cleanup handler registration
Redundancy services include/rte/redundancy/{Voter (N-way channel voting),Cross-Comparator (2-way channel comparison),checkpoint,Channel Link (single redundant link),dual,site_role,safechannel,checksum,watchdog}/ RBC_GP Used directly today; narrowing to the PI-API is tracked in the root TODO.dox
Channel service include/rte/redundancy/channel_service/ RBC_GP, gateways Named channel setup, read, send, close; includes the Flow-backed variant
Redundancy configuration include/rte/redundancy/config/ integrator Loads a JSON file (topology, replicas, quorum, standby_mode, roles, channel definitions) and calls the application's registered capability callback
State registration include/rte/redundancy/state_transfer/ integrator Application lists the fields that must survive a promotion
OSAdapter seams include/rte/oal/<service>/*_osadapter.h, oal/flow, oal/protocol Platform_OS_POSIX, Platform_Protocol_DDS One vtable per OAL service, rte_osadapter_flow_t, rte_protocol_adapter_ops_t
Utilities include/rte/utils/ all Status, types, cast, buffer, string
Build artifacts dist/<platform>/, CMake package RteFramework, Conan rteframework/0.1.0 all C products Targets rte::core, ::oal, ::channels, ::appmanager

Every public function has a Doxygen block with pre-conditions, post-conditions and requirement IDs. See docs/DOCUMENTATION_INDEX.dox for the per-module guides.

Interfaces required

Only the C standard library and, at run time, one registered OSAdapter per OAL service used. A build that links no OSAdapter cannot run the services; Platform_OS_POSIX is the reference OSAdapter.

Build and verify

cmake --preset debug && cmake --build --preset debug && ctest --preset debug
cmake --preset ci # warnings as errors
cmake --preset asan | ubsan | coverage # sanitizers and coverage
cmake --build build --target cppcheck # MISRA C:2012 analysis (or ./scripts/run-cppcheck.sh)
cmake --install build --prefix . # produces dist/<platform>/ for consumers

Cross-compilation targets and toolchain files: docs/CROSS_COMPILATION.dox and platform/toolchains/. Coding rules: CLAUDE.md. Conformance evidence: docs/MISRA_COMPLIANCE_REPORT.dox, docs/COVERAGE_REPORT.dox, docs/EN_50128_ALIGNMENT.dox, docs/SAFETY_APPLICATION_CONDITIONS.dox.

Layout

include/rte/<area>/<feature>/ public header per feature (ADR-007)
src/<feature>/ implementation, built into 4 library targets (ADR-023)
tests/<feature>/ one CTest file per feature
docs/ guides, ADRs, requirements (SRS), safety, templates
examples/ standalone example programs

Where to read next