SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
Toggle main menu visibility
Loading...
Searching...
No Matches
ab_ga_ertms_il_interface.h
1
9
10
#ifndef AB_GA_ERTMS_IL_INTERFACE_H
11
#define AB_GA_ERTMS_IL_INTERFACE_H
12
13
#include "../ab_ga_ertms_types.h"
14
#include "ab_ga_ertms_il_types.h"
15
16
17
#ifdef __cplusplus
18
extern
"C"
{
19
#endif
20
21
/* ========================================================================= */
22
/* Interlocking Vital Protocol Message Types */
23
/* ========================================================================= */
24
25
#define RBC_IL_MSG_KEEPALIVE_REQ 0x01U
26
#define RBC_IL_MSG_KEEPALIVE_ACK 0x02U
27
#define RBC_IL_MSG_ROUTE_STATUS_UPDATE 0x10U
28
#define RBC_IL_MSG_TRACK_OCCUPANCY_UPDATE 0x11U
29
#define RBC_IL_MSG_POINT_STATUS_UPDATE 0x12U
30
#define RBC_IL_MSG_SIGNAL_ASPECT_UPDATE 0x13U
31
#define RBC_IL_MSG_LX_STATUS_UPDATE 0x14U
32
#define RBC_IL_MSG_EMERGENCY_STOP_COMMAND 0x1FU
33
34
#define RBC_IL_MSG_TRAIN_FOOTPRINT_UPDATE 0x20U
35
#define RBC_IL_MSG_SECTION_RELEASE_REQUEST 0x21U
36
#define RBC_IL_MSG_MA_CONFIRMATION 0x22U
37
#define RBC_IL_MSG_EMERGENCY_STOP_ACK 0x2FU
38
39
/* ========================================================================= */
40
/* Vital Message Header (EN 50159 / SIL 4 Safety Envelope) */
41
/* ========================================================================= */
42
typedef
struct
rbc_il_header_s
43
{
44
rbc_nid_ixl_t
nid_ixl
;
45
rbc_nid_rbc_t
nid_rbc
;
46
uint32_t
sequence_number
;
47
rbc_timestamp_ms_t
timestamp_ms
;
48
uint8_t
msg_type
;
49
}
rbc_il_header_t
;
50
51
/* ========================================================================= */
52
/* Interlocking -> RBC Inbound Messages */
53
/* ========================================================================= */
54
55
typedef
struct
rbc_il_msg_route_status_s
56
{
57
rbc_il_header_t
header;
58
rbc_il_route_info_t
route;
59
}
rbc_il_msg_route_status_t
;
60
61
typedef
struct
rbc_il_msg_track_occupancy_s
62
{
63
rbc_il_header_t
header;
64
uint8_t count;
65
rbc_il_section_status_t
sections[RBC_IL_MAX_ROUTE_SECTIONS];
66
}
rbc_il_msg_track_occupancy_t
;
67
68
typedef
struct
rbc_il_msg_point_status_s
69
{
70
rbc_il_header_t
header;
71
rbc_il_point_status_t
point;
72
}
rbc_il_msg_point_status_t
;
73
74
typedef
struct
rbc_il_msg_signal_aspect_s
75
{
76
rbc_il_header_t
header;
77
rbc_il_signal_status_t
signal;
78
}
rbc_il_msg_signal_aspect_t
;
79
80
typedef
struct
rbc_il_msg_lx_status_s
81
{
82
rbc_il_header_t
header;
83
rbc_il_lx_status_t
lx;
84
}
rbc_il_msg_lx_status_t
;
85
86
typedef
struct
rbc_il_msg_emergency_stop_s
87
{
88
rbc_il_header_t
header;
89
rbc_nid_section_t section_id;
90
bool
all_tracks;
91
}
rbc_il_msg_emergency_stop_t
;
92
93
typedef
struct
rbc_il_msg_keepalive_s
94
{
95
rbc_il_header_t
header;
96
}
rbc_il_msg_keepalive_t
;
97
98
/* ========================================================================= */
99
/* RBC -> Interlocking Outbound Messages */
100
/* ========================================================================= */
101
102
typedef
struct
rbc_il_msg_train_footprint_s
103
{
104
rbc_il_header_t
header;
105
rbc_nid_engine_t nid_engine;
106
rbc_nid_section_t front_section;
107
rbc_nid_section_t rear_section;
108
bool
train_integrity_confirmed;
109
}
rbc_il_msg_train_footprint_t
;
110
111
typedef
struct
rbc_il_msg_section_release_request_s
112
{
113
rbc_il_header_t
header;
114
rbc_nid_route_t route_id;
115
rbc_nid_section_t section_id;
116
rbc_nid_engine_t nid_engine;
117
}
rbc_il_msg_section_release_request_t
;
118
119
typedef
struct
rbc_il_msg_ma_confirmation_s
120
{
121
rbc_il_header_t
header;
122
rbc_nid_route_t route_id;
123
rbc_nid_engine_t nid_engine;
124
rbc_distance_m_t eoa_offset_m;
125
}
rbc_il_msg_ma_confirmation_t
;
126
127
/* ========================================================================= */
128
/* Unified Generic Message Containers & Handlers */
129
/* ========================================================================= */
130
131
typedef
struct
rbc_il_inbound_msg_s
132
{
133
uint8_t msg_type;
134
union
135
{
136
rbc_il_msg_keepalive_t
keepalive;
137
rbc_il_msg_route_status_t
route_status;
138
rbc_il_msg_track_occupancy_t
track_occupancy;
139
rbc_il_msg_point_status_t
point_status;
140
rbc_il_msg_signal_aspect_t
signal_aspect;
141
rbc_il_msg_lx_status_t
lx_status;
142
rbc_il_msg_emergency_stop_t
emergency_stop;
143
} payload;
144
}
rbc_il_inbound_msg_t
;
145
146
typedef
struct
rbc_il_outbound_msg_s
147
{
148
uint8_t msg_type;
149
union
150
{
151
rbc_il_msg_keepalive_t
keepalive_ack;
152
rbc_il_msg_train_footprint_t
train_footprint;
153
rbc_il_msg_section_release_request_t
section_release;
154
rbc_il_msg_ma_confirmation_t
ma_confirmation;
155
} payload;
156
}
rbc_il_outbound_msg_t
;
157
161
typedef
void (*rbc_il_on_message_received_fn)(
const
rbc_il_inbound_msg_t
*msg,
void
*user_context);
162
166
typedef
int (*rbc_il_send_message_fn)(rbc_nid_ixl_t nid_ixl,
167
const
rbc_il_outbound_msg_t
*msg,
168
void
*user_context);
169
170
#ifdef __cplusplus
171
}
172
#endif
173
174
#endif
/* RBC_IL_INTERFACE_H */
rbc_il_header_t
Definition
ab_ga_ertms_il_interface.h:43
rbc_il_header_t::msg_type
uint8_t msg_type
Definition
ab_ga_ertms_il_interface.h:48
rbc_il_header_t::nid_rbc
rbc_nid_rbc_t nid_rbc
Definition
ab_ga_ertms_il_interface.h:45
rbc_il_header_t::nid_ixl
rbc_nid_ixl_t nid_ixl
Definition
ab_ga_ertms_il_interface.h:44
rbc_il_header_t::timestamp_ms
rbc_timestamp_ms_t timestamp_ms
Definition
ab_ga_ertms_il_interface.h:47
rbc_il_header_t::sequence_number
uint32_t sequence_number
Definition
ab_ga_ertms_il_interface.h:46
rbc_il_inbound_msg_t
Definition
ab_ga_ertms_il_interface.h:132
rbc_il_lx_status_t
Definition
ab_ga_ertms_il_types.h:122
rbc_il_msg_emergency_stop_t
Definition
ab_ga_ertms_il_interface.h:87
rbc_il_msg_keepalive_t
Definition
ab_ga_ertms_il_interface.h:94
rbc_il_msg_lx_status_t
Definition
ab_ga_ertms_il_interface.h:81
rbc_il_msg_ma_confirmation_t
Definition
ab_ga_ertms_il_interface.h:120
rbc_il_msg_point_status_t
Definition
ab_ga_ertms_il_interface.h:69
rbc_il_msg_route_status_t
Definition
ab_ga_ertms_il_interface.h:56
rbc_il_msg_section_release_request_t
Definition
ab_ga_ertms_il_interface.h:112
rbc_il_msg_signal_aspect_t
Definition
ab_ga_ertms_il_interface.h:75
rbc_il_msg_track_occupancy_t
Definition
ab_ga_ertms_il_interface.h:62
rbc_il_msg_train_footprint_t
Definition
ab_ga_ertms_il_interface.h:103
rbc_il_outbound_msg_t
Definition
ab_ga_ertms_il_interface.h:147
rbc_il_point_status_t
Definition
ab_ga_ertms_il_types.h:84
rbc_il_route_info_t
Definition
ab_ga_ertms_il_types.h:39
rbc_il_section_status_t
Definition
ab_ga_ertms_il_types.h:65
rbc_il_signal_status_t
Definition
ab_ga_ertms_il_types.h:104
src
AB
il
ab_ga_ertms_il_interface.h
Generated by
1.18.0