SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
Loading...
Searching...
No Matches
ab_ga_ertms_types.h
1
13
14#ifndef RBC_ERTMS_TYPES_H
15#define RBC_ERTMS_TYPES_H
16
17#include <stdbool.h>
18#include <stdint.h>
19#include <stddef.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/* ========================================================================= */
26/* 1. Identification Types (NID_*) */
27/* ========================================================================= */
28
30typedef uint16_t rbc_nid_c_t;
31
33typedef uint16_t rbc_nid_rbc_t;
34
36typedef uint32_t rbc_nid_engine_t;
37
39typedef uint16_t rbc_nid_bg_t;
40
42typedef struct rbc_nid_lrbg_s
43{
44 rbc_nid_c_t nid_c;
45 rbc_nid_bg_t nid_bg;
47
49typedef uint32_t rbc_nid_ixl_t;
50
52typedef uint32_t rbc_nid_section_t;
53
55typedef uint32_t rbc_nid_route_t;
56
58typedef uint32_t rbc_nid_point_t;
59
61typedef uint32_t rbc_nid_signal_t;
62
64typedef uint32_t rbc_nid_lx_t;
65
67typedef uint16_t rbc_nid_tsr_t;
68
70typedef uint8_t rbc_nid_em_t;
71
73typedef uint8_t rbc_nid_ntc_t;
74
75/* ========================================================================= */
76/* 2. ETCS Core Enumerations & Qualifiers (Q_*, M_*) */
77/* ========================================================================= */
78
86typedef enum rbc_q_scale_e
87{
88 RBC_Q_SCALE_10CM = 0,
89 RBC_Q_SCALE_1M = 1,
90 RBC_Q_SCALE_10M = 2
91} rbc_q_scale_t;
92
100typedef enum rbc_q_dir_e
101{
102 RBC_Q_DIR_REVERSE = 0,
103 RBC_Q_DIR_NOMINAL = 1,
104 RBC_Q_DIR_BOTH = 2
105} rbc_q_dir_t;
106
114typedef enum rbc_q_dirlrbg_e
115{
116 RBC_Q_DIRLRBG_REVERSE = 0,
117 RBC_Q_DIRLRBG_NOMINAL = 1,
118 RBC_Q_DIRLRBG_UNKNOWN = 2
119} rbc_q_dirlrbg_t;
120
128typedef enum rbc_q_dlrbg_e
129{
130 RBC_Q_DLRBG_REVERSE = 0,
131 RBC_Q_DLRBG_NOMINAL = 1,
132 RBC_Q_DLRBG_UNKNOWN = 2
133} rbc_q_dlrbg_t;
134
139typedef enum rbc_m_mode_e
140{
141 RBC_M_MODE_FULL_SUPERVISION = 0,
142 RBC_M_MODE_ON_SIGHT = 1,
143 RBC_M_MODE_STAFF_RESPONSIBLE = 2,
144 RBC_M_MODE_SHUNTING = 3,
145 RBC_M_MODE_UNFITTED = 4,
146 RBC_M_MODE_STAND_BY = 5,
147 RBC_M_MODE_SLEEPING = 6,
148 RBC_M_MODE_POST_TRIP = 7,
149 RBC_M_MODE_TRIP = 8,
150 RBC_M_MODE_ISOLATING = 9,
151 RBC_M_MODE_NON_LEADING = 10,
152 RBC_M_MODE_NATIONAL_SYSTEM = 11,
153 RBC_M_MODE_REVERSING = 12,
154 RBC_M_MODE_LIMITED_SUPERVISION = 13
155} rbc_m_mode_t;
156
161typedef enum rbc_m_level_e
162{
163 RBC_M_LEVEL_0 = 0,
164 RBC_M_LEVEL_NTC = 1,
165 RBC_M_LEVEL_1 = 2,
166 RBC_M_LEVEL_2 = 3,
167 RBC_M_LEVEL_3 = 4
168} rbc_m_level_t;
169
174typedef enum rbc_m_ack_e
175{
176 RBC_M_ACK_NOT_REQUIRED = 0,
177 RBC_M_ACK_REQUIRED = 1
178} rbc_m_ack_t;
179
184typedef enum rbc_q_marqstreason_e
185{
186 RBC_Q_MARQSTREASON_TIME_BEFORE_SECTION_TIMER = 0,
187 RBC_Q_MARQSTREASON_TIME_BEFORE_LOA_TIMER = 1,
188 RBC_Q_MARQSTREASON_TRACK_DESCRIPTION_DELETED = 2,
189 RBC_Q_MARQSTREASON_DRIVER_REQUEST = 3,
190 RBC_Q_MARQSTREASON_SESSION_OPENING = 4
191} rbc_q_marqstreason_t;
192
196typedef enum rbc_q_front_e
197{
198 RBC_Q_FRONT_TRAIN_LENGTH_DELAY = 0,
199 RBC_Q_FRONT_NO_TRAIN_LENGTH_DELAY = 1
200} rbc_q_front_t;
201
202/* ========================================================================= */
203/* 3. Physical & Positional Units (Fixed Scaling) */
204/* ========================================================================= */
205
207typedef int64_t rbc_distance_cm_t;
208
210typedef uint32_t rbc_distance_m_t;
211
213typedef uint16_t rbc_speed_kmh_t;
214
216typedef int8_t rbc_gradient_permille_t;
217
219typedef uint64_t rbc_timestamp_ms_t;
220
222typedef uint32_t rbc_duration_s_t;
223
224#ifdef __cplusplus
225}
226#endif
227
228#endif /* RBC_ERTMS_TYPES_H */
Last Relevant Balise Group (Country + BG identifier).
rbc_nid_bg_t nid_bg