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_ertms_train_packets.h
Go to the documentation of this file.
1
8
9#ifndef AB_GP_ERTMS_TRAIN_PACKETS_H
10#define AB_GP_ERTMS_TRAIN_PACKETS_H
11
13
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#define RBC_MAX_GRADIENT_SEGMENTS 8U
20#define RBC_MAX_SPEED_SEGMENTS 8U
21#define RBC_MAX_LINKING_ITEMS 8U
22#define RBC_MAX_TSR_ITEMS 4U
23#define RBC_MAX_TEXT_MESSAGE_LEN 128U
24
25/* ========================================================================= */
26/* Standard ETCS Packet Numbers (NID_PACKET) */
27/* ========================================================================= */
28#define RBC_PACKET_0_POSITION_REPORT 0U
29#define RBC_PACKET_1_POSITION_REPORT_2BG 1U
30#define RBC_PACKET_3_NATIONAL_VALUES 3U
31#define RBC_PACKET_5_LINKING_INFO 5U
32#define RBC_PACKET_12_LEVEL_2_3_MA 12U
33#define RBC_PACKET_15_LEVEL_2_3_MA_SSP 15U
34#define RBC_PACKET_21_GRADIENT_PROFILE 21U
35#define RBC_PACKET_27_STATIC_SPEED_PROFILE 27U
36#define RBC_PACKET_41_LEVEL_TRANSITION_ORDER 41U
37#define RBC_PACKET_57_MA_REQUEST_PARAMS 57U
38#define RBC_PACKET_58_POSITION_REPORT_PARAMS 58U
39#define RBC_PACKET_65_TEMPORARY_SPEED_RESTRICT 65U
40#define RBC_PACKET_66_TSR_REVOCATION 66U
41#define RBC_PACKET_72_TEXT_MESSAGE 72U
42#define RBC_PACKET_131_RBC_TRANSITION_ORDER 131U
43
44/* ========================================================================= */
45/* Packet 0: Position Report (Train -> RBC) */
46/* Subset-026 Section 7.4.2.1 / 8.4.4.4 */
47/* ========================================================================= */
61
62/* ========================================================================= */
63/* Packet 1: Position Report based on two balise groups (Train -> RBC) */
64/* Subset-026 Section 7.4.3.2 - extension of Packet 0 for a single balise */
65/* group with unknown LRBG orientation: adds NID_PRVLRBG (a second BG, */
66/* used only as a directional reference for the rest of the packet's own */
67/* fields). A reduced field subset relative to Packet 0 below (nid_lrbg, */
68/* d_lrbg, v_train, m_mode, m_level - no q_scale/q_dirlrbg/q_dlrbg/ */
69/* l_doubtover/l_doubtunder of its own) plus this one extra field - */
70/* used by GP for the post-EoM idle heartbeat (ab_gp_proc_dispatch.c's own */
71/* handle_msg_136()), where the LRBG's own orientation is genuinely no */
72/* longer being actively tracked, matching this packet's real-world intent. */
73/* ========================================================================= */
84
85/* ========================================================================= */
86/* Packet 3: National Values (RBC -> Train) */
87/* Subset-026 Section 7.4.2.3 */
88/* ========================================================================= */
97
98/* ========================================================================= */
99/* Packet 5: Linking Information (RBC -> Train) */
100/* Subset-026 Section 7.4.2.5 */
101/* ========================================================================= */
108
109typedef struct rbc_packet_5_linking_s
110{
111 uint8_t link_count;
114
115/* ========================================================================= */
116/* Packet 12/15: Movement Authority (RBC -> Train) */
117/* Subset-026 Section 7.4.2.11 / 7.4.2.14 */
118/* ========================================================================= */
129
130/* ========================================================================= */
131/* Packet 21: Gradient Profile (RBC -> Train) */
132/* Subset-026 Section 7.4.2.18 */
133/* ========================================================================= */
139
140typedef struct rbc_packet_21_gradient_profile_s
141{
145
146/* ========================================================================= */
147/* Packet 27: Static Speed Profile - SSP (RBC -> Train) */
148/* Subset-026 Section 7.4.2.22 */
149/* ========================================================================= */
156
157typedef struct rbc_packet_27_ssp_s
158{
162
163/* ========================================================================= */
164/* Packet 41: Level Transition Order (RBC -> Train) */
165/* Subset-026 Section 7.4.2.32 */
166/* ========================================================================= */
174
175/* ========================================================================= */
176/* Packet 57: MA Request Parameters (RBC -> Train) */
177/* Subset-026 Section 7.4.2.44 */
178/* ========================================================================= */
179typedef struct rbc_packet_57_ma_request_params_s
180{
181 uint32_t t_mar_s;
184
185/* ========================================================================= */
186/* Packet 58: Position Report Parameters (RBC -> Train) */
187/* Subset-026 Section 7.4.2.45 */
188/* ========================================================================= */
189typedef struct rbc_packet_58_pr_params_s
190{
191 uint32_t t_cycloc_s;
194
195/* ========================================================================= */
196/* Packet 65: Temporary Speed Restriction (RBC -> Train) */
197/* Subset-026 Section 7.4.2.49 */
198/* ========================================================================= */
207
208/* ========================================================================= */
209/* Packet 66: TSR Revocation (RBC -> Train) */
210/* Subset-026 Section 7.4.2.50 */
211/* ========================================================================= */
212typedef struct rbc_packet_66_tsr_revoke_s
213{
216
217/* ========================================================================= */
218/* Packet 72: Plain Text Message to Driver DMI (RBC -> Train) */
219/* Subset-026 Section 7.4.2.54 */
220/* ========================================================================= */
221typedef struct rbc_packet_72_text_message_s
222{
224 uint32_t duration_s;
227
228/* ========================================================================= */
229/* Packet 131: RBC Transition Order (RBC -> Train) */
230/* Subset-026 Section 7.4.2.27 */
231/* ========================================================================= */
232typedef struct rbc_packet_131_rbc_transition_s
233{
235 uint16_t nid_c;
236 uint16_t nid_rbc;
237 uint64_t nid_radio;
240
241#ifdef __cplusplus
242}
243#endif
244
245#endif /* RBC_TRAIN_PACKETS_H */
#define RBC_MAX_TEXT_MESSAGE_LEN
#define RBC_MAX_GRADIENT_SEGMENTS
#define RBC_MAX_LINKING_ITEMS
#define RBC_MAX_SPEED_SEGMENTS
rbc_q_scale_t
Distance Scale Qualifier (Q_SCALE) Subset-026 Section 7.5.1.134: 0 = 10 cm (0.1 m) 1 = 1 m 2 = 10 m.
rbc_q_dlrbg_t
Train Orientation relative to LRBG (Q_DLRBG) Subset-026 Section 7.5.1.18: 0 = Reverse 1 = Nominal 2 =...
uint16_t rbc_nid_bg_t
Balise Group Unique Identifier (14 bits in ETCS).
uint16_t rbc_nid_tsr_t
Temporary Speed Restriction Identifier (16 bits).
rbc_q_front_t
Train Front / Rear Applicability Qualifier (Q_FRONT).
uint32_t rbc_distance_m_t
Distance offset in meters.
rbc_q_dir_t
Direction Qualifier (Q_DIR) Subset-026 Section 7.5.1.15: 0 = Reverse 1 = Nominal 2 = Both directions.
rbc_q_dirlrbg_t
Balise Group Orientation (Q_DIRLRBG) Subset-026 Section 7.5.1.16: 0 = Reverse 1 = Nominal 2 = Unknown...
uint8_t rbc_nid_ntc_t
National Track Condition / System Identifier.
int8_t rbc_gradient_permille_t
Gradient in parts per thousand (0.1% or per mille, -127..+127).
rbc_m_mode_t
Train Operating Mode (M_MODE) Subset-026 Section 7.5.1.86.
rbc_m_level_t
ETCS Operating Level (M_LEVEL) Subset-026 Section 7.5.1.84.
uint16_t rbc_speed_kmh_t
Speed in km/h (5 km/h ETCS granularity or exact integer).
Last Relevant Balise Group (Country + BG identifier).
rbc_distance_m_t d_sectiontimerstoploc
rbc_gradient_segment_t segments[RBC_MAX_GRADIENT_SEGMENTS]
rbc_speed_segment_t segments[RBC_MAX_SPEED_SEGMENTS]
rbc_linking_item_t links[RBC_MAX_LINKING_ITEMS]
char text[RBC_MAX_TEXT_MESSAGE_LEN]