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_event.h File Reference

The one shared event vocabulary for every GP procedure state machine under state_machines/. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  ab_gp_event_t {
  AB_GP_SESSION_EVENT_SESSION_INITIATION_REQUESTED = 0 , AB_GP_SESSION_EVENT_SESSION_ESTABLISHED_CONFIRMED , AB_GP_SESSION_EVENT_TRAIN_DATA_VALIDATED , AB_GP_SESSION_EVENT_MA_GRANTED ,
  AB_GP_SESSION_EVENT_MA_REVOKED , AB_GP_SESSION_EVENT_SHUNTING_AUTHORIZED , AB_GP_SESSION_EVENT_SHUNTING_DEAUTHORIZED , AB_GP_SESSION_EVENT_EMERGENCY_STOP_ISSUED ,
  AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_FS , AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_STANDBY , AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_ESTABLISHED , AB_GP_SESSION_EVENT_SESSION_TERMINATED ,
  AB_GP_SESSION_EVENT_COUNT , AB_GP_EVENT_TRAIN_DATA_RECEIVED = AB_GP_SESSION_EVENT_COUNT , AB_GP_EVENT_TRAIN_DATA_REJECTED , AB_GP_EVENT_MA_REQUESTED ,
  AB_GP_EVENT_MA_ACKNOWLEDGED , AB_GP_EVENT_POSITION_REPORTED , AB_GP_EVENT_END_OF_MISSION , AB_GP_EVENT_HANDOVER_ANNOUNCED ,
  AB_GP_EVENT_HANDOVER_CONFIRMED , AB_GP_EVENT_TSR_IMPOSED , AB_GP_EVENT_TSR_REVOKED , AB_GP_EVENT_TEXT_MESSAGE_SENT ,
  AB_GP_EVENT_TEXT_MESSAGE_ACKNOWLEDGED , AB_GP_EVENT_COUNT
}
 Every event any GP procedure state machine reacts to. One per distinct real trigger in ertms_procedures/. More...

Detailed Description

The one shared event vocabulary for every GP procedure state machine under state_machines/.

Design, per direct request (the "flat per-entity FSMs + synchronous static dispatch" option): a procedure in ertms_procedures/ never calls one specific state machine by name. It raises a NAMED EVENT describing what happened (a message arrived, a timer expired, GA changed a route's status) via ab_gp_dispatch() (ab_gp_dispatch.h), and the dispatcher's own compile-time subscription table (s_subscriptions[] in ab_gp_dispatch.c) alone decides which FSM handler(s) react to it. Adding a new per-entity FSM is then purely additive: define its table, add its rows to that one subscription table - no procedure file changes.

This enum is the union of every event any of those FSMs reacts to. Values 0 .. AB_GP_SESSION_EVENT_COUNT-1 are the session-lifecycle events (ab_gp_session_fsm.c's own table is indexed by exactly this sub-range and sized to AB_GP_SESSION_EVENT_COUNT - keep that in sync if the session block below changes). Values from there to AB_GP_EVENT_COUNT are the other procedures' own events. A given FSM's handler simply returns "not handled" for any event outside its own interest - the subscription table is what keeps a handler from even being called for one it does not care about.

NO hierarchy, NO event queue, NO runtime subscription: dispatch is a synchronous run-to-completion call within GP's own cyclic executive (see ab_gp_dispatch.c), and the (event -> handlers) wiring is a single const table a reviewer can read top to bottom - both deliberate, for a MISRA C:2012 / EN 50128 SIL 4 context where a persistent queue's overflow/latency semantics and a pub/sub registry's non-static wiring would each be extra analysis burden with no matching payoff at this scale.

Definition in file ab_gp_event.h.

Enumeration Type Documentation

◆ ab_gp_event_t

Every event any GP procedure state machine reacts to. One per distinct real trigger in ertms_procedures/.

The leading block (through AB_GP_SESSION_EVENT_COUNT) is consumed by ab_gp_session_fsm.c and MUST keep its declaration order and its terminating AB_GP_SESSION_EVENT_COUNT marker - that file's transition table is a fixed 2D array sized and column-indexed by this sub-range.

Enumerator
AB_GP_SESSION_EVENT_SESSION_INITIATION_REQUESTED 

Msg 155 / P0 - session init.

AB_GP_SESSION_EVENT_SESSION_ESTABLISHED_CONFIRMED 

Msg 159 - version negotiated.

AB_GP_SESSION_EVENT_TRAIN_DATA_VALIDATED 

Msg 129 validated (ab_gp_proc_train_data.c).

AB_GP_SESSION_EVENT_MA_GRANTED 

ab_gp_proc_ma_compute() - MA (re)granted.

AB_GP_SESSION_EVENT_MA_REVOKED 

ab_gp_proc_ma_revoke() - MA fully revoked.

AB_GP_SESSION_EVENT_SHUNTING_AUTHORIZED 

ab_gp_proc_shunting_authorize(true).

AB_GP_SESSION_EVENT_SHUNTING_DEAUTHORIZED 

ab_gp_proc_shunting_authorize(false).

AB_GP_SESSION_EVENT_EMERGENCY_STOP_ISSUED 

Msg 15/16 - CES or UES issued.

AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_FS 

Revoke restoring an active MA.

AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_STANDBY 

Revoke restoring validated-but-no-MA.

AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_ESTABLISHED 

Revoke restoring neither.

AB_GP_SESSION_EVENT_SESSION_TERMINATED 

Msg 156/41, T_NVCONTACT timeout, or a dropped transport slot - always -> IDLE.

AB_GP_SESSION_EVENT_COUNT 

Session sub-range bound - not a real event. ab_gp_session_fsm.c's table width.

AB_GP_EVENT_TRAIN_DATA_RECEIVED 

Msg 129 arrived, before validation.

AB_GP_EVENT_TRAIN_DATA_REJECTED 

Msg 129 failed RBC validation checks.

AB_GP_EVENT_MA_REQUESTED 

Msg 132 - train asked for an MA.

AB_GP_EVENT_MA_ACKNOWLEDGED 

Msg 146 - train acked a granted MA.

AB_GP_EVENT_POSITION_REPORTED 

Msg 136 Packet 0/1 - a position report.

AB_GP_EVENT_END_OF_MISSION 

Msg 150 / Msg 156 - train ended its mission.

AB_GP_EVENT_HANDOVER_ANNOUNCED 
AB_GP_EVENT_HANDOVER_CONFIRMED 
AB_GP_EVENT_TSR_IMPOSED 
AB_GP_EVENT_TSR_REVOKED 
AB_GP_EVENT_TEXT_MESSAGE_SENT 
AB_GP_EVENT_TEXT_MESSAGE_ACKNOWLEDGED 
AB_GP_EVENT_COUNT 

Not a real event - full-enum bound.

Definition at line 52 of file ab_gp_event.h.