|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
See ab_gp_ga_hooks.h and ga_interface.h's own "functions GP calls into GA with" section. More...
#include "ab_gp_ga_hooks.h"#include "rte/utils/buffer/rte_buffer.h"#include "rte/utils/lifecycle/rte_lifecycle.h"#include "rte/utils/notify/rte_notify.h"#include "rte/oal/memory/rte_mem_util.h"#include "rbc_wire_types.h"Go to the source code of this file.
CTC_ALARM wire encoding - GP's own now (moved from GA) | |
Own copy of the fixed-offset RBC envelope wire layout for this ONE kind, same "duplicated per domain, must stay byte-for-byte identical to SimCore's Python mirror" posture every other domain's own wire codec already takes (see AB/GP/train/ab_gp_train.c's own train_wire_encode(), AB/ctc/ab_ga_ctc.c's own ctc_wire_encode()) - this is genuinely a subset of that same layout (alarm never sets the RBC_MSG_CTC_TRAIN_INFO-only nid_lrbg/v_train/m_mode fields, and has no train_id - see rbc_wire_types.h's own file doc for the full layout). | |
| #define | AB_GP_CTC_ALARM_WIRE_HEADER_SIZE 12U |
| #define | AB_GP_CTC_ALARM_WIRE_L_MESSAGE 36U |
| void | ab_gp_build_ctc_alarm (uint8_t out[RBC_ENVELOPE_WIRE_SIZE], rbc_alarm_severity_t severity, uint32_t code, uint32_t cycle, uint32_t timestamp_ms) |
| Builds and wire-encodes an outbound CTC_ALARM envelope - GP's own now (moved from GA, "GP shall provide API to generate
alarm", later session, on direct request: raising an alarm is GP's own decision, not something that needs a GA round trip). See ab_gp_ga_hooks.c's own doc for the wire layout. | |
IL envelope handler - single slot | |
| static ab_gp_il_envelope_handler_list_t | g_il_envelope_handler |
| RTE_DECLARE_CALLBACK_LIST (ab_gp_il_envelope_handler_list_t, ab_gp_il_envelope_handler_fn, 1U) | |
| rte_status_t | ab_gp_register_il_envelope_handler (ab_gp_il_envelope_handler_fn fn, const void *context) |
| bool | ab_gp_dispatch_il_envelope (ab_gp_train_session_t *sessions, ab_gp_db_t *db, const uint8_t env_bytes[RBC_ENVELOPE_WIRE_SIZE], uint32_t cycle, rte_example_site_t site, const char *role_tag) |
| Calls the registered IL envelope handler, if any - see ab_gp_register_il_envelope_handler()'s own doc, ga_interface.h. | |
IL output producer - single slot | |
| static ab_gp_il_output_producer_list_t | g_il_output_producer |
| static ab_gp_il_output_confirm_fn | g_il_output_confirm_fn = NULL |
| RTE_DECLARE_CALLBACK_LIST (ab_gp_il_output_producer_list_t, ab_gp_il_output_producer_fn, 1U) | |
| rte_status_t | ab_gp_register_il_output_producer (ab_gp_il_output_producer_fn fn, ab_gp_il_output_confirm_fn confirm_fn, const void *context) |
| uint8_t | ab_gp_drain_il_outputs (ab_gp_il_pending_output_t out[AB_GP_IL_MAX_PENDING_OUTPUTS]) |
| Calls the registered IL output producer, if any - see ab_gp_register_il_output_producer()'s own doc, ga_interface.h. | |
| void | ab_gp_confirm_il_outputs_sent (void) |
| Calls the registered IL output producer's own confirm callback, if any - see ab_gp_il_output_confirm_fn's own doc, ga_interface.h. post_execute.c must call this ONLY on the cycle it actually forwards the outputs ab_gp_drain_il_outputs() just built to C - never unconditionally right after draining. | |
CTC output producer - single slot | |
| static ab_gp_ctc_output_producer_list_t | g_ctc_output_producer |
| static ab_gp_ctc_output_confirm_fn | g_ctc_output_confirm_fn = NULL |
| RTE_DECLARE_CALLBACK_LIST (ab_gp_ctc_output_producer_list_t, ab_gp_ctc_output_producer_fn, 1U) | |
| rte_status_t | ab_gp_register_ctc_output_producer (ab_gp_ctc_output_producer_fn fn, ab_gp_ctc_output_confirm_fn confirm_fn, const void *context) |
| uint8_t | ab_gp_drain_ctc_outputs (ab_gp_ctc_pending_output_t out[AB_GP_CTC_MAX_PENDING_OUTPUTS]) |
| Calls the registered CTC output producer, if any - see ab_gp_register_ctc_output_producer()'s own doc, ga_interface.h. | |
| void | ab_gp_confirm_ctc_outputs_sent (void) |
| Calls the registered CTC output producer's own confirm callback, if any - same contract as ab_gp_confirm_il_outputs_sent() above. | |
See ab_gp_ga_hooks.h and ga_interface.h's own "functions GP calls into GA with" section.
Three single-slot registrations (one GA instance per channel, so one slot is all that's ever needed - same posture AB/GP/ma_logic/ab_gp_logic.c's own ab_gp_ga_register_init() already takes), plus this project's own CTC_ALARM wire encoder (moved here from GA - "GP shall provide API to generate alarm", later session, on direct request - alarm-raising is GP's own decision, not something that needs a GA round trip at all).
Definition in file ab_gp_ga_hooks.c.
| #define AB_GP_CTC_ALARM_WIRE_HEADER_SIZE 12U |
Definition at line 179 of file ab_gp_ga_hooks.c.
| #define AB_GP_CTC_ALARM_WIRE_L_MESSAGE 36U |
Definition at line 180 of file ab_gp_ga_hooks.c.
| RTE_DECLARE_CALLBACK_LIST | ( | ab_gp_il_envelope_handler_list_t | , |
| ab_gp_il_envelope_handler_fn | , | ||
| 1U | ) |
| rte_status_t ab_gp_register_il_envelope_handler | ( | ab_gp_il_envelope_handler_fn | fn, |
| const void * | context ) |
fn is NULL; RTE_STATUS_INVALID_STATE if the setup phase is already locked; RTE_STATUS_RESOURCE_EXHAUSTED if the one slot is already taken (one handler per channel, same as ab_gp_ga_register_init()). Definition at line 28 of file ab_gp_ga_hooks.c.
| bool ab_gp_dispatch_il_envelope | ( | ab_gp_train_session_t * | sessions, |
| ab_gp_db_t * | db, | ||
| const uint8_t | env_bytes[RBC_ENVELOPE_WIRE_SIZE], | ||
| uint32_t | cycle, | ||
| rte_example_site_t | site, | ||
| const char * | role_tag ) |
Calls the registered IL envelope handler, if any - see ab_gp_register_il_envelope_handler()'s own doc, ga_interface.h.
Definition at line 52 of file ab_gp_ga_hooks.c.
| RTE_DECLARE_CALLBACK_LIST | ( | ab_gp_il_output_producer_list_t | , |
| ab_gp_il_output_producer_fn | , | ||
| 1U | ) |
| rte_status_t ab_gp_register_il_output_producer | ( | ab_gp_il_output_producer_fn | fn, |
| ab_gp_il_output_confirm_fn | confirm_fn, | ||
| const void * | context ) |
Definition at line 76 of file ab_gp_ga_hooks.c.
| uint8_t ab_gp_drain_il_outputs | ( | ab_gp_il_pending_output_t | out[AB_GP_IL_MAX_PENDING_OUTPUTS] | ) |
Calls the registered IL output producer, if any - see ab_gp_register_il_output_producer()'s own doc, ga_interface.h.
Definition at line 101 of file ab_gp_ga_hooks.c.
| void ab_gp_confirm_il_outputs_sent | ( | void | ) |
Calls the registered IL output producer's own confirm callback, if any - see ab_gp_il_output_confirm_fn's own doc, ga_interface.h. post_execute.c must call this ONLY on the cycle it actually forwards the outputs ab_gp_drain_il_outputs() just built to C - never unconditionally right after draining.
Definition at line 110 of file ab_gp_ga_hooks.c.
| RTE_DECLARE_CALLBACK_LIST | ( | ab_gp_ctc_output_producer_list_t | , |
| ab_gp_ctc_output_producer_fn | , | ||
| 1U | ) |
| rte_status_t ab_gp_register_ctc_output_producer | ( | ab_gp_ctc_output_producer_fn | fn, |
| ab_gp_ctc_output_confirm_fn | confirm_fn, | ||
| const void * | context ) |
Definition at line 126 of file ab_gp_ga_hooks.c.
| uint8_t ab_gp_drain_ctc_outputs | ( | ab_gp_ctc_pending_output_t | out[AB_GP_CTC_MAX_PENDING_OUTPUTS] | ) |
Calls the registered CTC output producer, if any - see ab_gp_register_ctc_output_producer()'s own doc, ga_interface.h.
Definition at line 151 of file ab_gp_ga_hooks.c.
| void ab_gp_confirm_ctc_outputs_sent | ( | void | ) |
Calls the registered CTC output producer's own confirm callback, if any - same contract as ab_gp_confirm_il_outputs_sent() above.
Definition at line 160 of file ab_gp_ga_hooks.c.
| void ab_gp_build_ctc_alarm | ( | uint8_t | out[RBC_ENVELOPE_WIRE_SIZE], |
| rbc_alarm_severity_t | severity, | ||
| uint32_t | code, | ||
| uint32_t | cycle, | ||
| uint32_t | timestamp_ms ) |
Builds and wire-encodes an outbound CTC_ALARM envelope - GP's own now (moved from GA, "GP shall provide API to generate alarm", later session, on direct request: raising an alarm is GP's own decision, not something that needs a GA round trip). See ab_gp_ga_hooks.c's own doc for the wire layout.
| severity | Alarm severity (rbc_alarm_severity_t). |
| code | Caller-supplied numeric alarm code. |
| cycle | This channel's own current cycle number, or 0 if not applicable. |
| timestamp_ms | Caller-supplied origination timestamp. |
| out | Destination, exactly RBC_ENVELOPE_WIRE_SIZE bytes. Must not be NULL. |
Definition at line 184 of file ab_gp_ga_hooks.c.
|
static |
Definition at line 26 of file ab_gp_ga_hooks.c.
|
static |
Definition at line 68 of file ab_gp_ga_hooks.c.
|
static |
Definition at line 74 of file ab_gp_ga_hooks.c.
|
static |
Definition at line 122 of file ab_gp_ga_hooks.c.
|
static |
Definition at line 124 of file ab_gp_ga_hooks.c.