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
common_config.h File Reference
#include <stdio.h>
#include "rte/utils/safestate/rte_safestate.h"
#include "rte/oal/timer/rte_timer.h"
#include "rte/oal/log/rte_log.h"
Include dependency graph for common_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RTE_EXAMPLE_LOG(...)
#define RTE_LOG_WRITE_EVENT(level, site, cycle, source, dest, type, info, extra)
#define RTE_LOG_WRITE_EVENT_F(level, site, cycle, source, dest, type, info_fmt, ...)
#define RTE_EXAMPLE_WEST_PORT_BASE   15001U
#define RTE_EXAMPLE_EAST_PORT_BASE   15101U
#define RTE_EXAMPLE_MAX_TRAINS   2U
#define RTE_EXAMPLE_MAX_ROUTES   8U
#define RTE_EXAMPLE_MAX_ROUTES_PER_TRAIN   4U
#define RTE_EXAMPLE_AB_PORT_OFFSET   0U
#define RTE_EXAMPLE_AB_CROSSCOMPARE_PORT_OFFSET   16U
#define RTE_EXAMPLE_C_FOR_A_TRAIN_PORT_OFFSET   1U
#define RTE_EXAMPLE_C_FOR_A_IL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_A_TRAIN_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_A_CTC_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_A_IL_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_A_UTIL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_A_CTC_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_B_TRAIN_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_A_UTIL_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_B_IL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_B_TRAIN_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_B_CTC_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_B_IL_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_B_UTIL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_B_CTC_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_TRAIN_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_B_UTIL_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_IL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_TRAIN_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_CTC_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_IL_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_BROKER_TRAIN_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_CTC_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_BROKER_IL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_BROKER_TRAIN_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_C_FOR_BROKER_CTC_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_BROKER_IL_PORT_OFFSET + 1U)
#define RTE_EXAMPLE_A_NEGOTIATION_PORT   15021U
#define RTE_EXAMPLE_B_NEGOTIATION_PORT   15022U
#define RTE_EXAMPLE_LOCALHOST   "127.0.0.1"
#define RTE_EXAMPLE_C_HOST_ENV   "RTE_EXAMPLE_C_HOST"
#define RTE_EXAMPLE_A_HOST_ENV   "RTE_EXAMPLE_A_HOST"
#define RTE_EXAMPLE_REMOTE_A_HOST_ENV   "RTE_EXAMPLE_REMOTE_A_HOST"
#define RTE_EXAMPLE_REMOTE_B_HOST_ENV   "RTE_EXAMPLE_REMOTE_B_HOST"
#define RTE_EXAMPLE_LINK_TIMEOUT_MS   300U
#define RTE_EXAMPLE_NEG_ACK_TIMEOUT_MS   50U
#define RTE_EXAMPLE_UTIL_REOPEN_BACKOFF_MS   5000U
#define RTE_EXAMPLE_UTIL_OPEN_ATTEMPT_TIMEOUT_MS   20U
#define RTE_EXAMPLE_ERTMS_CONTACT_TIMEOUT_MS   20000U
#define RTE_EXAMPLE_STATUS_PERIOD_MS   5000U
#define RTE_EXAMPLE_STATUS_STALE_MS   15000U
#define RTE_EXAMPLE_CONNECT_TIMEOUT_MS   10000U
#define RTE_EXAMPLE_RECONNECT_ATTEMPT_TIMEOUT_MS   1000U
#define RTE_EXAMPLE_LINK_STALE_TIMEOUT_COUNT   4U
#define RTE_EXAMPLE_CHECKPOINT_REENABLE_GRACE_MS   15000U
#define RTE_EXAMPLE_CHANNEL_DOWN_REBOOT_MS   20000U
#define RTE_EXAMPLE_NEG_SEND_MISS_THRESHOLD   3U
#define RTE_EXAMPLE_AB_CYCLE_PERIOD_MS   500U
#define RTE_EXAMPLE_AB_WATCHDOG_TIMEOUT_MS   600U
#define RTE_EXAMPLE_AB_CHECKPOINT_MAX_DELAY_MS   400U
#define RTE_EXAMPLE_AB_CHECKPOINT_RELAXED_MAX_DELAY_MS   10000U
#define RTE_EXAMPLE_CHECKPOINT_RELAX_DURATION_MS   15000U
#define RTE_EXAMPLE_AB_CHECKPOINT_LOOKBACK_CYCLES   2U
#define RTE_EXAMPLE_AB_DUAL_TRANSFER_TIMEOUT_MS   (RTE_EXAMPLE_AB_CYCLE_PERIOD_MS * 20U)
#define RTE_EXAMPLE_C_A_STALE_CYCLE_LIMIT   (RTE_EXAMPLE_AB_DUAL_TRANSFER_TIMEOUT_MS / RTE_EXAMPLE_C_REPORT_PERIOD_MS)
#define RTE_EXAMPLE_C_REPORT_PERIOD_MS   600U
#define RTE_EXAMPLE_AB_CYCLE_SKEW_TOLERANCE   20U
#define RTE_EXAMPLE_XCOMPARE_SYNC_SKIP_LIMIT   10U
#define RTE_EXAMPLE_NEGOTIATION_WATCHDOG_TIMEOUT_MS
#define RTE_EXAMPLE_SITE_ROLE_ONLINE   1U
#define RTE_EXAMPLE_SITE_ROLE_STANDBY   0U
#define RTE_EXAMPLE_SITE_ROLE_FAULTED   2U
#define RTE_EXAMPLE_SITE_ROLE_VALID_MARKER   0xA5U
#define RTE_EXAMPLE_SINGLE_MODE_FLAG_DUAL   0U
#define RTE_EXAMPLE_SINGLE_MODE_FLAG_SINGLE   1U
#define RTE_EXAMPLE_DB_ROUTE_WIRE_SIZE   12U
#define RTE_EXAMPLE_DB_TRAIN_WIRE_SIZE   16U
#define RTE_EXAMPLE_DB_WIRE_SIZE
#define RTE_EXAMPLE_SITE_EXTRA_PAYLOAD_SESSION_SIZE   19U
#define RTE_EXAMPLE_SITE_EXTRA_PAYLOAD_SIZE
#define RTE_EXAMPLE_AB_SITE_STATE_WIRE_SIZE   3U
#define RTE_EXAMPLE_TRANSFER_POLICY_ENV   "RTE_EXAMPLE_TRANSFER_POLICY"
#define RTE_EXAMPLE_TRANSFER_ASK_USER_TIMEOUT_MS   2000U
#define RTE_EXAMPLE_CRC64_POLYNOMIAL   RTE_CRC64_ERTMS
#define RTE_EXAMPLE_REASON_AB_CRC_MISMATCH   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 1U))
#define RTE_EXAMPLE_REASON_AB_MTYPE_DISAGREE   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 2U))
#define RTE_EXAMPLE_REASON_NEGOTIATION_LINK_LOST   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 3U))
#define RTE_EXAMPLE_REASON_AB_SITE_STATE_MISMATCH   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 4U))
#define RTE_EXAMPLE_REASON_AB_PEER_LINK_DOWN   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 5U))
#define RTE_EXAMPLE_REASON_C_LINK_DOWN   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 6U))
#define RTE_EXAMPLE_REASON_C_MONITOR_LINK_DOWN   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 7U))
#define RTE_EXAMPLE_MSG_M136   136U
#define RTE_EXAMPLE_MSG_M24   24U
#define RTE_EXAMPLE_MSG_P0   0U
#define RTE_EXAMPLE_MSG_M3   3U
#define RTE_EXAMPLE_MSG_M146   146U
#define RTE_EXAMPLE_MA_ROUTE_LENGTH_M   500U
#define RTE_EXAMPLE_MA_OVERLAP_M   0U
#define RBC_ENVELOPE_WIRE_SIZE   96U
#define RBC_TRAIN_ENVELOPE_WIRE_SIZE   512U
#define RTE_EXAMPLE_REBOOT_DELAY_MS   5000U

