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_channel.h
Go to the documentation of this file.
1#ifndef RTE_EXAMPLE_AB_GP_CHANNEL_H
2#define RTE_EXAMPLE_AB_GP_CHANNEL_H
3
4#include <stdbool.h>
5#include <stddef.h>
6#include <stdint.h>
7
8#include "rte/app/appmanager/rte_appmanager.h"
9#include "rte/utils/status/rte_status.h"
10
13#include "ab_gp_channel_types.h"
14
18typedef struct ab_gp_channel_context_s *ab_gp_channel_handle_t;
19
23rte_status_t ab_gp_channel_open_link(bool is_role_a, rte_example_site_t site, ab_gp_channel_handle_t *out_handle);
24
29
34
39
44
49
54
59
64
69
74
78const rte_appmanager_checkpoint_config_t *ab_gp_channel_checkpoint_config(ab_gp_channel_handle_t handle);
79
83rte_status_t ab_gp_channel_init(void *context);
84
88rte_status_t ab_gp_channel_shutdown(void *context);
89
94
100
105
110
115 uint8_t index, const uint8_t *bytes, size_t size);
116
120rte_status_t ab_gp_channel_send_peer(ab_gp_channel_handle_t handle, const uint8_t *bytes, size_t size);
133
137rte_status_t ab_gp_channel_send_crosscompare(ab_gp_channel_handle_t handle, uint8_t kind, const uint8_t *payload, size_t size);
138
169 const char *log_message);
170
171#endif /* RTE_EXAMPLE_AB_GP_CHANNEL_H */
rte_status_t ab_gp_channel_saf_train_setup(ab_gp_channel_handle_t handle)
Reads RTE_SAFECOMM_TRAIN_RBC_ID and sets up the train-link SaF termination: unset leaves it off (plai...
rte_status_t ab_gp_channel_open_link(bool is_role_a, rte_example_site_t site, ab_gp_channel_handle_t *out_handle)
Opens this process's own A<->B peer channel and C relay channels.
void ab_gp_channel_relay_queues_setup(ab_gp_channel_handle_t handle)
Initializes relay queues (no-op in single-threaded channel_service).
rte_status_t ab_gp_channel_cycle_timer_setup(ab_gp_channel_handle_t handle)
Creates and starts periodic cycle timer.
ab_gp_saf_train_t * ab_gp_channel_saf_train(ab_gp_channel_handle_t handle)
This channel's train-link SaF termination (ab_gp_saf_train.h), or NULL for a NULL handle.
void ab_gp_channel_close_link(ab_gp_channel_handle_t handle)
Full teardown of a channel opened by ab_gp_channel_open_link().
void ab_gp_channel_poll_peer(ab_gp_channel_handle_t handle, ab_gp_com_peer_frame_cb cb, void *user_ctx)
Polls the A<->B peer channel non-blockingly and invokes cb for every received frame.
rte_status_t ab_gp_channel_send_peer(ab_gp_channel_handle_t handle, const uint8_t *bytes, size_t size)
Sends a frame over the A<->B peer channel.
rte_status_t ab_gp_channel_ga_setup(ab_gp_channel_handle_t handle)
GA registration for ma_logic_adaptation / il / ctc.
rte_status_t ab_gp_channel_negotiate_setup(ab_gp_channel_handle_t handle)
Opens inter-site negotiation link and runs startup tie-break.
rte_status_t ab_gp_channel_send_relay(ab_gp_channel_handle_t handle, rte_example_relay_kind_t kind, uint8_t index, const uint8_t *bytes, size_t size)
Sends an envelope over a specific C relay channel.
const rte_appmanager_checkpoint_config_t * ab_gp_channel_checkpoint_config(ab_gp_channel_handle_t handle)
Accessor for checkpoint config.
uint32_t ab_gp_channel_poll_relays(ab_gp_channel_handle_t handle, ab_gp_com_envelope_cb cb, void *user_ctx)
Polls all C relay channels non-blockingly and invokes cb for every received envelope.
rte_status_t ab_gp_channel_shutdown(void *context)
rte_appmanager_operations_t::shutdown hook.
rte_status_t ab_gp_channel_crosscompare_setup(ab_gp_channel_handle_t handle)
Creates cross-comparator on an already-open channel.
void ab_gp_channel_raise_ctc_alarm(ab_gp_channel_handle_t handle, rbc_alarm_severity_t severity, uint32_t code, const char *log_message)
Raises a severity-leveled operational alarm: logs it locally (rte_log_write_event(),...
rte_status_t ab_gp_channel_dual_setup(ab_gp_channel_handle_t handle)
Wires dual-transfer liveness watchdog.
rte_status_t ab_gp_channel_init(void *context)
rte_appmanager_operations_t::init hook.
rte_status_t ab_gp_channel_checkpoint_setup(ab_gp_channel_handle_t handle)
Wires AppManager checkpoint mechanism onto peer channel.
rte_status_t ab_gp_channel_train_codec_setup(ab_gp_channel_handle_t handle)
GP-internal registration for train codec.
rte_status_t ab_gp_channel_watchdog_setup(ab_gp_channel_handle_t handle)
Arms general health watchdog.
rte_status_t ab_gp_channel_send_crosscompare(ab_gp_channel_handle_t handle, uint8_t kind, const uint8_t *payload, size_t size)
Sends a frame over the dedicated A<->B cross-compare channel.
rte_status_t ab_gp_channel_wait_cycle_tick(ab_gp_channel_handle_t handle)
Waits for the periodic cycle timer tick, advances cycle, and refreshes watchdog/checkpoint state.
void ab_gp_channel_poll_crosscompare(ab_gp_channel_handle_t handle, ab_gp_com_peer_frame_cb cb, void *user_ctx)
Polls the dedicated A<->B cross-compare channel non-blockingly and invokes cb for every received fram...
struct ab_gp_channel_context_s * ab_gp_channel_handle_t
Opaque handle over this component's own static per-process context.
Modular type definitions for AB channel components (Com, Train, DB, Redundancy).
void(*) ab_gp_com_peer_frame_cb(void *user_ctx, uint8_t kind, const uint8_t *payload, size_t size)
void(*) ab_gp_com_envelope_cb(void *user_ctx, rte_example_relay_kind_t kind, uint8_t index, const uint8_t *bytes)
The RBC Train/IL/CTC scenario's shared wire envelope (ADR-029) - one fixed-size struct/frame reused f...
rbc_alarm_severity_t
Severity of an RBC_MSG_CTC_ALARM envelope (msg_type field on the wire) - deliberately a small,...
West/East site identity and the per-site config derived from it (ports, container host lookup) - see ...
rte_example_site_t
Definition site_config.h:20
rte_example_relay_kind_t
Which client type a C<->A/C<->B relay link/port belongs to - this project's own dedicated-channel-per...
Definition site_config.h:39
One channel's train-link SaF termination.