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_train_session_t Struct Reference

#include <ab_gp_train.h>

Data Fields

bool in_use
uint8_t train_id
uint32_t cycle
uint32_t d_lrbg
uint32_t granted_length
uint32_t ma_seq
bool ma_pending_send
bool ma_acked
bool ctc_connected_sent
bool ctc_ma_granted_sent
bool position_reply_pending
uint32_t position_reply_msg_type
bool ctc_ma_notify_pending
uint32_t v_train
uint32_t m_mode

Detailed Description

Definition at line 79 of file ab_gp_train.h.

Field Documentation

◆ in_use

bool ab_gp_train_session_t::in_use

Slot occupied by a connected train.

Definition at line 81 of file ab_gp_train.h.

◆ train_id

uint8_t ab_gp_train_session_t::train_id

1..RTE_EXAMPLE_MAX_TRAINS - which Train/IL instance.

Definition at line 82 of file ab_gp_train.h.

◆ cycle

uint32_t ab_gp_train_session_t::cycle

Last M136 cycle number seen for this train.

Definition at line 83 of file ab_gp_train.h.

◆ d_lrbg

uint32_t ab_gp_train_session_t::d_lrbg

Last reported position.

Definition at line 84 of file ab_gp_train.h.

◆ granted_length

uint32_t ab_gp_train_session_t::granted_length

Cumulative MA length granted, meters - sum of every ROUTE_ADD so far.

Definition at line 85 of file ab_gp_train.h.

◆ ma_seq

uint32_t ab_gp_train_session_t::ma_seq

Monotonic MA sequence number for this train.

Definition at line 86 of file ab_gp_train.h.

◆ ma_pending_send

bool ab_gp_train_session_t::ma_pending_send

Local scratch only, NOT wire/cross-compare relevant (see this struct's own doc) - set on a ROUTE_ADD, cleared once this cycle's M3 send completes (ab_gp_channel_forward_to_c_if_needed()).

Definition at line 87 of file ab_gp_train.h.

◆ ma_acked

bool ab_gp_train_session_t::ma_acked

True once M146 arrived acking the current ma_seq.

Definition at line 90 of file ab_gp_train.h.

◆ ctc_connected_sent

bool ab_gp_train_session_t::ctc_connected_sent

CTC_CONNECTED has been sent for this session. Known ADR-029 limitation: NOT part of the negotiate-transfer wire payload (this module's own registered payload collector doesn't carry it - see this struct's own doc), so a STANDBY->ONLINE promotion resets this to false even for an already-connected train - CTC sees a redundant repeat CTC_CONNECTED/CTC_MA_GRANTED (not CTC_MA_EXTENDED) after a failover. Cosmetic only: the fields that actually determine MA validity (granted_length/ma_seq) DO transfer correctly - only the "have I already told CTC about this" bookkeeping restarts. Acceptable for a first pass; a later one could add these two flags to the wire payload if the duplicate CTC notification ever needs to disappear too.

Definition at line 106 of file ab_gp_train.h.

◆ ctc_ma_granted_sent

bool ab_gp_train_session_t::ctc_ma_granted_sent

CTC_MA_GRANTED has been sent at least once for this session - once true, a later ma_pending_send send is CTC_MA_EXTENDED instead. Same known limitation as ctc_connected_sent above.

Definition at line 118 of file ab_gp_train.h.

◆ position_reply_pending

bool ab_gp_train_session_t::position_reply_pending

Sticky flag: true when M136 position report needs an ack (M24/M15), cleared once forwarded to C.

Definition at line 121 of file ab_gp_train.h.

◆ position_reply_msg_type

uint32_t ab_gp_train_session_t::position_reply_msg_type

Message type to reply with (e.g. 24 or 15).

Definition at line 122 of file ab_gp_train.h.

◆ ctc_ma_notify_pending

bool ab_gp_train_session_t::ctc_ma_notify_pending

Local scratch only, NOT wire/cross-compare relevant, same posture as ma_pending_send above - but deliberately a SEPARATE flag from it. ma_pending_send means "build and send the flat-scheme's own M3 this cycle" (ab_gp_train_build_outputs() reads it for exactly that); the real Subset-026/ERTMS MA-grant path (ab_gp_proc_dispatch.c's handle_msg_132()) already sends its own RBC_MSG_ERTMS_ENVELOPE-wrapped Msg 3 directly, so setting ma_pending_send there too would make ab_gp_train_build_outputs() ALSO build and stage a duplicate flat-kind M3 as an unwanted side effect (found live). This flag exists purely so ab_ga_ctc_build_outputs() can still notice a fresh ERTMS grant and emit CTC_MA_GRANTED/_EXTENDED, without also triggering the flat train-output builder. Cleared the same way/place ma_pending_send is (see post_execute.c's own per-cycle reset loop).

Definition at line 123 of file ab_gp_train.h.

◆ v_train

uint32_t ab_gp_train_session_t::v_train

Last reported train speed (M136's own v_train field). Local/diagnostic only, NOT wire/cross-compare relevant - matches d_lrbg staying cross-compare-relevant while this stays outside RTE_EXAMPLE_TRAIN_SESSION_WIRE_SIZE, since no decision logic in this codebase reads speed today, only CTC telemetry does (via ab_gp_train_context_t, not a getter).

Definition at line 148 of file ab_gp_train.h.

◆ m_mode

uint32_t ab_gp_train_session_t::m_mode

Last reported ETCS mode (M136's own m_mode field) - same posture as v_train above.

Definition at line 157 of file ab_gp_train.h.


The documentation for this struct was generated from the following file: