SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
Loading...
Searching...
No Matches
gateway_c_il_handler.h
Go to the documentation of this file.
1#ifndef SAFEAPI_EXAMPLE_GATEWAY_C_IL_HANDLER_H
2#define SAFEAPI_EXAMPLE_GATEWAY_C_IL_HANDLER_H
3
13
14#include "gateway_c_types.h"
15
16typedef struct
17{
18 /* --- ILSim-facing (one multiplexed channel) --- */
19 sapi_channel_service_t sim_channel;
20
21 /* --- A/B-facing (one dedicated relay channel per peer) --- */
22 sapi_channel_service_t relay_channel[GATEWAY_C_PEER_COUNT];
23 uint8_t relay_consecutive_timeout;
24 sapi_timestamp_ms_t relay_down_since_ms[GATEWAY_C_PEER_COUNT];
25 uint32_t a_seen_this_cycle;
26 unsigned int a_stale_cycles;
27 const char *last_known_tag;
29
30sapi_status_t gateway_c_il_handler_init(gateway_c_context_t *ctx);
31void gateway_c_il_handler_execute(gateway_c_context_t *ctx, uint32_t cycle);
32void gateway_c_il_handler_shutdown(void);
33bool gateway_c_il_handler_check_link_down(sapi_timestamp_ms_t threshold_ms, sapi_timestamp_ms_t now_ms,
34 char *out_which, size_t which_size);
35
44void gateway_c_il_handler_broadcast_to_ab(const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE]);
45
46#endif /* SAFEAPI_EXAMPLE_GATEWAY_C_IL_HANDLER_H */
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...