Enumerations

enum  rte_example_transfer_policy_t { RTE_EXAMPLE_TRANSFER_POLICY_RESTART = 0 , RTE_EXAMPLE_TRANSFER_POLICY_CONTINUE = 1 , RTE_EXAMPLE_TRANSFER_POLICY_ASK_USER = 2 }
 Policy applied to the transferred cycle counter at the moment a standby channel is promoted to ONLINE - see ab_gp_channel_negotiate.c's own apply_state_transfer(). More...

Macro Definition Documentation

◆ RTE_EXAMPLE_LOG

#define RTE_EXAMPLE_LOG ( ...)
Value:
do \
{ \
rte_timestamp_ms_t rte_example_log_ts_ = 0U; \
(void)rte_timer_now(&rte_example_log_ts_); \
printf("[%10llu] ", (unsigned long long)rte_example_log_ts_); \
printf(__VA_ARGS__); \
(void)fflush(stdout); \
} while (0)

Millisecond-resolution timestamp prefix for every console log line in this example, sourced from the same rte_timer_now() the structured rte_log_write_event() lines already stamp themselves with (see common_config.h's own users) - so a raw stdout/log-file capture is orderable and diffable by time even without the structured log line next to it (e.g. skimming dist/logs/<role>.log by eye). Degrades to 0 if no timer OSAdapter is registered, same best-effort convention rte_log_write_event()'s own Timestamp field already uses. Used in place of a bare printf() everywhere in this example's own console output.

Definition at line 20 of file common_config.h.

◆ RTE_LOG_WRITE_EVENT

#define RTE_LOG_WRITE_EVENT ( level,
site,
cycle,
source,
dest,
type,
info,
extra )
Value:
rte_log_write_event((level), (site), (cycle), (source), (dest), (type), (info), (extra))

