|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
ERTMS/ETCS Level 2 Message-Level Codec Implementation (GP). More...
#include "ab_gp_ertms_train_message_codec.h"#include "ab_gp_ertms_train_packet_codec.h"#include "rte/oal/memory/rte_mem_util.h"Go to the source code of this file.
Functions | |
| static void | write_track_to_train_header (uint8_t *buf, size_t cap, size_t *offset, const rbc_track_to_train_header_t *h) |
| 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. | |
ERTMS/ETCS Level 2 Message-Level Codec Implementation (GP).
See ab_gp_ertms_train_message_codec.h for this file's role relative to ab_gp_ertms_train_packet_codec.c - this file owns message structure (which packets a NID_MESSAGE carries, in what order, any has_X optionality) and calls into that one for every packet's own wire layout, so a packet shared by more than one message (Packet 15/MA: Msg 3 and Msg 9) is encoded once.
Definition in file ab_gp_ertms_train_message_codec.c.
|
static |
Writes the common Track-to-Train radio header (Subset-026 8.4.1) shared by every case in rbc_train_codec_encode_track_to_train()'s own switch.
Definition at line 19 of file ab_gp_ertms_train_message_codec.c.
| 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.
| [in] | msg | Structured message to encode. |
| [out] | out_buffer | Target buffer to receive encoded bytes. |
| [in] | buffer_size | Capacity of out_buffer (must be >= RBC_TRAIN_MAX_WIRE_MSG_SIZE). |
| [out] | out_bytes_written | Returns actual number of bytes written. |
Definition at line 30 of file ab_gp_ertms_train_message_codec.c.
| 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.
| [in] | in_buffer | Input raw wire bytes. |
| [in] | buffer_size | Number of bytes available in in_buffer. |
| [out] | out_msg | Target structured message struct to populate. |
Definition at line 264 of file ab_gp_ertms_train_message_codec.c.