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
Clock Synchronization (diagnostic/timeout-sizing only)

Files

file  src/oal/clocksync/rte_clocksync.c
 Implementation of the pluggable clock-sync OSAdapter (ADR-017).

Enumerations

enum  rte_clocksync_quality_t { RTE_CLOCKSYNC_UNSYNCHRONIZED = 0 , RTE_CLOCKSYNC_DEGRADED = 1 , RTE_CLOCKSYNC_SYNCHRONIZED = 2 }
 Coarse quality/confidence of the current clock synchronization. More...

Functions

rte_status_t rte_clocksync_get_offset_ms (int64_t *out_offset_ms)
 Reports this node's estimated clock offset (diagnostic/timeout- sizing only - see the file-level note; never use this to decide whether channel results are comparable).
rte_status_t rte_clocksync_get_quality (rte_clocksync_quality_t *out_quality)
 Reports the OSAdapter's current confidence in the clock offset.

Detailed Description

REQ-CLOCKSYNC-001: rte_clocksync_get_offset_ms() and rte_clocksync_get_quality() shall return RTE_STATUS_NOT_INITIALIZED if no OSAdapter has been registered. REQ-CLOCKSYNC-002: this module shall never be called from, or influence the outcome of, rte_channel_checkpoint() or any other vital comparison - see the file-level note above.

Enumeration Type Documentation

◆ rte_clocksync_quality_t

Coarse quality/confidence of the current clock synchronization.

Enumerator
RTE_CLOCKSYNC_UNSYNCHRONIZED 

No synchronization has ever been established (e.g. just booted, or the sync source is unreachable). Reported offset, if any, must not be trusted.

RTE_CLOCKSYNC_DEGRADED 

Synchronized in the past but the OSAdapter judges the estimate stale/degraded (e.g. sync source lost, drift accumulating).

RTE_CLOCKSYNC_SYNCHRONIZED 

Currently synchronized within the OSAdapter's normal operating bound.

Definition at line 59 of file rte_clocksync.h.

Function Documentation

◆ rte_clocksync_get_offset_ms()

rte_status_t rte_clocksync_get_offset_ms ( int64_t * out_offset_ms)

Reports this node's estimated clock offset (diagnostic/timeout- sizing only - see the file-level note; never use this to decide whether channel results are comparable).

Parameters
out_offset_msMilliseconds, positive if local clock is ahead of the OSAdapter's reference. Must not be NULL.
Returns
RTE_STATUS_OK; RTE_STATUS_INVALID_PARAM if out_offset_ms is NULL; RTE_STATUS_NOT_INITIALIZED if no OSAdapter is registered (REQ-CLOCKSYNC-001); RTE_STATUS_NOT_SUPPORTED if the registered OSAdapter's get_offset_ms slot is NULL.

Definition at line 48 of file rte_clocksync.c.

◆ rte_clocksync_get_quality()

rte_status_t rte_clocksync_get_quality ( rte_clocksync_quality_t * out_quality)

Reports the OSAdapter's current confidence in the clock offset.

Parameters
out_qualityMust not be NULL.
Returns
RTE_STATUS_OK; RTE_STATUS_INVALID_PARAM if out_quality is NULL; RTE_STATUS_NOT_INITIALIZED if no OSAdapter is registered (REQ-CLOCKSYNC-001); RTE_STATUS_NOT_SUPPORTED if the registered OSAdapter's get_quality slot is NULL.

Definition at line 72 of file rte_clocksync.c.