15#include "rte/oal/memory/rte_mem_util.h"
33 size_t *out_bytes_written)
37 if (msg == NULL || out_buffer == NULL || out_bytes_written == NULL || buffer_size < 32U)
256 out_buffer[1] = (uint8_t)((offset >> 8) & 0xFFU);
257 out_buffer[2] = (uint8_t)(offset & 0xFFU);
259 *out_bytes_written = offset;
269 uint8_t nid_message = 0U;
270 uint16_t l_message = 0U;
271 uint32_t t_train = 0U;
272 uint32_t nid_engine = 0U;
274 if (in_buffer == NULL || out_msg == NULL || buffer_size < 11U)
279 rte_mem_set(out_msg, 0,
sizeof(*out_msg));
297 uint32_t l_train = 0U;
333 uint8_t q_marqst = 0U;
355 uint8_t nid_packet = 0U;
427 uint8_t accepted = 0U;
465 uint8_t m_version = 0U;
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,...
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,...
#define RBC_MSG_TRACK_TO_TRAIN_CONDITIONAL_EMERGENCY_STOP
#define RBC_MSG_TRAIN_TO_TRACK_POSITION_REPORT
#define RBC_MSG_TRAIN_TO_TRACK_INIT_SESSION
#define RBC_MSG_TRAIN_TO_TRACK_REQUEST_FOR_SHUNTING
#define RBC_MSG_TRACK_TO_TRAIN_SH_REFUSED
#define RBC_MSG_TRACK_TO_TRAIN_REQUEST_SHORTEN_MA
#define RBC_MSG_TRACK_TO_TRAIN_RECOGNITION_EXIT_SR
#define RBC_MSG_TRAIN_TO_TRACK_END_OF_MISSION
#define RBC_MSG_TRAIN_TO_TRACK_VALIDATED_TRAIN_DATA
#define RBC_MSG_TRACK_TO_TRAIN_TRACK_AHEAD_FREE_REQUEST
#define RBC_MSG_TRACK_TO_TRAIN_MOVEMENT_AUTHORITY
#define RBC_MSG_TRACK_TO_TRAIN_REVOCATION_EMERGENCY_STOP
#define RBC_MSG_TRACK_TO_TRAIN_GENERAL_MESSAGE
#define RBC_MSG_TRACK_TO_TRAIN_RBC_TRANSITION_ORDER
#define RBC_MSG_TRAIN_TO_TRACK_ACK_EMERGENCY_STOP
#define RBC_MSG_TRAIN_TO_TRACK_MA_REQUEST
#define RBC_MSG_TRAIN_TO_TRACK_TERMINATE_SESSION
#define RBC_MSG_TRACK_TO_TRAIN_SESSION_TERMINATION_ORDER
#define RBC_MSG_TRAIN_TO_TRACK_ACKNOWLEDGEMENT
#define RBC_MSG_TRACK_TO_TRAIN_SH_AUTHORISED
#define RBC_MSG_TRACK_TO_TRAIN_SR_AUTHORISATION
#define RBC_MSG_TRACK_TO_TRAIN_ACK_TRAIN_DATA
#define RBC_MSG_TRACK_TO_TRAIN_UNCONDITIONAL_EMERGENCY_STOP
#define RBC_MSG_TRAIN_TO_TRACK_SESSION_ESTABLISHED
bool rbc_packet_write_72_text_message(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_72_text_message_t *text)
bool rbc_packet_write_57_ma_request_params(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_57_ma_request_params_t *params)
bool rbc_codec_read_u8(const uint8_t *buf, size_t len, size_t *offset, uint8_t *val)
bool rbc_packet_write_131_rbc_transition(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_131_rbc_transition_t *transition)
Encodes Packet 131 (RBC Transition Order). NOTE: only d_rbctr/nid_c/ nid_rbc/nid_radio are written to...
bool rbc_codec_write_u8(uint8_t *buf, size_t cap, size_t *offset, uint8_t val)
bool rbc_packet_write_21_gradient_profile(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_21_gradient_profile_t *gradient)
bool rbc_codec_read_u32_be(const uint8_t *buf, size_t len, size_t *offset, uint32_t *val)
bool rbc_codec_read_u16_be(const uint8_t *buf, size_t len, size_t *offset, uint16_t *val)
bool rbc_packet_write_27_ssp(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_27_ssp_t *ssp)
bool rbc_codec_write_u16_be(uint8_t *buf, size_t cap, size_t *offset, uint16_t val)
bool rbc_packet_write_65_tsr(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_65_tsr_t *tsr)
bool rbc_packet_write_5_linking(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_5_linking_t *linking)
bool rbc_packet_write_66_tsr_revoke(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_66_tsr_revoke_t *revoke)
bool rbc_packet_read_1_position_report_2bg(const uint8_t *buf, size_t len, size_t *offset, rbc_packet_1_position_report_2bg_t *out_p1)
bool rbc_packet_write_3_national_values(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_3_national_values_t *nv)
bool rbc_packet_write_58_pr_params(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_58_pr_params_t *params)
bool rbc_packet_write_15_ma(uint8_t *buf, size_t cap, size_t *offset, const rbc_packet_15_ma_t *ma)
bool rbc_codec_write_u32_be(uint8_t *buf, size_t cap, size_t *offset, uint32_t val)
bool rbc_packet_read_0_position_report(const uint8_t *buf, size_t len, size_t *offset, rbc_packet_0_position_report_t *out_p0)
#define RBC_PACKET_1_POSITION_REPORT_2BG
#define RBC_PACKET_0_POSITION_REPORT
uint16_t rbc_speed_kmh_t
Speed in km/h (5 km/h ETCS granularity or exact integer).
rbc_q_marqstreason_t
Movement Authority Request Reason (Q_MARQSTREASON) Subset-026 Section 7.5.1.28.
Msg 129: Validated Train Data.
rbc_packet_0_position_report_t position_report
rbc_speed_kmh_t v_maxtrain
rbc_train_to_track_header_t header
Msg 130: Request for Shunting (Subset-026 8.6.2) - header plus a position report, same bare (no leadi...
rbc_packet_0_position_report_t position_report
rbc_train_to_track_header_t header
Msg 132: Movement Authority Request.
rbc_packet_0_position_report_t position_report
rbc_train_to_track_header_t header
rbc_q_marqstreason_t q_marqstreason
Msg 136: Train Position Report - carries Packet 0 OR Packet 1 (Subset-026 8.6.4: "Packet 0 or 1"),...
rbc_packet_0_position_report_t position_report
rbc_packet_1_position_report_2bg_t packet1
rbc_train_to_track_header_t header
Msg 146: Acknowledgement.
rbc_timestamp_ms_t t_train_ack
rbc_train_to_track_header_t header
Msg 147: Emergency Stop Acknowledgement.
rbc_train_to_track_header_t header
Msg 150: End of Mission (Subset-026 8.6.10).
rbc_packet_0_position_report_t position_report
rbc_train_to_track_header_t header
Msg 155: Initiation of a Communication Session.
rbc_train_to_track_header_t header
Msg 156: Termination of a Communication Session.
rbc_train_to_track_header_t header
Msg 159: Session Established.
rbc_train_to_track_header_t header
Msg 15: Conditional Emergency Stop (CES).
rbc_track_to_train_header_t header
rbc_distance_m_t d_emergencystop
Msg 16: Unconditional Emergency Stop (UES).
rbc_track_to_train_header_t header
Msg 18: Revocation of Emergency Stop.
rbc_track_to_train_header_t header
Msg 24: General Message (National Values, TSRs, Text, Parameters).
rbc_track_to_train_header_t header
rbc_packet_3_national_values_t national_values
bool has_ma_request_params
rbc_packet_66_tsr_revoke_t tsr_revoke
rbc_packet_57_ma_request_params_t ma_request_params
rbc_packet_72_text_message_t text_message
rbc_packet_58_pr_params_t pr_params
Msg 27: SH Refused (Subset-026 8.7.10) - answers a Msg 130 Request for Shunting; carries the T_TRAIN ...
rbc_track_to_train_header_t header
rbc_timestamp_ms_t t_train_ref
Msg 28: SH Authorised (Subset-026 8.7.11) - carries the T_TRAIN of the authorised Msg 130,...
rbc_track_to_train_header_t header
rbc_timestamp_ms_t t_train_ref
Msg 2: SR Authorisation (Subset-026 8.7.1).
rbc_track_to_train_header_t header
Msg 33: RBC Transition Order (this codebase's own numbering - see ab_gp_ertms_train_message_codec....
rbc_track_to_train_header_t header
Msg 34: Track Ahead Free Request (Subset-026 8.7.14).
rbc_track_to_train_header_t header
rbc_distance_m_t d_tafdisplay
rbc_distance_m_t l_tafdisplay
Msg 3: Movement Authority (with optional packets).
rbc_packet_21_gradient_profile_t gradient
rbc_packet_5_linking_t linking
rbc_track_to_train_header_t header
Msg 41 (this codebase's own numbering - see codec's own encode-case comment for the Subset-026 confor...
rbc_track_to_train_header_t header
Msg 6: Recognition of exit from TRIP mode (Subset-026 8.7.3) - header only, no message-specific field...
rbc_track_to_train_header_t header
Msg 8: Acknowledgement of Train Data (Subset-026 8.7.4).
rbc_timestamp_ms_t t_train_ref
rbc_track_to_train_header_t header
Msg 9: Request to Shorten MA (Subset-026 8.7.5) - carries a shortened Level 2 MA (Packet 15),...
rbc_track_to_train_header_t header
union rbc_train_inbound_msg_t::@156151041174124231025067150227167311270040326010 payload
union rbc_train_outbound_msg_t::@072257326371153356142277360163235337000010176256 payload