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_ertms_train_message_codec.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "ab_gp_ertms_train_interface.h"
Include dependency graph for ab_gp_ertms_train_message_codec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RBC_TRAIN_MAX_WIRE_MSG_SIZE   512U

Functions

bool rbc_train_codec_encode_track_to_train (const rbc_train_outbound_msg_t *msg, uint8_t *out_buffer, size_t buffer_size, size_t *out_bytes_written)
 Encodes an outbound Track-to-Train message (Msg 2, 3, 6, 8, 9, 15, 16, 18, 24, 33, 34, 41) into wire bytes.
bool rbc_train_codec_decode_train_to_track (const uint8_t *in_buffer, size_t buffer_size, rbc_train_inbound_msg_t *out_msg)
 Decodes an inbound Train-to-Track message (Msg 129, 130, 132, 136, 146, 147, 150, 155, 156, 159) from wire bytes.

Macro Definition Documentation

◆ RBC_TRAIN_MAX_WIRE_MSG_SIZE

#define RBC_TRAIN_MAX_WIRE_MSG_SIZE   512U

Definition at line 28 of file ab_gp_ertms_train_message_codec.h.

Function Documentation

◆ rbc_train_codec_encode_track_to_train()

bool rbc_train_codec_encode_track_to_train ( const rbc_train_outbound_msg_t * msg,
uint8_t * out_buffer,
size_t buffer_size,
size_t * out_bytes_written )

Encodes an outbound Track-to-Train message (Msg 2, 3, 6, 8, 9, 15, 16, 18, 24, 33, 34, 41) into wire bytes.

Parameters
[in]msgStructured message to encode.
[out]out_bufferTarget buffer to receive encoded bytes.
[in]buffer_sizeCapacity of out_buffer (must be >= RBC_TRAIN_MAX_WIRE_MSG_SIZE).
[out]out_bytes_writtenReturns actual number of bytes written.
Returns
true on success, false if buffer too small or parameters invalid.

Definition at line 30 of file ab_gp_ertms_train_message_codec.c.

◆ rbc_train_codec_decode_train_to_track()

bool rbc_train_codec_decode_train_to_track ( const uint8_t * in_buffer,
size_t buffer_size,
rbc_train_inbound_msg_t * out_msg )

Decodes an inbound Train-to-Track message (Msg 129, 130, 132, 136, 146, 147, 150, 155, 156, 159) from wire bytes.

Parameters
[in]in_bufferInput raw wire bytes.
[in]buffer_sizeNumber of bytes available in in_buffer.
[out]out_msgTarget structured message struct to populate.
Returns
true on success, false if format is invalid or corrupted.

Definition at line 264 of file ab_gp_ertms_train_message_codec.c.