Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_voter_config_t Struct Reference

Configuration for rte_voter_init(). More...

#include <rte_voter.h>

Data Fields

rte_voting_strategy_t voting_strategy
uint32_t quorum_size
uint32_t channel_timeout_ms
rte_voter_compare_fn compare
void * compare_context
bool log_disagreements
rte_safestate_level_t safestate_level
rte_safestate_reason_t safestate_reason
void(*) on_disagreement (void *context, rte_voting_result_t result)
void * disagreement_context

Detailed Description

Configuration for rte_voter_init().

Definition at line 87 of file rte_voter.h.

Field Documentation

◆ voting_strategy

rte_voting_strategy_t rte_voter_config_t::voting_strategy

Voting strategy.

Definition at line 89 of file rte_voter.h.

◆ quorum_size

uint32_t rte_voter_config_t::quorum_size

Required agreeing-channel count for RTE_VOTING_NMR (ignored for 2OO2/2OO3, which have a fixed quorum of 2).

Definition at line 92 of file rte_voter.h.

◆ channel_timeout_ms

uint32_t rte_voter_config_t::channel_timeout_ms

Timeout for each channel's receive operation (milliseconds).

Definition at line 94 of file rte_voter.h.

◆ compare

rte_voter_compare_fn rte_voter_config_t::compare

Optional custom comparison callback; NULL -> memcmp default.

Definition at line 96 of file rte_voter.h.

◆ compare_context

void* rte_voter_config_t::compare_context

User context passed to compare().

Definition at line 98 of file rte_voter.h.

◆ log_disagreements

bool rte_voter_config_t::log_disagreements

Log a disagreement via rte_log_write() when it occurs.

Definition at line 100 of file rte_voter.h.

◆ safestate_level

rte_safestate_level_t rte_voter_config_t::safestate_level

Safe-state level entered unconditionally on a DISAGREED result, after on_disagreement (below) has already run. RCA/OCORA PI-API compatibility note (see docs/rca/RCA_CONCEPT.dox at the workspace root, and rte_cross_comparator.h's own identical note): the Platform, not the application, owns this decision - replaces the old bool trigger_safestate_on_disagreement (which let a caller opt OUT of transitioning at all). A voter instance that is provably never able to disagree (e.g. a single-channel RTE_VOTING_NMR quorum_size==1 registration, where the "group" of one channel trivially always meets quorum) can safely leave this zero-initialized (RTE_SAFESTATE_LEVEL_DEGRADED) since the DISAGREED branch can never actually be reached for it.

Definition at line 113 of file rte_voter.h.

◆ safestate_reason

rte_safestate_reason_t rte_voter_config_t::safestate_reason

Diagnostic reason code passed to the safestate transition above.

Definition at line 115 of file rte_voter.h.

◆ on_disagreement

void(*) rte_voter_config_t::on_disagreement(void *context, rte_voting_result_t result)

Optional callback invoked whenever rte_voter_receive() does not return RTE_VOTING_AGREED (DISAGREED/TIMEOUT/INSUFFICIENT_QUORUM), BEFORE the unconditional safestate transition above for a DISAGREED result - the application's one chance to react (e.g. clean up its own state) before control does not return. Do this work synchronously; there is no "after" for a SAFE/REBOOT-level transition (REQ-COMMON-SAFESTATE-002). For TIMEOUT/ INSUFFICIENT_QUORUM results (which never trigger the transition above), this callback simply fires and rte_voter_receive() returns normally afterward.

Definition at line 126 of file rte_voter.h.

◆ disagreement_context

void* rte_voter_config_t::disagreement_context

User context passed to on_disagreement().

Definition at line 128 of file rte_voter.h.


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