Structured-event log for this reference app.

RTE_LOG_WRITE_EVENT(level, site, cycle, source, dest, type, info, extra)

  • a plain UPPER-CASE alias for rte_log_write_event(); use it so every structured-log call site in this app reads the same way. Pass NULL for extra when there are no extra Key=Value fields.

RTE_LOG_WRITE_EVENT_F(level, site, cycle, source, dest, type, info_fmt, ...)

  • printf-style: info_fmt + its args are rendered into a local fixed buffer (RTE_LOG_EVENT_LINE_MAX_LEN, truncated not overrun) and passed as the info field, so variable values go straight in the text without hand-building a string. Same printf-family posture as RTE_EXAMPLE_LOG above - this is reference-app tooling, not the SIL library (the library's own non-variadic way to interpolate values is rte_log_fields_t / rte_log_write_event_fields(), rte_log.h).

Definition at line 47 of file common_config.h.

◆ RTE_LOG_WRITE_EVENT_F

#define RTE_LOG_WRITE_EVENT_F ( level,
site,
cycle,
source,
dest,
type,
info_fmt,
... )
Value:
do \
{ \
char rte_lwe_info_[RTE_LOG_EVENT_LINE_MAX_LEN]; \
(void)snprintf(rte_lwe_info_, sizeof(rte_lwe_info_), (info_fmt), __VA_ARGS__); \
rte_log_write_event((level), (site), (cycle), (source), (dest), (type), \
rte_lwe_info_, NULL); \
} while (0)

Definition at line 50 of file common_config.h.

◆ RTE_EXAMPLE_WEST_PORT_BASE

#define RTE_EXAMPLE_WEST_PORT_BASE   15001U

Definition at line 98 of file common_config.h.

◆ RTE_EXAMPLE_EAST_PORT_BASE

#define RTE_EXAMPLE_EAST_PORT_BASE   15101U

Definition at line 99 of file common_config.h.

◆ RTE_EXAMPLE_MAX_TRAINS

