RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Loading...
Searching...
No Matches
ab_gp_startup_timestamp.h
Go to the documentation of this file.
1
14#ifndef AB_GP_STARTUP_TIMESTAMP_H
15#define AB_GP_STARTUP_TIMESTAMP_H
16
17#include <stdbool.h>
18#include <stddef.h>
19#include <stdint.h>
20
21#include "rte/utils/types/rte_types.h"
22
24#define AB_GP_STARTUP_TS_FRESH_MS 3000U
25
27#define AB_GP_STARTUP_TS_WAIT_MS 3000U
28
30#define AB_GP_STARTUP_TS_READ_SLICE_MS 20U
31
35#define AB_GP_STARTUP_TS_MAX_SLICES ((AB_GP_STARTUP_TS_WAIT_MS / AB_GP_STARTUP_TS_READ_SLICE_MS) + 1U)
36
38#define AB_GP_STARTUP_TS_PAYLOAD_SIZE 9U
39
48rte_timestamp_ms_t ab_gp_startup_timestamp_agree(rte_timestamp_ms_t own_now_ms, rte_timestamp_ms_t sibling_ts_ms,
49 bool have_sibling);
50
57void ab_gp_startup_timestamp_encode(uint8_t *buf, bool is_reply, rte_timestamp_ms_t ts_ms);
58
68bool ab_gp_startup_timestamp_decode(const uint8_t *buf, size_t size, bool *is_reply, rte_timestamp_ms_t *ts_ms);
69
70#endif /* AB_GP_STARTUP_TIMESTAMP_H */
rte_timestamp_ms_t ab_gp_startup_timestamp_agree(rte_timestamp_ms_t own_now_ms, rte_timestamp_ms_t sibling_ts_ms, bool have_sibling)
The site startup timestamp this channel uses given its own clock and the sibling's value.
bool ab_gp_startup_timestamp_decode(const uint8_t *buf, size_t size, bool *is_reply, rte_timestamp_ms_t *ts_ms)
Decodes a STARTUP_TS payload.
void ab_gp_startup_timestamp_encode(uint8_t *buf, bool is_reply, rte_timestamp_ms_t ts_ms)
Encodes a STARTUP_TS payload.