|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
ERTMS Subset-026 §5.5 Movement Authority (MA) Management Procedure. More...
Go to the source code of this file.
Functions | |
| bool | ab_gp_proc_ma_compute (ab_gp_ertms_train_context_t *ctx, const ab_site_ga_route_layout_t *route, uint32_t ma_seq) |
| Computes and grants a new Movement Authority based on site track layout. | |
| uint32_t | ab_gp_proc_ma_remaining_length_m (const ab_site_ga_route_layout_t *route, uint32_t nid_lrbg, uint32_t d_lrbg_m) |
Computes the Movement Authority length actually REMAINING from a train's own last-KNOWN balise to route's end signal - a direct point-to-point distance along route's own segment chain from that balise's (nid_lrbg) own physical position to the end signal's own physical position, NOT "route->length_m
minus however far the balise sits from the route's own START
signal" - the two are NOT interchangeable (found live: an earlier version of this function computed the latter and got a real, confirmed-wrong answer - see the .c file's own implementation doc for the concrete counter-example). Measured from the balise, NOT from nid_lrbg plus d_lrbg_m's own distance past it - on direct instruction: MA length is anchored to the train's last KNOWN, site-data-backed reference point, not a continuously self-reported odometer offset past it (d_lrbg_m is accepted for a possible future use but not used in this computation today - see the .c file's own doc). A train connecting to (or being extended into) a route it is already partway through must NOT be granted the route's own full length regardless - found live: both this function's own caller below and the flat scheme's ab_ga_il_on_route_context_changed() (safeAPIRBC2oo2GA) were granting route->length_m unconditionally, regardless of the train's own reported position - a real overrun-risk shape (the train is told it has more track ahead of it than physically remains). | |
| bool | ab_gp_proc_ma_extend (ab_gp_ertms_train_context_t *ctx, const ab_site_ga_route_layout_t *additional_route) |
| Extends an existing Movement Authority with an additional connected route. | |
| bool | ab_gp_proc_ma_shorten (ab_gp_ertms_train_context_t *ctx, uint32_t new_ma_length_m) |
| Shortens an existing Movement Authority (Subset-026 §5.5.4 / Msg 9). | |
| bool | ab_gp_proc_ma_handle_ack (ab_gp_ertms_train_context_t *ctx, uint32_t ma_seq) |
| Handles Movement Authority Acknowledgement (Msg 146). | |
| void | ab_gp_proc_ma_revoke (ab_gp_ertms_train_context_t *ctx) |
| Revokes active Movement Authority (e.g. during emergency or termination). | |
ERTMS Subset-026 §5.5 Movement Authority (MA) Management Procedure.
Implements SIL 4 C99 Movement Authority computation, multi-packet generation (Packet 15 MA, Packet 21 Gradient, Packet 27 Speed Profile, Packet 5 Linking), MA extension, MA shortening, and acknowledgement handling.
Definition in file ab_gp_proc_ma.h.
| bool ab_gp_proc_ma_compute | ( | ab_gp_ertms_train_context_t * | ctx, |
| const ab_site_ga_route_layout_t * | route, | ||
| uint32_t | ma_seq ) |
Computes and grants a new Movement Authority based on site track layout.
| [in,out] | ctx | Train ERTMS context. |
| [in] | route | Site route layout defining signals, segments, and balises (GA's own ab_site_ga_route_layout_t - GP no longer owns route topology, see ab_siteGA.h's own doc). |
| [in] | ma_seq | Monotonic MA sequence counter. |
Definition at line 83 of file ab_gp_proc_ma.c.
| uint32_t ab_gp_proc_ma_remaining_length_m | ( | const ab_site_ga_route_layout_t * | route, |
| uint32_t | nid_lrbg, | ||
| uint32_t | d_lrbg_m ) |
Computes the Movement Authority length actually REMAINING from a train's own last-KNOWN balise to route's end signal - a direct point-to-point distance along route's own segment chain from that balise's (nid_lrbg) own physical position to the end signal's own physical position, NOT "route->length_m
minus however far the balise sits from the route's own START
signal" - the two are NOT interchangeable (found live: an earlier version of this function computed the latter and got a real, confirmed-wrong answer - see the .c file's own implementation doc for the concrete counter-example). Measured from the balise, NOT from nid_lrbg plus d_lrbg_m's own distance past it - on direct instruction: MA length is anchored to the train's last KNOWN, site-data-backed reference point, not a continuously self-reported odometer offset past it (d_lrbg_m is accepted for a possible future use but not used in this computation today - see the .c file's own doc). A train connecting to (or being extended into) a route it is already partway through must NOT be granted the route's own full length regardless - found live: both this function's own caller below and the flat scheme's ab_ga_il_on_route_context_changed() (safeAPIRBC2oo2GA) were granting route->length_m unconditionally, regardless of the train's own reported position - a real overrun-risk shape (the train is told it has more track ahead of it than physically remains).
Falls back to the FULL route->length_m (the previously unconditional behavior) if nid_lrbg cannot be resolved to a balise on route's own segment chain at all (e.g. no position report yet, or the reported balise belongs to a different route/segment entirely) - never guesses past what site data can actually support; this is also the correct fallback for a genuine forward extension (the additional route's own balises legitimately do not include the train's current one yet).
Implemented once, here, since only GP has direct access to the physical segment/balise tables (ab_siteGP.h, ab_site_get_segment()/ab_site_get_balise()) this computation needs - GA's own ab_site_ga_route_layout_t alone (length_m, opaque segment_ids[]) cannot do it. Exposed to GA via ga_interface.h for the flat scheme's own identical use.
| route | The route being granted/extended - GA's own ab_site_ga_route_layout_t. |
| nid_lrbg | Train's own last-reported NID_LRBG (M136/flat scheme position report alike) - the balise this computation is anchored to. |
| d_lrbg_m | Train's own last-reported D_LRBG (distance past nid_lrbg, meters) - accepted but NOT used in this computation, see this function's own doc above. |
Definition at line 53 of file ab_gp_proc_ma.c.
| bool ab_gp_proc_ma_extend | ( | ab_gp_ertms_train_context_t * | ctx, |
| const ab_site_ga_route_layout_t * | additional_route ) |
Extends an existing Movement Authority with an additional connected route.
| [in,out] | ctx | Train ERTMS context. |
| [in] | additional_route | Subsequent route layout to append. |
Definition at line 214 of file ab_gp_proc_ma.c.
| bool ab_gp_proc_ma_shorten | ( | ab_gp_ertms_train_context_t * | ctx, |
| uint32_t | new_ma_length_m ) |
Shortens an existing Movement Authority (Subset-026 §5.5.4 / Msg 9).
| [in,out] | ctx | Train ERTMS context. |
| [in] | new_ma_length_m | New reduced Limit of Authority in meters. |
Definition at line 248 of file ab_gp_proc_ma.c.
| bool ab_gp_proc_ma_handle_ack | ( | ab_gp_ertms_train_context_t * | ctx, |
| uint32_t | ma_seq ) |
Handles Movement Authority Acknowledgement (Msg 146).
| [in,out] | ctx | Train ERTMS context. |
| [in] | ma_seq | Sequence counter echoed in Msg 146. |
Definition at line 266 of file ab_gp_proc_ma.c.
| void ab_gp_proc_ma_revoke | ( | ab_gp_ertms_train_context_t * | ctx | ) |
Revokes active Movement Authority (e.g. during emergency or termination).
| [in,out] | ctx | Train ERTMS context. |
Definition at line 276 of file ab_gp_proc_ma.c.