#define RTE_EXAMPLE_MAX_TRAINS   2U

Definition at line 107 of file common_config.h.

◆ RTE_EXAMPLE_MAX_ROUTES

#define RTE_EXAMPLE_MAX_ROUTES   8U

Definition at line 121 of file common_config.h.

◆ RTE_EXAMPLE_MAX_ROUTES_PER_TRAIN

#define RTE_EXAMPLE_MAX_ROUTES_PER_TRAIN   4U

Definition at line 130 of file common_config.h.

◆ RTE_EXAMPLE_AB_PORT_OFFSET

#define RTE_EXAMPLE_AB_PORT_OFFSET   0U

Definition at line 139 of file common_config.h.

◆ RTE_EXAMPLE_AB_CROSSCOMPARE_PORT_OFFSET

#define RTE_EXAMPLE_AB_CROSSCOMPARE_PORT_OFFSET   16U

Definition at line 140 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_A_TRAIN_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_A_TRAIN_PORT_OFFSET   1U

Definition at line 152 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_A_IL_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_A_IL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_A_TRAIN_PORT_OFFSET + 1U)

Definition at line 153 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_A_CTC_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_A_CTC_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_A_IL_PORT_OFFSET + 1U)

Definition at line 155 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_A_UTIL_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_A_UTIL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_A_CTC_PORT_OFFSET + 1U)

Definition at line 157 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_B_TRAIN_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_B_TRAIN_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_A_UTIL_PORT_OFFSET + 1U)

Definition at line 158 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_B_IL_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_B_IL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_B_TRAIN_PORT_OFFSET + 1U)

Definition at line 159 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_B_CTC_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_B_CTC_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_B_IL_PORT_OFFSET + 1U)

Definition at line 161 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_B_UTIL_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_B_UTIL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_B_CTC_PORT_OFFSET + 1U)

Definition at line 162 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_TRAIN_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_TRAIN_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_B_UTIL_PORT_OFFSET + 1U)

Definition at line 170 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_IL_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_IL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_TRAIN_PORT_OFFSET + 1U)

Definition at line 176 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_CTC_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_CTC_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_IL_PORT_OFFSET + 1U)

Definition at line 180 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_BROKER_TRAIN_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_BROKER_TRAIN_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_CTC_PORT_OFFSET + 1U)

Definition at line 185 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_BROKER_IL_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_BROKER_IL_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_BROKER_TRAIN_PORT_OFFSET + 1U)

Definition at line 186 of file common_config.h.

◆ RTE_EXAMPLE_C_FOR_BROKER_CTC_PORT_OFFSET

#define RTE_EXAMPLE_C_FOR_BROKER_CTC_PORT_OFFSET   (RTE_EXAMPLE_C_FOR_BROKER_IL_PORT_OFFSET + 1U)

Definition at line 187 of file common_config.h.

◆ RTE_EXAMPLE_A_NEGOTIATION_PORT

#define RTE_EXAMPLE_A_NEGOTIATION_PORT   15021U

Definition at line 198 of file common_config.h.

◆ RTE_EXAMPLE_B_NEGOTIATION_PORT

#define RTE_EXAMPLE_B_NEGOTIATION_PORT   15022U

Definition at line 199 of file common_config.h.

◆ RTE_EXAMPLE_LOCALHOST

#define RTE_EXAMPLE_LOCALHOST   "127.0.0.1"

Definition at line 201 of file common_config.h.

◆ RTE_EXAMPLE_C_HOST_ENV

#define RTE_EXAMPLE_C_HOST_ENV   "RTE_EXAMPLE_C_HOST"

Definition at line 216 of file common_config.h.

◆ RTE_EXAMPLE_A_HOST_ENV

#define RTE_EXAMPLE_A_HOST_ENV   "RTE_EXAMPLE_A_HOST"

Definition at line 217 of file common_config.h.

◆ RTE_EXAMPLE_REMOTE_A_HOST_ENV

