RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Loading...
Searching...
No Matches
ab_gp_channel_checkpoint.h File Reference

rte_channel_t OSAdapter for the built-in AppManager checkpoint (ADR-019 addendum, rewired onto rte_voter_t by ADR-025), wrapping the same peer link ab_gp_channel_io.c already uses. A single rte_channel_t is registered into a 1-channel NMR voter (quorum_size == 1) - the "channel" handle rte_channel hands back to these callbacks is a ab_gp_channel_context_t itself (see ab_gp_channel_context_t::checkpoint_channel_handle). More...

#include <stddef.h>
#include <stdint.h>
#include "rte/utils/status/rte_status.h"
Include dependency graph for ab_gp_channel_checkpoint.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

rte_status_t ab_gp_channel_checkpoint_backend_send (void *channel, const void *data, size_t data_size)
 rte_channel_send_fn for the checkpoint transport: wraps the given rte_vital_message_t in a PEER_MSG_KIND_CHECKPOINT_REQUEST frame and sends it on the peer link. The matching reply is NOT waited for here - ab_gp_channel_io.c's peer rx task auto-responds to the peer's own REQUEST with a REPLY on its side, and ab_gp_channel_checkpoint_backend_recv() below is what waits for OUR REQUEST's REPLY to come back.
rte_status_t ab_gp_channel_checkpoint_backend_recv (void *channel, void *data, size_t data_size, uint32_t timeout_ms)
 rte_channel_recv_fn for the checkpoint transport: waits (bounded by timeout_ms) for a PEER_MSG_KIND_CHECKPOINT_REPLY to arrive in ctx->checkpoint_reply_slot - written by ab_gp_channel_io.c's peer rx task, the only thread that ever calls rte_netlink_receive() on the peer link.

Detailed Description

rte_channel_t OSAdapter for the built-in AppManager checkpoint (ADR-019 addendum, rewired onto rte_voter_t by ADR-025), wrapping the same peer link ab_gp_channel_io.c already uses. A single rte_channel_t is registered into a 1-channel NMR voter (quorum_size == 1) - the "channel" handle rte_channel hands back to these callbacks is a ab_gp_channel_context_t itself (see ab_gp_channel_context_t::checkpoint_channel_handle).

Definition in file ab_gp_channel_checkpoint.h.

Function Documentation

◆ ab_gp_channel_checkpoint_backend_send()

rte_status_t ab_gp_channel_checkpoint_backend_send ( void * channel,
const void * data,
size_t data_size )

rte_channel_send_fn for the checkpoint transport: wraps the given rte_vital_message_t in a PEER_MSG_KIND_CHECKPOINT_REQUEST frame and sends it on the peer link. The matching reply is NOT waited for here - ab_gp_channel_io.c's peer rx task auto-responds to the peer's own REQUEST with a REPLY on its side, and ab_gp_channel_checkpoint_backend_recv() below is what waits for OUR REQUEST's REPLY to come back.

Parameters
channelThis ab_gp_channel_context_t, as void* (rte_channel's own opaque-handle convention).
dataThe rte_vital_message_t to send.
data_sizeMust be exactly sizeof(rte_vital_message_t).
Returns
RTE_STATUS_OK on success; RTE_STATUS_INVALID_PARAM for a bad argument; RTE_STATUS_HARDWARE_FAULT if the peer link is currently down; otherwise whatever rte_netlink_send() itself returns. Sends under ctx->peer_send_mutex - see ab_gp_channel_types.h's own doc for why.

Global functions

Definition at line 64 of file ab_gp_channel_checkpoint.c.

◆ ab_gp_channel_checkpoint_backend_recv()

rte_status_t ab_gp_channel_checkpoint_backend_recv ( void * channel,
void * data,
size_t data_size,
uint32_t timeout_ms )

rte_channel_recv_fn for the checkpoint transport: waits (bounded by timeout_ms) for a PEER_MSG_KIND_CHECKPOINT_REPLY to arrive in ctx->checkpoint_reply_slot - written by ab_gp_channel_io.c's peer rx task, the only thread that ever calls rte_netlink_receive() on the peer link.

Parameters
channelThis ab_gp_channel_context_t, as void*.
dataDestination for the received rte_vital_message_t.
data_sizeMust be exactly sizeof(rte_vital_message_t).
timeout_msMaximum time to wait for a NEW reply.
Returns
RTE_STATUS_OK with *data populated if a fresh reply arrived in time; RTE_STATUS_INVALID_PARAM for a bad argument; RTE_STATUS_TIMEOUT if none arrived within timeout_ms.

Definition at line 173 of file ab_gp_channel_checkpoint.c.