|
Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
"DualChannel" layer of ADR-020 - see rte_dual_channel.h. More...
#include "rte/redundancy/dual/rte_dual_channel.h"#include <string.h>#include "rte/oal/timer/rte_timer.h"Go to the source code of this file.
Data Structures | |
| struct | dual_poll_result_t |
| Result of one dual_channel_poll_link_once() attempt. More... | |
Macros | |
| #define | RTE_DUAL_CHANNEL_STALL_POLL_LIMIT 32U |
| Cap on consecutive rte_dual_channel_send() ACK-wait polls that may complete without rte_timer_now() showing any measurable progress, before that link's wait loop gives up on this round - see that loop's own comment for why more than one such iteration is legitimate but an unbounded number is not. | |
Functions | |
| static rte_dual_channel_status_t | dual_channel_compute_status (const rte_dual_channel_t *channel) |
| static void | dual_channel_update_status (rte_dual_channel_t *channel) |
| static rte_status_t | dual_channel_poll_link_once (rte_dual_channel_t *channel, uint32_t link_index, rte_duration_ms_t timeout_ms, dual_poll_result_t *out_result) |
| One receive attempt on one link, dispatched by frame kind: DATA is auto-ACKed and staged for rte_dual_channel_receive(); STATE is staged for rte_dual_channel_receive_state_frame(); ACK is reported back to the caller (rte_dual_channel_send()'s own wait loop) via *out_result, not staged anywhere. | |
| rte_status_t | rte_dual_channel_init (rte_dual_channel_t *channel, const rte_dual_channel_config_t *config) |
| Initializes a rte_dual_channel_t: initializes every configured redundant link (rte_dual_msgchannel_init()) and starts rte_dual_channel_get_status() at RTE_DUAL_CHANNEL_STATUS_DOWN (no traffic has been sent/received yet). | |
| static bool | dual_channel_send_to_link_and_wait_ack (rte_dual_channel_t *channel, uint32_t i, const uint8_t *frame, uint8_t frame_size, bool *saw_hard_fault, rte_status_t *hard_fault_status) |
| rte_status_t | rte_dual_channel_send (rte_dual_channel_t *channel, const uint8_t *payload, uint8_t payload_size, uint32_t *out_ack_link_count) |
| Sends payload as a DATA frame on every configured redundant link - never gated by any negotiated state (ADR-020 section 2: the real payload traffic itself is the liveness check). For each link, waits up to config->ack_timeout_ms for that link's own ACK (matched by sequence number, not just "an ACK arrived") before moving on; a DATA or STATE frame received from the peer while waiting is still auto-ACKed/staged as a side effect, not dropped. | |
| rte_status_t | rte_dual_channel_receive (rte_dual_channel_t *channel, uint8_t *out_payload, uint8_t max_size, rte_duration_ms_t timeout_ms, uint8_t *out_size) |
| Returns the most recently staged inbound DATA frame, actively polling the configured links (each auto-ACked on arrival - see rte_dual_channel_send()'s own doc) if none was already staged from a previous rte_dual_channel_send() call's own incidental polling. | |
| rte_status_t | rte_dual_channel_send_heartbeat (rte_dual_channel_t *channel, uint32_t *out_ack_link_count) |
| Transmits a connection maintenance heartbeat frame across every configured link and waits up to ack_timeout_ms for an ACK on each. | |
| rte_status_t | rte_dual_channel_send_state_frame (rte_dual_channel_t *channel, rte_dual_state_t state, bool channel_degraded, uint64_t timestamp_ms) |
| Sends a rte_dual_state_frame_t (rte_dual_frames.h) on every configured redundant link - fire-and-forget, no ACK wait (unlike rte_dual_channel_send()'s DATA frames), matching the periodic-beacon nature of state negotiation. Intended to be called by a rte_dual_negotiator_t, not directly by application code - see ADR-020 section 3. | |
| rte_status_t | rte_dual_channel_receive_state_frame (rte_dual_channel_t *channel, rte_duration_ms_t timeout_ms, rte_dual_state_frame_t *out_frame) |
| Returns the most recently staged inbound STATE frame, actively polling the configured links if none was already staged. Intended to be called by a rte_dual_negotiator_t - see ADR-020 section 3. | |
| rte_dual_channel_status_t | rte_dual_channel_get_status (const rte_dual_channel_t *channel) |
| Returns the aggregate connection status across every configured redundant link, as of the most recent rte_dual_channel_send() call (ADR-020 section 2). RTE_DUAL_CHANNEL_STATUS_DOWN before the first send. | |
| bool | rte_dual_channel_is_link_up (const rte_dual_channel_t *channel, uint32_t link_index) |
| Returns whether one specific configured link is currently considered up, as of the most recent rte_dual_channel_send() call - for diagnostics/logging (e.g. which specific redundant path is the one that's down), not a safety-decision input on its own (see rte_dual_channel_get_status() for the aggregate). | |
| rte_status_t | rte_dual_channel_set_resync_on_sequence_error (rte_dual_channel_t *channel, bool enable) |
"DualChannel" layer of ADR-020 - see rte_dual_channel.h.
Definition in file rte_dual_channel.c.
| #define RTE_DUAL_CHANNEL_STALL_POLL_LIMIT 32U |
Cap on consecutive rte_dual_channel_send() ACK-wait polls that may complete without rte_timer_now() showing any measurable progress, before that link's wait loop gives up on this round - see that loop's own comment for why more than one such iteration is legitimate but an unbounded number is not.
Definition at line 17 of file rte_dual_channel.c.
|
static |
Definition at line 27 of file rte_dual_channel.c.
|
static |
Definition at line 51 of file rte_dual_channel.c.
|
static |
One receive attempt on one link, dispatched by frame kind: DATA is auto-ACKed and staged for rte_dual_channel_receive(); STATE is staged for rte_dual_channel_receive_state_frame(); ACK is reported back to the caller (rte_dual_channel_send()'s own wait loop) via *out_result, not staged anywhere.
Definition at line 74 of file rte_dual_channel.c.
|
static |
Definition at line 240 of file rte_dual_channel.c.