9#include "rte/oal/memory/rte_mem_util.h"
10#include "rte/utils/safestate/rte_safestate.h"
23 const uint8_t *bytes,
size_t size);
41 if (ctx == NULL || bytes == NULL || size == 0U)
43 return RTE_STATUS_INVALID_PARAM;
49 const uint8_t *payload,
size_t size)
54 if ((ctx == NULL) || (payload == NULL) || (size == 0U) || (size > (
sizeof(frame) - 1U)))
56 return RTE_STATUS_INVALID_PARAM;
58 rte_mem_set(frame, 0,
sizeof(frame));
60 rte_mem_copy(&frame[1], payload, size);
65 uint8_t index,
const uint8_t *bytes,
size_t size)
71 return RTE_STATUS_INVALID_PARAM;
79 rte_status_t first_error = RTE_STATUS_OK;
84 return RTE_STATUS_INVALID_PARAM;
115 if ((status != RTE_STATUS_OK) && (first_error == RTE_STATUS_OK))
117 first_error = status;
137 const uint8_t *bytes,
size_t size)
143 return RTE_STATUS_RESOURCE_EXHAUSTED;
145 if (size >
sizeof(entry->
bytes))
147 return RTE_STATUS_INVALID_PARAM;
154 rte_mem_copy(entry->
bytes, bytes, size);
157 return RTE_STATUS_OK;
rte_status_t ab_gp_channel_send_peer(ab_gp_channel_handle_t handle, const uint8_t *bytes, size_t size)
Sends a frame over the A<->B peer channel.
rte_status_t ab_gp_channel_send_relay(ab_gp_channel_handle_t handle, rte_example_relay_kind_t kind, uint8_t index, const uint8_t *bytes, size_t size)
Sends an envelope over a specific C relay channel.
rte_status_t ab_gp_channel_send_crosscompare(ab_gp_channel_handle_t handle, uint8_t kind, const uint8_t *payload, size_t size)
Sends a frame over the dedicated A<->B cross-compare channel.
struct ab_gp_channel_context_s * ab_gp_channel_handle_t
Opaque handle over this component's own static per-process context.
rte_status_t ab_gp_channel_stage_peer(ab_gp_channel_handle_t handle, const uint8_t *bytes, size_t size)
Queues a peer-link send for this cycle - does not transmit yet.
void ab_gp_channel_stage_reset(ab_gp_channel_handle_t handle)
Clears this cycle's pending-send queue.
void ab_gp_channel_discard_pending_sends(ab_gp_channel_handle_t handle)
Discards every send queued this cycle without transmitting it, then clears the queue.
rte_status_t ab_gp_channel_stage_crosscompare(ab_gp_channel_handle_t handle, uint8_t kind, const uint8_t *payload, size_t size)
Queues a crosscompare-link send for this cycle - does not transmit yet.
rte_status_t ab_gp_channel_commit_pending_sends(ab_gp_channel_handle_t handle)
Transmits every send queued this cycle (through the real ab_gp_channel_send_peer()/_send_relay()),...
static rte_status_t stage_entry(ab_gp_channel_context_t *ctx, ab_gp_stage_dest_kind_t dest_kind, rte_example_relay_kind_t relay_kind, uint8_t relay_index, const uint8_t *bytes, size_t size)
rte_status_t ab_gp_channel_stage_relay(ab_gp_channel_handle_t handle, rte_example_relay_kind_t kind, uint8_t index, const uint8_t *bytes, size_t size)
Queues a relay-link send for this cycle - does not transmit yet.
Stage-then-commit output queue for this cycle's own DECISION output (ADR-034): the peer AB_SAMPLE and...
#define PEER_WIRE_FRAME_SIZE
#define AB_GP_MAX_STAGED_SENDS_PER_CYCLE
Stage-then-commit output queue (ADR-034) - see ab_gp_channel_stage.h.
@ AB_GP_STAGE_DEST_CROSSCOMPARE
#define RTE_EXAMPLE_RELAY_KIND_COUNT
rte_example_relay_kind_t
Which client type a C<->A/C<->B relay link/port belongs to - this project's own dedicated-channel-per...
@ RTE_EXAMPLE_RELAY_KIND_TRAIN
Central application context owned by composition root (main.c).
uint32_t staged_send_count
ab_gp_staged_send_t staged_sends[AB_GP_MAX_STAGED_SENDS_PER_CYCLE]
ab_gp_stage_dest_kind_t dest_kind
uint8_t bytes[AB_GP_STAGED_SEND_BYTES_SIZE]
rte_example_relay_kind_t relay_kind