|
SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
|
Per-route state machine, driven by IL route commands (RBC_MSG_IL_ROUTE_CMD / ab_ga_il_route_cmd_t). More...
Go to the source code of this file.
Data Structures | |
| struct | ab_ga_route_fsm_result_t |
| Result of applying one IL route command to a route's FSM. More... | |
Enumerations | |
| enum | ab_ga_route_state_t { AB_GA_ROUTE_STATE_NO_ROUTE = 0 , AB_GA_ROUTE_STATE_LOCKED = 1 , AB_GA_ROUTE_STATE_FS = 2 , AB_GA_ROUTE_STATE_OS = 3 , AB_GA_ROUTE_STATE_SH = 4 , AB_GA_ROUTE_STATE_USED = 5 , AB_GA_ROUTE_STATE_DEGRADED = 6 } |
| Per-route lifecycle state. Stored raw (uint32_t) on GP's route DB record - keep these values stable. More... | |
Functions | |
| ab_ga_route_fsm_result_t | ab_ga_route_fsm_eval (ab_ga_route_state_t from, const ab_ga_il_route_cmd_t *cmd) |
Computes the target state for (from, cmd), WITHOUT logging or touching any storage - pure, for tests and for ab_ga_route_fsm_step() itself. | |
| ab_ga_route_fsm_result_t | ab_ga_route_fsm_step (ab_gp_db_t *db, uint16_t route_id, const ab_ga_il_route_cmd_t *cmd, uint32_t cycle, const char *role_tag) |
Applies cmd to the route's FSM: reads the current state via ab_gp_db_route_get_fsm_state(), computes the target (ab_ga_route_fsm_eval), logs the transition at INFO (STUB targets logged as "not implemented yet"), and writes the target back via ab_gp_db_route_set_fsm_state(). | |
Per-route state machine, driven by IL route commands (RBC_MSG_IL_ROUTE_CMD / ab_ga_il_route_cmd_t).
One instance of this state exists per tracked route; it is persisted on GP's own route DB record (ab_gp_db_route_t.route_fsm_state, raw uint32_t) and read/written through ga_interface.h's ab_gp_db_route_get_fsm_state() / _set_fsm_state(). GA owns the transition logic here; GP just stores the value.
The state is essentially a function of the IL command's route_type + route_status + release_route_request. ab_ga_route_fsm_step() computes the target, logs the transition, and tells the caller whether the target is a REAL-handled state or a STUB one (OS / SH / DEGRADED - the state is tracked and logged, but no supervision-mode-specific behaviour is wired yet, same "stub, not silently ignored" posture as GP's own state_machines/ stubs).
Definition in file ab_ga_route_fsm.h.
| enum ab_ga_route_state_t |
Per-route lifecycle state. Stored raw (uint32_t) on GP's route DB record - keep these values stable.
Definition at line 38 of file ab_ga_route_fsm.h.
| ab_ga_route_fsm_result_t ab_ga_route_fsm_eval | ( | ab_ga_route_state_t | from, |
| const ab_ga_il_route_cmd_t * | cmd ) |
Computes the target state for (from, cmd), WITHOUT logging or touching any storage - pure, for tests and for ab_ga_route_fsm_step() itself.
Definition at line 30 of file ab_ga_route_fsm.c.
| ab_ga_route_fsm_result_t ab_ga_route_fsm_step | ( | ab_gp_db_t * | db, |
| uint16_t | route_id, | ||
| const ab_ga_il_route_cmd_t * | cmd, | ||
| uint32_t | cycle, | ||
| const char * | role_tag ) |
Applies cmd to the route's FSM: reads the current state via ab_gp_db_route_get_fsm_state(), computes the target (ab_ga_route_fsm_eval), logs the transition at INFO (STUB targets logged as "not implemented yet"), and writes the target back via ab_gp_db_route_set_fsm_state().
| [in] | db | GP route DB handle (ga_interface.h). |
| [in] | route_id | Route the command concerns (must already be tracked). |
| [in] | cmd | Decoded, already-validated IL route command. |
| [in] | cycle | Cyclic-executive count, for the log line. |
| [in] | role_tag | Role string for the log line. |
Definition at line 123 of file ab_ga_route_fsm.c.