#define RTE_EXAMPLE_REMOTE_A_HOST_ENV   "RTE_EXAMPLE_REMOTE_A_HOST"

Definition at line 218 of file common_config.h.

◆ RTE_EXAMPLE_REMOTE_B_HOST_ENV

#define RTE_EXAMPLE_REMOTE_B_HOST_ENV   "RTE_EXAMPLE_REMOTE_B_HOST"

Definition at line 219 of file common_config.h.

◆ RTE_EXAMPLE_LINK_TIMEOUT_MS

#define RTE_EXAMPLE_LINK_TIMEOUT_MS   300U

Definition at line 239 of file common_config.h.

◆ RTE_EXAMPLE_NEG_ACK_TIMEOUT_MS

#define RTE_EXAMPLE_NEG_ACK_TIMEOUT_MS   50U

Definition at line 240 of file common_config.h.

◆ RTE_EXAMPLE_UTIL_REOPEN_BACKOFF_MS

#define RTE_EXAMPLE_UTIL_REOPEN_BACKOFF_MS   5000U

Definition at line 255 of file common_config.h.

◆ RTE_EXAMPLE_UTIL_OPEN_ATTEMPT_TIMEOUT_MS

#define RTE_EXAMPLE_UTIL_OPEN_ATTEMPT_TIMEOUT_MS   20U

Definition at line 256 of file common_config.h.

◆ RTE_EXAMPLE_ERTMS_CONTACT_TIMEOUT_MS

#define RTE_EXAMPLE_ERTMS_CONTACT_TIMEOUT_MS   20000U

Definition at line 272 of file common_config.h.

◆ RTE_EXAMPLE_STATUS_PERIOD_MS

#define RTE_EXAMPLE_STATUS_PERIOD_MS   5000U

Definition at line 278 of file common_config.h.

◆ RTE_EXAMPLE_STATUS_STALE_MS

#define RTE_EXAMPLE_STATUS_STALE_MS   15000U

Definition at line 279 of file common_config.h.

◆ RTE_EXAMPLE_CONNECT_TIMEOUT_MS

#define RTE_EXAMPLE_CONNECT_TIMEOUT_MS   10000U

Definition at line 310 of file common_config.h.

◆ RTE_EXAMPLE_RECONNECT_ATTEMPT_TIMEOUT_MS

#define RTE_EXAMPLE_RECONNECT_ATTEMPT_TIMEOUT_MS   1000U

Definition at line 320 of file common_config.h.

◆ RTE_EXAMPLE_LINK_STALE_TIMEOUT_COUNT

#define RTE_EXAMPLE_LINK_STALE_TIMEOUT_COUNT   4U

Definition at line 356 of file common_config.h.

◆ RTE_EXAMPLE_CHECKPOINT_REENABLE_GRACE_MS

#define RTE_EXAMPLE_CHECKPOINT_REENABLE_GRACE_MS   15000U

Definition at line 389 of file common_config.h.

◆ RTE_EXAMPLE_CHANNEL_DOWN_REBOOT_MS

#define RTE_EXAMPLE_CHANNEL_DOWN_REBOOT_MS   20000U

Definition at line 419 of file common_config.h.

◆ RTE_EXAMPLE_NEG_SEND_MISS_THRESHOLD

#define RTE_EXAMPLE_NEG_SEND_MISS_THRESHOLD   3U

Definition at line 428 of file common_config.h.

◆ RTE_EXAMPLE_AB_CYCLE_PERIOD_MS

#define RTE_EXAMPLE_AB_CYCLE_PERIOD_MS   500U

Definition at line 500 of file common_config.h.

◆ RTE_EXAMPLE_AB_WATCHDOG_TIMEOUT_MS

#define RTE_EXAMPLE_AB_WATCHDOG_TIMEOUT_MS   600U

Definition at line 501 of file common_config.h.

◆ RTE_EXAMPLE_AB_CHECKPOINT_MAX_DELAY_MS

#define RTE_EXAMPLE_AB_CHECKPOINT_MAX_DELAY_MS   400U

