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_types.h
Go to the documentation of this file.
1
#ifndef RTE_EXAMPLE_GATEWAY_C_TYPES_H
2
#define RTE_EXAMPLE_GATEWAY_C_TYPES_H
3
4
5
#ifdef __cplusplus
6
extern
"C"
{
7
#endif
12
13
#include <stdbool.h>
14
#include <stdint.h>
15
16
#include "rte/redundancy/channel_service/rte_channel_service.h"
17
#include "rte/utils/status/rte_status.h"
18
#include "rte/oal/timer/rte_timer.h"
19
20
#include "
common/rbc_wire_types.h
"
21
#include "
common/site_config.h
"
22
#include "
gateway_c_config.h
"
23
25
typedef
enum
26
{
27
GATEWAY_C_PEER_A
= 0,
28
GATEWAY_C_PEER_B
= 1
29
}
gateway_c_peer_t
;
30
#define GATEWAY_C_PEER_COUNT 2
31
32
#define GATEWAY_C_DEDUP_WINDOW_SIZE 32U
33
#define GATEWAY_C_DEDUP_EXPIRY_MS 450U
40
#define GATEWAY_C_DEDUP_SAF_EXPIRY_MS 3000U
41
42
typedef
struct
43
{
44
uint64_t
hash
;
45
rte_timestamp_ms_t
timestamp_ms
;
46
}
gateway_c_dedup_entry_t
;
47
48
typedef
struct
49
{
50
gateway_c_dedup_entry_t
entries
[
GATEWAY_C_DEDUP_WINDOW_SIZE
];
51
uint32_t
head
;
52
}
gateway_c_dedup_t
;
53
57
typedef
struct
gateway_c_context_s
58
{
59
rte_example_site_t
site
;
60
gateway_c_config_t
config
;
61
62
volatile
bool
stop_requested
;
63
64
rte_timer_storage_t
cycle_timer_storage
;
65
rte_timer_handle_t
cycle_timer_handle
;
66
volatile
uint32_t
cycle_ticks
;
67
68
uint32_t
cycle
;
69
}
gateway_c_context_t
;
70
72
void
gateway_c_sleep_ms
(
unsigned
int
ms);
73
74
#ifdef __cplusplus
75
}
/* extern "C" */
76
#endif
77
78
#endif
/* RTE_EXAMPLE_GATEWAY_C_TYPES_H */
gateway_c_config.h
Configuration data structures and parser for Role C Gateway (JSON-based).
GATEWAY_C_DEDUP_WINDOW_SIZE
#define GATEWAY_C_DEDUP_WINDOW_SIZE
Definition
gateway_c_types.h:32
gateway_c_sleep_ms
void gateway_c_sleep_ms(unsigned int ms)
Definition
gateway_c_util.c:11
gateway_c_peer_t
gateway_c_peer_t
Definition
gateway_c_types.h:26
GATEWAY_C_PEER_A
@ GATEWAY_C_PEER_A
Definition
gateway_c_types.h:27
GATEWAY_C_PEER_B
@ GATEWAY_C_PEER_B
Definition
gateway_c_types.h:28
rbc_wire_types.h
The RBC Train/IL/CTC scenario's shared wire envelope (ADR-029) - one fixed-size struct/frame reused f...
site_config.h
West/East site identity and the per-site config derived from it (ports, container host lookup) - see ...
rte_example_site_t
rte_example_site_t
Definition
site_config.h:20
gateway_c_config_t
Definition
gateway_c_config.h:47
gateway_c_context_t
One gateway_c_context_t instance's state.
Definition
gateway_c_types.h:58
gateway_c_context_t::cycle
uint32_t cycle
Definition
gateway_c_types.h:68
gateway_c_context_t::stop_requested
volatile bool stop_requested
Definition
gateway_c_types.h:62
gateway_c_context_t::site
rte_example_site_t site
Definition
gateway_c_types.h:59
gateway_c_context_t::config
gateway_c_config_t config
Definition
gateway_c_types.h:60
gateway_c_context_t::cycle_timer_storage
rte_timer_storage_t cycle_timer_storage
Definition
gateway_c_types.h:64
gateway_c_context_t::cycle_timer_handle
rte_timer_handle_t cycle_timer_handle
Definition
gateway_c_types.h:65
gateway_c_context_t::cycle_ticks
volatile uint32_t cycle_ticks
Definition
gateway_c_types.h:66
gateway_c_dedup_entry_t
Definition
gateway_c_types.h:43
gateway_c_dedup_entry_t::hash
uint64_t hash
Definition
gateway_c_types.h:44
gateway_c_dedup_entry_t::timestamp_ms
rte_timestamp_ms_t timestamp_ms
Definition
gateway_c_types.h:45
gateway_c_dedup_t
Definition
gateway_c_types.h:49
gateway_c_dedup_t::head
uint32_t head
Definition
gateway_c_types.h:51
gateway_c_dedup_t::entries
gateway_c_dedup_entry_t entries[GATEWAY_C_DEDUP_WINDOW_SIZE]
Definition
gateway_c_types.h:50
src
application
C
gateway_c_types.h
Generated by
1.18.0