|
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.6 Shunting initiated by driver (Level 2). More...
Go to the source code of this file.
Functions | |
| bool | ab_gp_proc_shunting_request (ab_gp_ertms_train_context_t *ctx) |
| Handles inbound Shunting Request (Msg 130). | |
| bool | ab_gp_proc_shunting_authorize (ab_gp_ertms_train_context_t *ctx, bool authorized) |
| Authorizes or rejects shunting mode for the train. | |
| ab_gp_shunting_decision_t | ab_gp_proc_shunting_handle_request (ab_gp_ertms_train_context_t *ctx, uint8_t train_id, uint32_t v_train_kmh) |
| Decides one Msg 130 Request for Shunting and applies the outcome. | |
| bool | ab_gp_proc_shunting_build_reply (ab_gp_shunting_decision_t decision, rbc_timestamp_ms_t t_train_reply, rbc_timestamp_ms_t t_train_request, rbc_nid_lrbg_t nid_lrbg, rbc_train_outbound_msg_t *out) |
| Builds the answer to a Msg 130: Msg 28 SH Authorised or Msg 27 SH Refused. | |
| const char * | ab_gp_proc_shunting_decision_name (ab_gp_shunting_decision_t decision) |
ERTMS Subset-026 5.6 Shunting initiated by driver (Level 2).
Implements SIL 4 C99 shunting mode request handling (Msg 130) and shunting authorization state transitions. The train sends Msg 130 Request for Shunting with a position report; the RBC answers Msg 28 SH Authorised or Msg 27 SH Refused. The decision and the reply are built here, without a channel, so both are unit-testable; ab_gp_proc_dispatch.c stages the reply.
Definition in file ab_gp_proc_shunting.h.
Outcome of one Msg 130 Request for Shunting.
Definition at line 23 of file ab_gp_proc_shunting.h.
| bool ab_gp_proc_shunting_request | ( | ab_gp_ertms_train_context_t * | ctx | ) |
Handles inbound Shunting Request (Msg 130).
| [in,out] | ctx | Train ERTMS context. |
Definition at line 13 of file ab_gp_proc_shunting.c.
| bool ab_gp_proc_shunting_authorize | ( | ab_gp_ertms_train_context_t * | ctx, |
| bool | authorized ) |
Authorizes or rejects shunting mode for the train.
| [in,out] | ctx | Train ERTMS context. |
| [in] | authorized | True = Grant shunting authority, False = Reject. |
Definition at line 24 of file ab_gp_proc_shunting.c.
| ab_gp_shunting_decision_t ab_gp_proc_shunting_handle_request | ( | ab_gp_ertms_train_context_t * | ctx, |
| uint8_t | train_id, | ||
| uint32_t | v_train_kmh ) |
Decides one Msg 130 Request for Shunting and applies the outcome.
Checks, in order: an established session (not IDLE / INITIATED), standstill (v_train_kmh == 0), a session state that allows SHUNTING_AUTHORIZED, and every GA shunting validator (ab_gp_logic_shunting_allowed(), default-deny). On approval the session moves to SHUNTING. A refusal changes no state: a train already in SHUNTING is never taken out of it by a refused request, and a repeated request while already SHUNTING is answered as authorised. Depends only on replicated state, so channels A and B decide identically.
| [in,out] | ctx | Train ERTMS context. |
| [in] | train_id | Train slot (1..RTE_EXAMPLE_MAX_TRAINS), passed to GA. |
| [in] | v_train_kmh | V_TRAIN from the Msg 130 position report. |
Definition at line 61 of file ab_gp_proc_shunting.c.
| bool ab_gp_proc_shunting_build_reply | ( | ab_gp_shunting_decision_t | decision, |
| rbc_timestamp_ms_t | t_train_reply, | ||
| rbc_timestamp_ms_t | t_train_request, | ||
| rbc_nid_lrbg_t | nid_lrbg, | ||
| rbc_train_outbound_msg_t * | out ) |
Builds the answer to a Msg 130: Msg 28 SH Authorised or Msg 27 SH Refused.
| [in] | decision | Result of ab_gp_proc_shunting_handle_request(). |
| [in] | t_train_reply | T_TRAIN of the reply header (the train's own time stamp, see the dispatcher). |
| [in] | t_train_request | T_TRAIN of the Msg 130 being answered (carried by Msg 27 and Msg 28). |
| [in] | nid_lrbg | LRBG reported in the Msg 130 position report. |
| [out] | out | Outbound message, fully overwritten. Must not be NULL. |
out is NULL. Definition at line 112 of file ab_gp_proc_shunting.c.
| const char * ab_gp_proc_shunting_decision_name | ( | ab_gp_shunting_decision_t | decision | ) |
Definition at line 143 of file ab_gp_proc_shunting.c.