SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
Loading...
Searching...
No Matches
gateway_c_ctc_handler.h
Go to the documentation of this file.
1#ifndef SAFEAPI_EXAMPLE_GATEWAY_C_CTC_HANDLER_H
2#define SAFEAPI_EXAMPLE_GATEWAY_C_CTC_HANDLER_H
3
9
10#include "gateway_c_types.h"
11
12typedef struct
13{
14 /* --- CTCSim-facing (one channel) --- */
15 sapi_channel_service_t sim_channel;
16
17 /* --- A/B-facing (one dedicated relay channel per peer) --- */
18 sapi_channel_service_t relay_channel[GATEWAY_C_PEER_COUNT];
19 uint8_t relay_consecutive_timeout; /* peer A only */
20 sapi_timestamp_ms_t relay_down_since_ms[GATEWAY_C_PEER_COUNT];
21 uint32_t a_seen_this_cycle;
22 unsigned int a_stale_cycles;
23 const char *last_known_tag;
25
26sapi_status_t gateway_c_ctc_handler_init(gateway_c_context_t *ctx);
27void gateway_c_ctc_handler_execute(gateway_c_context_t *ctx, uint32_t cycle);
28void gateway_c_ctc_handler_shutdown(void);
29bool gateway_c_ctc_handler_check_link_down(sapi_timestamp_ms_t threshold_ms, sapi_timestamp_ms_t now_ms,
30 char *out_which, size_t which_size);
31
32#endif /* SAFEAPI_EXAMPLE_GATEWAY_C_CTC_HANDLER_H */