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
gateway_c_service_def_t Struct Reference

One gateway service's identity and its single handler's entry points - a pure-literal table each main_c_<svc>.c defines and passes to gateway_c_main(). More...

#include <gateway_c_common.h>

Data Fields

const char * app_name
const char * log_tag
rte_status_t(*) handler_init (gateway_c_context_t *ctx)
void(*) handler_execute (gateway_c_context_t *ctx, uint32_t cycle)
void(*) handler_shutdown (void)
bool(*) handler_check_link_down (rte_timestamp_ms_t threshold_ms, rte_timestamp_ms_t now_ms, char *out_which, size_t which_size)
void(*) pre_execute_hook (gateway_c_context_t *ctx)
const char * broker_channel
uint8_t status_src_id
void(*) idle_hook (gateway_c_context_t *ctx)

Detailed Description

One gateway service's identity and its single handler's entry points - a pure-literal table each main_c_<svc>.c defines and passes to gateway_c_main().

Definition at line 35 of file gateway_c_common.h.

Field Documentation

◆ app_name

const char* gateway_c_service_def_t::app_name

appmanager app name, e.g. "safeAPIRBC2oo2-Gateway-Train" - also the per-service log source tag stem. Must not be NULL.

Definition at line 39 of file gateway_c_common.h.

◆ log_tag

const char* gateway_c_service_def_t::log_tag

Short upper-case tag for log lines, e.g. "TRAIN". Must not be NULL.

Definition at line 41 of file gateway_c_common.h.

◆ handler_init

rte_status_t(*) gateway_c_service_def_t::handler_init(gateway_c_context_t *ctx)

This service's one handler. handler_init/_execute/_shutdown must not be NULL; handler_check_link_down must not be NULL.

Definition at line 45 of file gateway_c_common.h.

◆ handler_execute

void(*) gateway_c_service_def_t::handler_execute(gateway_c_context_t *ctx, uint32_t cycle)

Definition at line 46 of file gateway_c_common.h.

◆ handler_shutdown

void(*) gateway_c_service_def_t::handler_shutdown(void)

Definition at line 47 of file gateway_c_common.h.

◆ handler_check_link_down

bool(*) gateway_c_service_def_t::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 48 of file gateway_c_common.h.

◆ pre_execute_hook

void(*) gateway_c_service_def_t::pre_execute_hook(gateway_c_context_t *ctx)

Optional per-cycle hook run BEFORE handler_execute() - IL passes gateway_c_logctl_poll here, Train/CTC pass NULL.

Definition at line 53 of file gateway_c_common.h.

◆ broker_channel

const char* gateway_c_service_def_t::broker_channel

ADR-038: if non-NULL, gateway_c_common CONNECTs this broker channel ("c-broker-train"/"-il"/"-ctc") and publishes a STATUS heartbeat + logs a self line every RTE_EXAMPLE_STATUS_PERIOD_MS. The status service itself passes NULL (it IS the broker).

Definition at line 59 of file gateway_c_common.h.

◆ status_src_id

uint8_t gateway_c_service_def_t::status_src_id

rbc_util_source_t for this service's STATUS publications (only used when broker_channel is set).

Definition at line 62 of file gateway_c_common.h.

◆ idle_hook

void(*) gateway_c_service_def_t::idle_hook(gateway_c_context_t *ctx)

Optional hook run repeatedly while the service waits for its next cycle tick (every ~5 ms, between handler_execute() calls); NULL for none. The status service drains its A/B util links here so an A/B link open handshake is answered promptly (ISS-020).

Definition at line 67 of file gateway_c_common.h.


The documentation for this struct was generated from the following file: