|
Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
"Channel" layer of ADR-020 - see rte_dual_msgchannel.h. More...
#include "rte/redundancy/dual/rte_dual_msgchannel.h"Go to the source code of this file.
Functions | |
| rte_status_t | rte_dual_msgchannel_init (rte_dual_msgchannel_t *channel, const rte_dual_msgchannel_config_t *config) |
| Initializes a rte_dual_msgchannel_t: starts both sequence counters at 0. | |
| rte_status_t | rte_dual_msgchannel_send (rte_dual_msgchannel_t *channel, const uint8_t *payload, uint8_t payload_size, rte_duration_ms_t timeout_ms, uint32_t *out_sequence) |
| Wraps payload in a rte_vital_message_t (this channel's own sender_id and next sequence_number) and sends it over config->link, blocking at most timeout_ms. | |
| rte_status_t | rte_dual_msgchannel_receive (rte_dual_msgchannel_t *channel, uint8_t *out_payload, uint8_t payload_max_size, rte_duration_ms_t timeout_ms, uint8_t *out_payload_size, uint32_t *out_sequence) |
| Receives one frame over config->link, blocking at most timeout_ms, verifies its CRC-64 and sequence continuity (rte_checksum_vital_message_verify() against channel->expected_sequence) and its sender_id against config->expected_peer_id, and extracts the payload. | |
| rte_status_t | rte_dual_msgchannel_reset_sequence (rte_dual_msgchannel_t *channel) |
| Resets both sequence counters to 0. Intended to be called by the caller (typically rte_dual_channel_t) exactly once, immediately after config->link has been freshly (re)established with the peer - the same idea as a mechanism RBC_GP once had and has since removed (2026-10-04): a cycle-counter reset after a peer-link reconnect. A fresh link needs a fresh, mutually agreed starting sequence rather than fighting over whatever counters were left over from before the disconnect. | |
| rte_status_t | rte_dual_msgchannel_set_resync_on_sequence_error (rte_dual_msgchannel_t *channel, bool enable) |
| Turns sequence resynchronisation on or off (default off after init). | |
"Channel" layer of ADR-020 - see rte_dual_msgchannel.h.
Definition in file rte_dual_msgchannel.c.