|
Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Bounded cross-channel synchronization for distributed vital channels. More...
Files | |
| file | src/redundancy/checkpoint/sapi_checkpoint.c |
| Implementation of the bounded checkpoint rendezvous (ADR-017). | |
Data Structures | |
| struct | sapi_checkpoint_config_t |
| Checkpoint configuration. More... | |
Functions | |
| sapi_status_t | sapi_channel_checkpoint (sapi_voter_t *voter, const sapi_checkpoint_config_t *config) |
| Performs one bounded checkpoint rendezvous across every channel registered with a voter. | |
Bounded cross-channel synchronization for distributed vital channels.
REQ-CHECKPOINT-001: sapi_channel_checkpoint() shall never block longer than config->max_delay_ms. REQ-CHECKPOINT-002: a checkpoint-arrival reply that fails CRC verification or carries a different checkpoint_id shall not count toward expected_node_count. REQ-CHECKPOINT-003: if fewer than expected_node_count valid replies arrive within max_delay_ms, sapi_channel_checkpoint() shall call sapi_safestate_enter() at SAPI_SAFESTATE_LEVEL_SAFE with SAPI_SAFESTATE_REASON_CHECKPOINT_TIMEOUT before returning SAPI_STATUS_TIMEOUT.
| sapi_status_t sapi_channel_checkpoint | ( | sapi_voter_t * | voter, |
| const sapi_checkpoint_config_t * | config ) |
Performs one bounded checkpoint rendezvous across every channel registered with a voter.
Broadcasts a checkpoint-arrival message (config->checkpoint_id) to every one of voter's registered channels (via each channel's own sapi_channel_send()), then polls each channel's sapi_channel_receive() bounded by config->max_delay_ms, counting only replies that pass sapi_checksum_vital_message_verify() and carry the matching checkpoint_id. This is direct per-channel I/O, not a sapi_voter_send()/_receive() voting round - checkpoint messages are rendezvous markers, not data to vote on.
| voter | Voter with 1+ channels already registered (sapi_voter_register_channel()). Must not be NULL. |
| config | Checkpoint configuration. Must not be NULL. |
Definition at line 198 of file sapi_checkpoint.c.