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_logic.h
Go to the documentation of this file.
1
64#ifndef RTE_EXAMPLE_AB_GP_LOGIC_H
65#define RTE_EXAMPLE_AB_GP_LOGIC_H
66
67#include <stdbool.h>
68#include <stdint.h>
69
70#include "rte/utils/status/rte_status.h"
71
72#include "../db/ab_gp_db.h"
73
79
97#ifndef AB_GP_LOGIC_ROUTE_VALIDATOR_FN_DEFINED
98#define AB_GP_LOGIC_ROUTE_VALIDATOR_FN_DEFINED
99typedef bool (*ab_gp_logic_route_validator_fn)(void *context, uint16_t route_id, uint8_t train_id);
100#endif
101
105#define AB_GP_LOGIC_MAX_ROUTE_VALIDATORS 2U
106
130rte_status_t ab_gp_ga_register_init(ab_gp_logic_route_validator_fn fn, void *context);
132
158bool ab_gp_logic_connect_route_for_train(ab_gp_db_t *db, uint8_t train_id);
159
169
172#ifndef AB_GP_LOGIC_SHUNTING_VALIDATOR_FN_DEFINED
173#define AB_GP_LOGIC_SHUNTING_VALIDATOR_FN_DEFINED
177typedef bool (*ab_gp_logic_shunting_validator_fn)(void *context, uint8_t train_id);
178#endif
179
181#define AB_GP_LOGIC_MAX_SHUNTING_VALIDATORS 2U
182
193
198bool ab_gp_logic_shunting_allowed(uint8_t train_id);
200
201#endif /* RTE_EXAMPLE_AB_GP_LOGIC_H */
A/B's own simplified Train/Route database - fixed-size arrays describing the domain objects logic/ (p...
bool ab_gp_logic_connect_route_for_train(ab_gp_db_t *db, uint8_t train_id)
Connects one train's own currently-reported route to it: looks up which route the balise at db->train...
bool ab_gp_logic_shunting_allowed(uint8_t train_id)
Asks every registered shunting validator about train_id.
Definition ab_gp_logic.c:92
void ab_gp_logic_connect_routes_and_trains(ab_gp_db_t *db)
THE cyclic sweep: calls ab_gp_logic_connect_route_for_train() for every currently-connected train (ab...
bool(*) ab_gp_logic_shunting_validator_fn(void *context, uint8_t train_id)
rte_status_t ab_gp_ga_register_shunting_validator(ab_gp_logic_shunting_validator_fn fn, void *context)
Definition ab_gp_logic.c:69
bool(*) ab_gp_logic_route_validator_fn(void *context, uint16_t route_id, uint8_t train_id)
rte_status_t ab_gp_ga_register_init(ab_gp_logic_route_validator_fn fn, void *context)
Definition ab_gp_logic.c:46