47#ifndef RTE_DUAL_CHANNEL_H
48#define RTE_DUAL_CHANNEL_H
66#define RTE_DUAL_CHANNEL_MAX_LINKS 4U
72#define RTE_DUAL_CHANNEL_MAX_PAYLOAD (RTE_DUAL_MSGCHANNEL_MAX_PAYLOAD - 4U)
94typedef struct rte_dual_channel_s
101 void *status_callback_ctx;
104 bool pending_data_valid;
106 uint8_t pending_data_size;
108 bool pending_state_valid;
113typedef struct rte_dual_channel_config_s
190 const uint8_t *payload,
191 uint8_t payload_size,
192 uint32_t *out_ack_link_count);
222 uint8_t *out_payload,
267 bool channel_degraded, uint64_t timestamp_ms);
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_du...
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 w...
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 stat...
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_in...
rte_dual_channel_status_t
Aggregate connection status of a rte_dual_channel_t across all of its configured redundant links (ADR...
void(*) rte_dual_channel_status_callback_t(rte_dual_channel_status_t new_status, rte_dual_channel_status_t old_status, void *user_ctx)
Optional callback invoked whenever rte_dual_channel_get_status()'s value changes (ADR-020 section 2's...
rte_status_t rte_dual_channel_send_heartbeat(rte_dual_channel_t *channel, uint32_t *out_ack_count)
Transmits a connection maintenance heartbeat frame across every configured link and waits up to ack_t...
rte_dual_state_t
State of one instance in a dual (two-redundant-instance) relationship, as decided by rte_dual_negotia...
#define RTE_DUAL_CHANNEL_MAX_PAYLOAD
Max application payload bytes usable via rte_dual_channel_send()/_receive() - Layer-1's own RTE_DUAL_...
#define RTE_DUAL_CHANNEL_MAX_LINKS
Maximum number of redundant links one rte_dual_channel_t may be configured with. Fixed,...
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_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...
rte_status_t rte_dual_channel_set_resync_on_sequence_error(rte_dual_channel_t *channel, bool enable)
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-forg...
struct rte_netlink_impl_s * rte_netlink_handle_t
Opaque handle to an established link, returned by rte_netlink_open().
rte_status_t
Common result/status codes.
uint32_t rte_duration_ms_t
Layer-2 (DualChannel-owned) frame kind/header definitions for ADR-020 - shared between rte_dual_chann...
"Channel" layer of ADR-020: one EN 50159-defended message channel over one already-open rte_netlink_h...
Shared enums for the rte_dual module (ADR-020): dual-instance state negotiation and the redundant,...
OS Abstraction Layer - Point-to-point network link service.
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
Configuration for rte_dual_channel_init().
uint32_t expected_peer_id
rte_dual_channel_status_callback_t status_callback
rte_duration_ms_t ack_timeout_ms
void * status_callback_ctx
rte_netlink_handle_t links[RTE_DUAL_CHANNEL_MAX_LINKS]
One rte_dual_channel_t instance's state. Caller-owned storage; every field is private - reach it only...
One rte_dual_msgchannel_t instance's state. Caller-owned storage (REQ-DUAL-MSGCHANNEL-001); opaque in...
RTE_DUAL_FRAME_KIND_STATE payload - rte_dual_negotiator_t's own periodic beacon.