Definition at line 546 of file common_config.h.

◆ RTE_EXAMPLE_AB_CHECKPOINT_RELAXED_MAX_DELAY_MS

#define RTE_EXAMPLE_AB_CHECKPOINT_RELAXED_MAX_DELAY_MS   10000U

Definition at line 568 of file common_config.h.

◆ RTE_EXAMPLE_CHECKPOINT_RELAX_DURATION_MS

#define RTE_EXAMPLE_CHECKPOINT_RELAX_DURATION_MS   15000U

Definition at line 578 of file common_config.h.

◆ RTE_EXAMPLE_AB_CHECKPOINT_LOOKBACK_CYCLES

#define RTE_EXAMPLE_AB_CHECKPOINT_LOOKBACK_CYCLES   2U

Definition at line 603 of file common_config.h.

◆ RTE_EXAMPLE_AB_DUAL_TRANSFER_TIMEOUT_MS

#define RTE_EXAMPLE_AB_DUAL_TRANSFER_TIMEOUT_MS   (RTE_EXAMPLE_AB_CYCLE_PERIOD_MS * 20U)

Definition at line 637 of file common_config.h.

◆ RTE_EXAMPLE_C_A_STALE_CYCLE_LIMIT

#define RTE_EXAMPLE_C_A_STALE_CYCLE_LIMIT   (RTE_EXAMPLE_AB_DUAL_TRANSFER_TIMEOUT_MS / RTE_EXAMPLE_C_REPORT_PERIOD_MS)

Definition at line 652 of file common_config.h.

◆ RTE_EXAMPLE_C_REPORT_PERIOD_MS

#define RTE_EXAMPLE_C_REPORT_PERIOD_MS   600U

Definition at line 664 of file common_config.h.

◆ RTE_EXAMPLE_AB_CYCLE_SKEW_TOLERANCE

#define RTE_EXAMPLE_AB_CYCLE_SKEW_TOLERANCE   20U

Definition at line 698 of file common_config.h.

◆ RTE_EXAMPLE_XCOMPARE_SYNC_SKIP_LIMIT

#define RTE_EXAMPLE_XCOMPARE_SYNC_SKIP_LIMIT   10U

Definition at line 713 of file common_config.h.

◆ RTE_EXAMPLE_NEGOTIATION_WATCHDOG_TIMEOUT_MS

#define RTE_EXAMPLE_NEGOTIATION_WATCHDOG_TIMEOUT_MS
Value:
#define RTE_EXAMPLE_NEG_SEND_MISS_THRESHOLD
#define RTE_EXAMPLE_RECONNECT_ATTEMPT_TIMEOUT_MS
#define RTE_EXAMPLE_NEG_ACK_TIMEOUT_MS
#define RTE_EXAMPLE_AB_CYCLE_PERIOD_MS

Definition at line 740 of file common_config.h.

◆ RTE_EXAMPLE_SITE_ROLE_ONLINE

#define RTE_EXAMPLE_SITE_ROLE_ONLINE   1U

Definition at line 761 of file common_config.h.

◆ RTE_EXAMPLE_SITE_ROLE_STANDBY

#define RTE_EXAMPLE_SITE_ROLE_STANDBY   0U

Definition at line 762 of file common_config.h.

◆ RTE_EXAMPLE_SITE_ROLE_FAULTED

#define RTE_EXAMPLE_SITE_ROLE_FAULTED   2U

Definition at line 763 of file common_config.h.

◆ RTE_EXAMPLE_SITE_ROLE_VALID_MARKER

#define RTE_EXAMPLE_SITE_ROLE_VALID_MARKER   0xA5U

Wire "this payload's fields are meaningful" sentinel - see RTE_EXAMPLE_SITE_EXTRA_PAYLOAD_SIZE's own doc. A purely wire-level valid/not-yet-populated flag byte (there is no NVM region to validate), same value used for this kind of sentinel elsewhere in this codebase's own conventions.

