|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
(state, event) -> state table for ab_gp_train_data_state_t (Subset-026 §5.4 Validated Train Data acceptance) - GP's second per-entity procedure state machine under state_machines/, after session/. More...
#include <stdbool.h>#include "../ab_gp_event.h"#include "../../ertms_procedures/ab_gp_ertms_types.h"Go to the source code of this file.
Functions | |
| bool | ab_gp_train_data_fsm_can_handle (ab_gp_train_data_state_t from, ab_gp_event_t event, ab_gp_train_data_state_t *out_to) |
| Read-only lookup, no side effect. | |
| 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 state is AB_GP_TRAIN_DATA_VALIDATED). | |
(state, event) -> state table for ab_gp_train_data_state_t (Subset-026 §5.4 Validated Train Data acceptance) - GP's second per-entity procedure state machine under state_machines/, after session/.
Same design as session/ (see ab_gp_session_fsm.h and ab_gp_event.h): a procedure fires a named ab_gp_event_t through ab_gp_dispatch(); this FSM is one subscriber and reacts only to the train-data events. It does NOT choose a target state - the table below does.
The transitions are given as an explicit { from, event, to } list rather than session/'s dense 2D array: this FSM reacts to only 3 of the ~14 shared events, so a dense row would be mostly "no outcome" padding and the column index would have to be counted against ab_gp_event_t by hand. The list keeps every transition readable in one place without that. It stays a pure table lookup (no per-transition code).
ab_gp_ertms_train_data_t.valid is kept as a derived mirror of "state == AB_GP_TRAIN_DATA_VALIDATED" by ab_gp_proc_train_data.c's own call sites, so nothing that reads .valid today has to change.
Definition in file ab_gp_train_data_fsm.h.
| bool ab_gp_train_data_fsm_can_handle | ( | ab_gp_train_data_state_t | from, |
| ab_gp_event_t | event, | ||
| ab_gp_train_data_state_t * | out_to ) |
Read-only lookup, no side effect.
| [in] | from | Current train-data state. |
| [in] | event | Event to evaluate. |
| [out] | out_to | Receives the resulting state on success; untouched otherwise. May be NULL. |
Definition at line 52 of file ab_gp_train_data_fsm.c.
| 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 state is AB_GP_TRAIN_DATA_VALIDATED).
| [in,out] | ctx | Train context. NULL -> returns false, no change. |
| [in] | event | Event to apply. An event this FSM does not react to from the current state -> returns false, no change (not an error - it is simply not one of this FSM's). |
Definition at line 118 of file ab_gp_train_data_fsm.c.