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_dual.c
Go to the documentation of this file.
1
6
7#include <stdio.h>
8
9#include "rte/oal/log/rte_log.h"
10
12
14
16
18
20
22
23
26{
28
29 if (!ctx->single_mode)
30 {
31 RTE_EXAMPLE_LOG("[%s] dual transfer lost - no peer message within %ums - entering SINGLE mode\n", ctx->role_tag,
32 (unsigned int)ctx->config.timers.dual_transfer_timeout_ms);
33 rte_log_write_event(RTE_LOG_LEVEL_ERROR, site_config_name(ctx->site), 0U, ctx->role_tag, "-", "MODE",
34 "dual transfer lost - entering SINGLE mode", NULL);
35 ctx->single_mode = true;
36 }
37}
38
39const char *ab_gp_channel_dual_role_byte_to_string(uint8_t role_byte)
40{
41 if (role_byte == (uint8_t)RTE_EXAMPLE_SITE_ROLE_ONLINE)
42 {
43 return "ONLINE";
44 }
45 if (role_byte == (uint8_t)RTE_EXAMPLE_SITE_ROLE_STANDBY)
46 {
47 return "STANDBY";
48 }
49 if (role_byte == (uint8_t)RTE_EXAMPLE_SITE_ROLE_FAULTED)
50 {
51 return "FAULTED";
52 }
53 return "UNKNOWN";
54}
const char * ab_gp_channel_dual_role_byte_to_string(uint8_t role_byte)
void ab_gp_channel_dual_on_transfer_lost(void *context)
Everything related to this channel's own "dual transfer" state: the single-mode degradation reaction ...
#define RTE_EXAMPLE_SITE_ROLE_STANDBY
#define RTE_EXAMPLE_LOG(...)
#define RTE_EXAMPLE_SITE_ROLE_ONLINE
#define RTE_EXAMPLE_SITE_ROLE_FAULTED
const char * site_config_name(rte_example_site_t site)
Definition site_config.c:52
Central application context owned by composition root (main.c).
ab_gp_config_timers_t timers
uint32_t dual_transfer_timeout_ms