Definition at line 769 of file common_config.h.

◆ RTE_EXAMPLE_SINGLE_MODE_FLAG_DUAL

#define RTE_EXAMPLE_SINGLE_MODE_FLAG_DUAL   0U

Normal: both A and B answering each other.

Definition at line 770 of file common_config.h.

◆ RTE_EXAMPLE_SINGLE_MODE_FLAG_SINGLE

#define RTE_EXAMPLE_SINGLE_MODE_FLAG_SINGLE   1U

Degraded: this site's A/B lost its cross-compare peer.

Definition at line 771 of file common_config.h.

◆ RTE_EXAMPLE_DB_ROUTE_WIRE_SIZE

#define RTE_EXAMPLE_DB_ROUTE_WIRE_SIZE   12U

Definition at line 809 of file common_config.h.

◆ RTE_EXAMPLE_DB_TRAIN_WIRE_SIZE

#define RTE_EXAMPLE_DB_TRAIN_WIRE_SIZE   16U

Definition at line 810 of file common_config.h.

◆ RTE_EXAMPLE_DB_WIRE_SIZE

#define RTE_EXAMPLE_DB_WIRE_SIZE
Value:
#define RTE_EXAMPLE_DB_TRAIN_WIRE_SIZE
#define RTE_EXAMPLE_DB_ROUTE_WIRE_SIZE
#define RTE_EXAMPLE_MAX_ROUTES
#define RTE_EXAMPLE_MAX_TRAINS

Definition at line 811 of file common_config.h.

◆ RTE_EXAMPLE_SITE_EXTRA_PAYLOAD_SESSION_SIZE

#define RTE_EXAMPLE_SITE_EXTRA_PAYLOAD_SESSION_SIZE   19U

Definition at line 815 of file common_config.h.

◆ RTE_EXAMPLE_SITE_EXTRA_PAYLOAD_SIZE

#define RTE_EXAMPLE_SITE_EXTRA_PAYLOAD_SIZE
Value:
#define RTE_EXAMPLE_DB_WIRE_SIZE
#define RTE_EXAMPLE_SITE_EXTRA_PAYLOAD_SESSION_SIZE

Definition at line 816 of file common_config.h.

◆ RTE_EXAMPLE_AB_SITE_STATE_WIRE_SIZE

#define RTE_EXAMPLE_AB_SITE_STATE_WIRE_SIZE   3U

Definition at line 827 of file common_config.h.

◆ RTE_EXAMPLE_TRANSFER_POLICY_ENV

#define RTE_EXAMPLE_TRANSFER_POLICY_ENV   "RTE_EXAMPLE_TRANSFER_POLICY"

Optional env var override, same pattern as RTE_EXAMPLE_C_POSITION_START_ENV: "restart"/"continue"/"ask" (case-insensitive), unset or unrecognized -> RTE_EXAMPLE_TRANSFER_POLICY_CONTINUE.

Definition at line 842 of file common_config.h.

◆ RTE_EXAMPLE_TRANSFER_ASK_USER_TIMEOUT_MS

#define RTE_EXAMPLE_TRANSFER_ASK_USER_TIMEOUT_MS   2000U

