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_payload.h
Go to the documentation of this file.
1#ifndef RTE_EXAMPLE_AB_GP_CHANNEL_PAYLOAD_H
2#define RTE_EXAMPLE_AB_GP_CHANNEL_PAYLOAD_H
3
21
22#include <stdbool.h>
23#include <stdint.h>
24
25#include "rte/utils/status/rte_status.h"
26
27#include "ab_gp_channel_types.h"
28
31#define AB_GP_CHANNEL_PAYLOAD_MAX_COLLECTORS 4U
32
39
51typedef void (*ab_gp_channel_payload_encode_fn)(void *context, const void *items, uint8_t *out);
52
62typedef void (*ab_gp_channel_payload_decode_fn)(void *context, const uint8_t *in, void *out_items);
63
89rte_status_t ab_gp_channel_payload_register_collector(uint32_t wire_size, ab_gp_channel_payload_encode_fn encode_fn,
90 ab_gp_channel_payload_decode_fn decode_fn, void *context,
92
107
110void ab_gp_channel_payload_decode_collector(ab_gp_channel_payload_collector_id_t id, const uint8_t *in, void *out_items);
111
124void ab_gp_channel_payload_encode_ab_sample(uint8_t out[AB_SAMPLE_WIRE_SIZE], uint32_t cycle,
125 const void *const sources[AB_GP_CHANNEL_PAYLOAD_MAX_COLLECTORS]);
126
138rte_status_t ab_gp_channel_payload_decode_ab_sample(uint8_t in[AB_SAMPLE_WIRE_SIZE], uint32_t *out_cycle,
139 void *const dests[AB_GP_CHANNEL_PAYLOAD_MAX_COLLECTORS]);
140
141#endif /* RTE_EXAMPLE_AB_GP_CHANNEL_PAYLOAD_H */
void ab_gp_channel_payload_decode_collector(ab_gp_channel_payload_collector_id_t id, const uint8_t *in, void *out_items)
Decodes one collector's own items - see ab_gp_channel_payload_encode_collector() (same contract,...
void ab_gp_channel_payload_encode_ab_sample(uint8_t out[AB_SAMPLE_WIRE_SIZE], uint32_t cycle, const void *const sources[AB_GP_CHANNEL_PAYLOAD_MAX_COLLECTORS])
Encodes an A<->B peer-link sample: {cycle, every registered collector's own bytes in registration ord...
rte_status_t ab_gp_channel_payload_register_collector(uint32_t wire_size, ab_gp_channel_payload_encode_fn encode_fn, ab_gp_channel_payload_decode_fn decode_fn, void *context, ab_gp_channel_payload_collector_id_t *out_id)
Registers a collector: a module's own fixed-size contribution to the combined A<->B payload - a fan-o...
void ab_gp_channel_payload_encode_collector(ab_gp_channel_payload_collector_id_t id, uint8_t *out, const void *items)
Encodes one collector's own items into its own slice of a combined buffer - used both standalone (e....
rte_status_t ab_gp_channel_payload_decode_ab_sample(uint8_t in[AB_SAMPLE_WIRE_SIZE], uint32_t *out_cycle, void *const dests[AB_GP_CHANNEL_PAYLOAD_MAX_COLLECTORS])
Decodes and CRC-64-verifies an A<->B peer-link sample.
void(*) ab_gp_channel_payload_encode_fn(void *context, const void *items, uint8_t *out)
Encodes a collector's own whole item array into its own wire_size-byte slice of a combined buffer - t...
void(*) ab_gp_channel_payload_decode_fn(void *context, const uint8_t *in, void *out_items)
Decodes a collector's own whole item array from its own wire_size-byte slice - see ab_gp_channel_payl...
uint32_t ab_gp_channel_payload_collector_id_t
Opaque handle to a registered collector - returned by ab_gp_channel_payload_register_collector() belo...
#define AB_GP_CHANNEL_PAYLOAD_MAX_COLLECTORS
Modular type definitions for AB channel components (Com, Train, DB, Redundancy).
#define AB_SAMPLE_WIRE_SIZE