Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Toggle main menu visibility
Loading...
Searching...
No Matches
sapi_clocksync.h
Go to the documentation of this file.
1
43
44
#ifndef SAPI_CLOCKSYNC_H
45
#define SAPI_CLOCKSYNC_H
46
47
#include <stdint.h>
48
49
#include "
safeapi/utils/status/sapi_status.h
"
50
#include "
safeapi/utils/types/sapi_types.h
"
51
52
#ifdef __cplusplus
53
extern
"C"
{
54
#endif
55
59
typedef
enum
60
{
64
SAPI_CLOCKSYNC_UNSYNCHRONIZED
= 0,
67
SAPI_CLOCKSYNC_DEGRADED
= 1,
70
SAPI_CLOCKSYNC_SYNCHRONIZED
= 2
71
}
sapi_clocksync_quality_t
;
72
73
/*
74
* The backend vtable (sapi_clocksync_backend_t) and
75
* sapi_clocksync_register_backend() live in
76
* safeapi_backend/clocksync/sapi_clocksync_backend.h, not here (ADR-021).
77
* This header is the consumer-facing surface only.
78
*/
79
91
sapi_status_t
sapi_clocksync_get_offset_ms
(int64_t *out_offset_ms);
92
101
sapi_status_t
sapi_clocksync_get_quality
(
sapi_clocksync_quality_t
*out_quality);
102
103
#ifdef __cplusplus
104
}
105
#endif
106
108
109
#endif
/* SAPI_CLOCKSYNC_H */
sapi_clocksync_quality_t
sapi_clocksync_quality_t
Coarse quality/confidence of the current clock synchronization.
Definition
sapi_clocksync.h:60
sapi_clocksync_get_offset_ms
sapi_status_t sapi_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...
Definition
sapi_clocksync.c:48
sapi_clocksync_get_quality
sapi_status_t sapi_clocksync_get_quality(sapi_clocksync_quality_t *out_quality)
Reports the backend's current confidence in the clock offset.
Definition
sapi_clocksync.c:72
SAPI_CLOCKSYNC_SYNCHRONIZED
@ SAPI_CLOCKSYNC_SYNCHRONIZED
Definition
sapi_clocksync.h:70
SAPI_CLOCKSYNC_UNSYNCHRONIZED
@ SAPI_CLOCKSYNC_UNSYNCHRONIZED
Definition
sapi_clocksync.h:64
SAPI_CLOCKSYNC_DEGRADED
@ SAPI_CLOCKSYNC_DEGRADED
Definition
sapi_clocksync.h:67
sapi_status_t
sapi_status_t
Common result/status codes.
Definition
sapi_status.h:27
sapi_status.h
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
sapi_types.h
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
include
safeapi
oal
clocksync
sapi_clocksync.h
Generated by
1.18.0