RTE RBC 2oo2 Reference Application
0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Toggle main menu visibility
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
38
typedef
uint32_t
ab_gp_channel_payload_collector_id_t
;
39
51
typedef
void (*
ab_gp_channel_payload_encode_fn
)(
void
*context,
const
void
*items, uint8_t *out);
52
62
typedef
void (*
ab_gp_channel_payload_decode_fn
)(
void
*context,
const
uint8_t *in,
void
*out_items);
63
89
rte_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,
91
ab_gp_channel_payload_collector_id_t
*out_id);
92
106
void
ab_gp_channel_payload_encode_collector
(
ab_gp_channel_payload_collector_id_t
id
, uint8_t *out,
const
void
*items);
107
110
void
ab_gp_channel_payload_decode_collector
(
ab_gp_channel_payload_collector_id_t
id
,
const
uint8_t *in,
void
*out_items);
111
124
void
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
138
rte_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 */
ab_gp_channel_payload_decode_collector
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,...
Definition
ab_gp_channel_payload.c:88
ab_gp_channel_payload_encode_ab_sample
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...
Definition
ab_gp_channel_payload.c:99
ab_gp_channel_payload_register_collector
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...
Definition
ab_gp_channel_payload.c:43
ab_gp_channel_payload_encode_collector
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....
Definition
ab_gp_channel_payload.c:77
ab_gp_channel_payload_decode_ab_sample
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.
Definition
ab_gp_channel_payload.c:117
ab_gp_channel_payload_encode_fn
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...
Definition
ab_gp_channel_payload.h:51
ab_gp_channel_payload_decode_fn
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...
Definition
ab_gp_channel_payload.h:62
ab_gp_channel_payload_collector_id_t
uint32_t ab_gp_channel_payload_collector_id_t
Opaque handle to a registered collector - returned by ab_gp_channel_payload_register_collector() belo...
Definition
ab_gp_channel_payload.h:38
AB_GP_CHANNEL_PAYLOAD_MAX_COLLECTORS
#define AB_GP_CHANNEL_PAYLOAD_MAX_COLLECTORS
Definition
ab_gp_channel_payload.h:31
ab_gp_channel_types.h
Modular type definitions for AB channel components (Com, Train, DB, Redundancy).
AB_SAMPLE_WIRE_SIZE
#define AB_SAMPLE_WIRE_SIZE
Definition
ab_gp_channel_types.h:41
src
application
AB
GP
com
ab_gp_channel_payload.h
Generated by
1.18.0