RTE RBC 2oo2 Generic Application 0.1.0 build 308eda7
IL/CTC route and train logic for the RBC_GP reference RBC
Loading...
Searching...
No Matches
gateway_c_il_handler.c File Reference

See gateway_c_il_handler.h. ADR-036: one multiplexed IL sim connection + one relay link per peer; frames forwarded verbatim. More...

#include "gateway_c_il_handler.h"
#include <stdio.h>
#include "rte/oal/memory/rte_mem_util.h"
#include "rte/oal/log/rte_log.h"
#include "common/common_config.h"
#include "common/rbc_util_frame.h"
#include "gateway_c_common.h"
#include "gateway_c_selfstatus.h"
Include dependency graph for gateway_c_il_handler.c:

Go to the source code of this file.

Functions

static const char * peer_name (gateway_c_peer_t peer)
static void broadcast_one (gateway_c_peer_t peer, const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE])
void gateway_c_il_handler_broadcast_to_ab (const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE])
 Sends one RBC_ENVELOPE_WIRE_SIZE frame to BOTH A and B on the IL relay link. Used by gateway_c_logctl.c to fan a diagnostic RBC_MSG_SET_LOG_LEVEL control frame out to the pair; the IL link is the one C<->AB link A/B always poll from C (Train is bidirectional, CTC is AB->C only). Best-effort: a send error is logged, not returned.
rte_status_t gateway_c_il_handler_init (gateway_c_context_t *ctx)
static void send_to_relay (gateway_c_context_t *ctx, gateway_c_peer_t peer, const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE])
static void send_to_sim (gateway_c_context_t *ctx, const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE])
void gateway_c_il_handler_execute (gateway_c_context_t *ctx, uint32_t cycle)
void gateway_c_il_handler_shutdown (void)
bool gateway_c_il_handler_check_link_down (rte_timestamp_ms_t threshold_ms, rte_timestamp_ms_t now_ms, char *out_which, size_t which_size)

Variables

static gateway_c_il_handler_state_t g_il

Detailed Description

See gateway_c_il_handler.h. ADR-036: one multiplexed IL sim connection + one relay link per peer; frames forwarded verbatim.

Definition in file gateway_c_il_handler.c.

Function Documentation

◆ broadcast_one()

void broadcast_one ( gateway_c_peer_t peer,
const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE] )
static

Definition at line 23 of file gateway_c_il_handler.c.

◆ gateway_c_il_handler_broadcast_to_ab()

void gateway_c_il_handler_broadcast_to_ab ( const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE])

Sends one RBC_ENVELOPE_WIRE_SIZE frame to BOTH A and B on the IL relay link. Used by gateway_c_logctl.c to fan a diagnostic RBC_MSG_SET_LOG_LEVEL control frame out to the pair; the IL link is the one C<->AB link A/B always poll from C (Train is bidirectional, CTC is AB->C only). Best-effort: a send error is logged, not returned.

Definition at line 36 of file gateway_c_il_handler.c.

◆ gateway_c_il_handler_check_link_down()

bool gateway_c_il_handler_check_link_down ( rte_timestamp_ms_t threshold_ms,
rte_timestamp_ms_t now_ms,
char * out_which,
size_t which_size )

Definition at line 246 of file gateway_c_il_handler.c.

◆ gateway_c_il_handler_execute()

void gateway_c_il_handler_execute ( gateway_c_context_t * ctx,
uint32_t cycle )

Definition at line 128 of file gateway_c_il_handler.c.

◆ gateway_c_il_handler_init()

rte_status_t gateway_c_il_handler_init ( gateway_c_context_t * ctx)

Definition at line 42 of file gateway_c_il_handler.c.

◆ gateway_c_il_handler_shutdown()

void gateway_c_il_handler_shutdown ( void )

Definition at line 239 of file gateway_c_il_handler.c.

◆ peer_name()

const char * peer_name ( gateway_c_peer_t peer)
static

Definition at line 18 of file gateway_c_il_handler.c.

◆ send_to_relay()

void send_to_relay ( gateway_c_context_t * ctx,
gateway_c_peer_t peer,
const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE] )
static

Definition at line 80 of file gateway_c_il_handler.c.

◆ send_to_sim()

void send_to_sim ( gateway_c_context_t * ctx,
const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE] )
static

Definition at line 114 of file gateway_c_il_handler.c.

Variable Documentation

◆ g_il

Definition at line 16 of file gateway_c_il_handler.c.