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
rte_clocksync.c
Go to the documentation of this file.
1
9
11
13
19
21
23
24
27{
29
30 if (osadapter == NULL)
31 {
33 }
34 else
35 {
36 /* REQ-LIFECYCLE-001 (ADR-026): registering an OSAdapter is a setup-only
37 * action - refuse once the application's setup phase has been locked. */
39 if (status == RTE_STATUS_OK)
40 {
41 s_osadapter = osadapter;
42 }
43 }
44
45 return status;
46}
47
49{
51
52 if (out_offset_ms == NULL)
53 {
55 }
56 else if (s_osadapter == NULL)
57 {
59 }
60 else if (s_osadapter->get_offset_ms == NULL)
61 {
63 }
64 else
65 {
66 status = s_osadapter->get_offset_ms(out_offset_ms);
67 }
68
69 return status;
70}
71
73{
75
76 if (out_quality == NULL)
77 {
79 }
80 else if (s_osadapter == NULL)
81 {
83 }
84 else if (s_osadapter->get_quality == NULL)
85 {
87 }
88 else
89 {
90 status = s_osadapter->get_quality(out_quality);
91 }
92
93 return status;
94}
rte_clocksync_quality_t
Coarse quality/confidence of the current clock synchronization.
rte_status_t rte_clocksync_get_quality(rte_clocksync_quality_t *out_quality)
Reports the OSAdapter's current confidence in the clock offset.
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...
rte_status_t rte_lifecycle_check_setup_allowed(void)
Convenience check for a setup-only constructor: call this as one of the first checks in any function ...
rte_status_t
Common result/status codes.
Definition rte_status.h:27
@ RTE_STATUS_OK
Definition rte_status.h:28
@ RTE_STATUS_INVALID_PARAM
Definition rte_status.h:29
@ RTE_STATUS_NOT_SUPPORTED
Definition rte_status.h:34
@ RTE_STATUS_NOT_INITIALIZED
Definition rte_status.h:30
static const rte_osadapter_clocksync_t * s_osadapter
Pluggable wall-clock synchronization OSAdapter (ADR-017).
Process-wide application setup-phase lock (ADR-026).
OSAdapter interface for clock synchronization.
rte_status_t rte_osadapter_clocksync_register(const rte_osadapter_clocksync_t *adapter)
Registers the OSAdapter clock synchronization implementation.
OSAdapter clock synchronization operations vtable.