Bounded wait for the ASK_USER stdin prompt - short enough that a non-interactive run (e.g. .claude/skills/run-safeAPIRBC2oo2/smoke.sh, which doesn't attach a TTY) doesn't stall the whole demo; stdin is simply closed/empty in that case, so select() returns immediately and the fallback-to-CONTINUE path logs and moves on.

Definition at line 849 of file common_config.h.

◆ RTE_EXAMPLE_CRC64_POLYNOMIAL

#define RTE_EXAMPLE_CRC64_POLYNOMIAL   RTE_CRC64_ERTMS

Definition at line 856 of file common_config.h.

◆ RTE_EXAMPLE_REASON_AB_CRC_MISMATCH

#define RTE_EXAMPLE_REASON_AB_CRC_MISMATCH   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 1U))

Definition at line 868 of file common_config.h.

◆ RTE_EXAMPLE_REASON_AB_MTYPE_DISAGREE

#define RTE_EXAMPLE_REASON_AB_MTYPE_DISAGREE   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 2U))

Definition at line 881 of file common_config.h.

◆ RTE_EXAMPLE_REASON_NEGOTIATION_LINK_LOST

#define RTE_EXAMPLE_REASON_NEGOTIATION_LINK_LOST   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 3U))

Definition at line 910 of file common_config.h.

◆ RTE_EXAMPLE_REASON_AB_SITE_STATE_MISMATCH

#define RTE_EXAMPLE_REASON_AB_SITE_STATE_MISMATCH   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 4U))

Definition at line 923 of file common_config.h.

◆ RTE_EXAMPLE_REASON_AB_PEER_LINK_DOWN

#define RTE_EXAMPLE_REASON_AB_PEER_LINK_DOWN   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 5U))

Definition at line 938 of file common_config.h.

◆ RTE_EXAMPLE_REASON_C_LINK_DOWN

#define RTE_EXAMPLE_REASON_C_LINK_DOWN   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 6U))

Definition at line 949 of file common_config.h.

◆ RTE_EXAMPLE_REASON_C_MONITOR_LINK_DOWN

#define RTE_EXAMPLE_REASON_C_MONITOR_LINK_DOWN   ((rte_safestate_reason_t)(RTE_SAFESTATE_REASON_APPLICATION_BASE + 7U))

Definition at line 960 of file common_config.h.

◆ RTE_EXAMPLE_MSG_M136

#define RTE_EXAMPLE_MSG_M136   136U

Definition at line 984 of file common_config.h.

◆ RTE_EXAMPLE_MSG_M24

#define RTE_EXAMPLE_MSG_M24   24U

Definition at line 985 of file common_config.h.

◆ RTE_EXAMPLE_MSG_P0

#define RTE_EXAMPLE_MSG_P0   0U

Definition at line 1001 of file common_config.h.

◆ RTE_EXAMPLE_MSG_M3

#define RTE_EXAMPLE_MSG_M3   3U

Definition at line 1002 of file common_config.h.

◆ RTE_EXAMPLE_MSG_M146

#define RTE_EXAMPLE_MSG_M146   146U

Definition at line 1003 of file common_config.h.

◆ RTE_EXAMPLE_MA_ROUTE_LENGTH_M

#define RTE_EXAMPLE_MA_ROUTE_LENGTH_M   500U

Definition at line 1009 of file common_config.h.

◆ RTE_EXAMPLE_MA_OVERLAP_M

#define RTE_EXAMPLE_MA_OVERLAP_M   0U

Definition at line 1024 of file common_config.h.

◆ RBC_ENVELOPE_WIRE_SIZE

#define RBC_ENVELOPE_WIRE_SIZE   96U

Definition at line 1074 of file common_config.h.

◆ RBC_TRAIN_ENVELOPE_WIRE_SIZE

#define RBC_TRAIN_ENVELOPE_WIRE_SIZE   512U

Definition at line 1096 of file common_config.h.

◆ RTE_EXAMPLE_REBOOT_DELAY_MS

#define RTE_EXAMPLE_REBOOT_DELAY_MS   5000U

Definition at line 1116 of file common_config.h.

Enumeration Type Documentation

◆ rte_example_transfer_policy_t

Policy applied to the transferred cycle counter at the moment a standby channel is promoted to ONLINE - see ab_gp_channel_negotiate.c's own apply_state_transfer().

Enumerator
RTE_EXAMPLE_TRANSFER_POLICY_RESTART 

Renumber from cycle 0.

RTE_EXAMPLE_TRANSFER_POLICY_CONTINUE 

Keep the transferred cycle as-is (default).

RTE_EXAMPLE_TRANSFER_POLICY_ASK_USER 

Bounded stdin prompt; falls back to CONTINUE.

Definition at line 832 of file common_config.h.