RTE RBC 2oo2 Reference Application
0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Toggle main menu visibility
Loading...
Searching...
No Matches
gateway_c_train_handler.h
Go to the documentation of this file.
1
#ifndef RTE_EXAMPLE_GATEWAY_C_TRAIN_HANDLER_H
2
#define RTE_EXAMPLE_GATEWAY_C_TRAIN_HANDLER_H
3
13
14
#include "
gateway_c_types.h
"
15
16
typedef
struct
17
{
18
/* --- TrainSim-facing (one multiplexed channel) --- */
19
rte_channel_service_t
sim_channel
;
20
21
/* --- A/B-facing (one dedicated relay channel per peer) --- */
22
rte_channel_service_t
relay_channel
[
GATEWAY_C_PEER_COUNT
];
23
uint8_t
relay_consecutive_timeout
;
24
rte_timestamp_ms_t
relay_down_since_ms
[
GATEWAY_C_PEER_COUNT
];
25
rte_timestamp_ms_t
send_down_since_ms
[
GATEWAY_C_PEER_COUNT
];
26
uint32_t
a_seen_this_cycle
;
27
unsigned
int
a_stale_cycles
;
28
const
char
*
last_known_tag
;
29
gateway_c_dedup_t
dedup
;
30
}
gateway_c_train_handler_state_t
;
31
32
rte_status_t
gateway_c_train_handler_init
(
gateway_c_context_t
*ctx);
33
void
gateway_c_train_handler_execute
(
gateway_c_context_t
*ctx, uint32_t cycle);
34
void
gateway_c_train_handler_shutdown
(
void
);
35
bool
gateway_c_train_handler_check_link_down
(rte_timestamp_ms_t threshold_ms, rte_timestamp_ms_t now_ms,
36
char
*out_which,
size_t
which_size);
37
38
#endif
/* RTE_EXAMPLE_GATEWAY_C_TRAIN_HANDLER_H */
gateway_c_train_handler_shutdown
void gateway_c_train_handler_shutdown(void)
Definition
gateway_c_train_handler.c:250
gateway_c_train_handler_check_link_down
bool gateway_c_train_handler_check_link_down(rte_timestamp_ms_t threshold_ms, rte_timestamp_ms_t now_ms, char *out_which, size_t which_size)
Definition
gateway_c_train_handler.c:257
gateway_c_train_handler_init
rte_status_t gateway_c_train_handler_init(gateway_c_context_t *ctx)
Definition
gateway_c_train_handler.c:24
gateway_c_train_handler_execute
void gateway_c_train_handler_execute(gateway_c_context_t *ctx, uint32_t cycle)
Definition
gateway_c_train_handler.c:122
gateway_c_types.h
Shared wire-format constants and gateway_c_context_t.
GATEWAY_C_PEER_COUNT
#define GATEWAY_C_PEER_COUNT
Definition
gateway_c_types.h:30
gateway_c_context_t
One gateway_c_context_t instance's state.
Definition
gateway_c_types.h:58
gateway_c_dedup_t
Definition
gateway_c_types.h:49
gateway_c_train_handler_state_t
Definition
gateway_c_train_handler.h:17
gateway_c_train_handler_state_t::a_stale_cycles
unsigned int a_stale_cycles
Definition
gateway_c_train_handler.h:27
gateway_c_train_handler_state_t::a_seen_this_cycle
uint32_t a_seen_this_cycle
Definition
gateway_c_train_handler.h:26
gateway_c_train_handler_state_t::relay_channel
rte_channel_service_t relay_channel[GATEWAY_C_PEER_COUNT]
Definition
gateway_c_train_handler.h:22
gateway_c_train_handler_state_t::last_known_tag
const char * last_known_tag
Definition
gateway_c_train_handler.h:28
gateway_c_train_handler_state_t::sim_channel
rte_channel_service_t sim_channel
Definition
gateway_c_train_handler.h:19
gateway_c_train_handler_state_t::relay_down_since_ms
rte_timestamp_ms_t relay_down_since_ms[GATEWAY_C_PEER_COUNT]
Definition
gateway_c_train_handler.h:24
gateway_c_train_handler_state_t::relay_consecutive_timeout
uint8_t relay_consecutive_timeout
Definition
gateway_c_train_handler.h:23
gateway_c_train_handler_state_t::dedup
gateway_c_dedup_t dedup
Definition
gateway_c_train_handler.h:29
gateway_c_train_handler_state_t::send_down_since_ms
rte_timestamp_ms_t send_down_since_ms[GATEWAY_C_PEER_COUNT]
Definition
gateway_c_train_handler.h:25
src
application
C
gateway_c_train_handler.h
Generated by
1.18.0