19#include "rte/oal/log/rte_log.h"
20#include "rte/utils/string/rte_string.h"
106#define AB_GP_DISPATCH_SUBSCRIPTION_COUNT \
107 (sizeof(s_subscriptions) / sizeof(s_subscriptions[0]))
115 uint32_t reached, uint32_t changed)
119 const char *out_cstr = NULL;
121 if (rte_string_init(&line, storage,
sizeof(storage)) != RTE_STATUS_OK)
125 (void)rte_string_copy(&line,
"train=");
126 (void)rte_string_append_u32(&line, (uint32_t)ctx->
train_id);
127 (void)rte_string_concat(&line,
" event=");
128 (void)rte_string_append_u32(&line, (uint32_t)event);
129 (void)rte_string_concat(&line,
" reached=");
130 (void)rte_string_append_u32(&line, reached);
131 (void)rte_string_concat(&line,
" changed=");
132 (void)rte_string_append_u32(&line, changed);
134 if (rte_string_c_str(&line, &out_cstr) == RTE_STATUS_OK)
136 rte_log_write(RTE_LOG_LEVEL_DEBUG,
"GP_DISPATCH", out_cstr);
143 uint32_t reached = 0U;
144 uint32_t changed = 0U;
168 return (changed > 0U);
static const struct @227266333067155012122310032006107002200036350304 s_subscriptions[]
static void log_dispatch(const ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event, uint32_t reached, uint32_t changed)
#define AB_GP_DISPATCH_SUBSCRIPTION_COUNT
bool ab_gp_dispatch(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
Raises event to every state machine subscribed to it, in subscription-table order,...
Synchronous, statically-wired event dispatch for GP's per-entity procedure state machines (state_mach...
bool(*) ab_gp_fsm_handler_fn(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
One FSM's event entry point. Every per-entity FSM under state_machines/ exposes exactly this signatur...
bool ab_gp_emergency_stop_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
STUB handler - logs "not implemented yet" and returns false (no state change). Signature matches ab_g...
STUB per-entity state machine for the EMERGENCY_STOP procedure.
bool ab_gp_eom_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
STUB handler - logs "not implemented yet" and returns false (no state change). Signature matches ab_g...
STUB per-entity state machine for the EOM procedure.
ab_gp_event_t
Every event any GP procedure state machine reacts to. One per distinct real trigger in ertms_procedur...
@ AB_GP_SESSION_EVENT_EMERGENCY_STOP_ISSUED
@ AB_GP_EVENT_TEXT_MESSAGE_ACKNOWLEDGED
@ AB_GP_SESSION_EVENT_SESSION_TERMINATED
@ AB_GP_SESSION_EVENT_SESSION_INITIATION_REQUESTED
@ AB_GP_EVENT_MA_REQUESTED
@ AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_ESTABLISHED
@ AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_STANDBY
@ AB_GP_SESSION_EVENT_SHUNTING_AUTHORIZED
@ AB_GP_EVENT_TRAIN_DATA_REJECTED
@ AB_GP_SESSION_EVENT_MA_REVOKED
@ AB_GP_SESSION_EVENT_SESSION_ESTABLISHED_CONFIRMED
@ AB_GP_EVENT_TEXT_MESSAGE_SENT
@ AB_GP_EVENT_HANDOVER_CONFIRMED
@ AB_GP_SESSION_EVENT_MA_GRANTED
@ AB_GP_EVENT_MA_ACKNOWLEDGED
@ AB_GP_EVENT_HANDOVER_ANNOUNCED
@ AB_GP_SESSION_EVENT_EMERGENCY_STOP_REVOKED_TO_FS
@ AB_GP_EVENT_TSR_IMPOSED
@ AB_GP_EVENT_POSITION_REPORTED
@ AB_GP_SESSION_EVENT_TRAIN_DATA_VALIDATED
@ AB_GP_EVENT_TRAIN_DATA_RECEIVED
@ AB_GP_EVENT_END_OF_MISSION
@ AB_GP_EVENT_TSR_REVOKED
@ AB_GP_SESSION_EVENT_SHUNTING_DEAUTHORIZED
bool ab_gp_handover_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
STUB handler - logs "not implemented yet" and returns false (no state change). Signature matches ab_g...
STUB per-entity state machine for the HANDOVER procedure.
bool ab_gp_ma_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
STUB handler - logs "not implemented yet" and returns false (no state change). Signature matches ab_g...
STUB per-entity state machine for the MA procedure.
bool ab_gp_position_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
STUB handler - logs "not implemented yet" and returns false (no state change). Signature matches ab_g...
STUB per-entity state machine for the POSITION procedure.
bool ab_gp_session_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_session_event_t event)
Applies event to ctx->session_state.
Event-driven legal-transition table for ab_gp_ertms_session_state_t (Subset-026 Chapter 5's various p...
bool ab_gp_shunting_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
STUB handler - logs "not implemented yet" and returns false (no state change). Signature matches ab_g...
STUB per-entity state machine for the SHUNTING procedure.
bool ab_gp_text_message_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
STUB handler - logs "not implemented yet" and returns false (no state change). Signature matches ab_g...
STUB per-entity state machine for the TEXT_MESSAGE procedure.
bool ab_gp_train_data_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
Applies event to ctx->train_data.state, and keeps ctx->train_data.valid in sync (true iff the new sta...
(state, event) -> state table for ab_gp_train_data_state_t (Subset-026 ยง5.4 Validated Train Data acce...
bool ab_gp_tsr_fsm_handle_event(ab_gp_ertms_train_context_t *ctx, ab_gp_event_t event)
STUB handler - logs "not implemented yet" and returns false (no state change). Signature matches ab_g...
STUB per-entity state machine for the TSR procedure.
ab_gp_fsm_handler_fn handler
Complete ERTMS state and procedure context for one train slot.