1#ifndef RTE_EXAMPLE_RBC_WIRE_TYPES_H
2#define RTE_EXAMPLE_RBC_WIRE_TYPES_H
47#include "rte/oal/memory/rte_mem_util.h"
494 if (match && (out_level != NULL))
518 out[2U + n] = (uint8_t)payload[n];
539 if ((out_payload != NULL) && (out_size > 0U))
546 if (n > (uint16_t)(out_size - 1U))
548 n = (uint16_t)(out_size - 1U);
550 for (i = 0U; i < n; i++)
552 out_payload[i] = (char)in[2U + i];
554 out_payload[n] =
'\0';
610#define RBC_ENVELOPE_QUEUE_CAPACITY 16U
#define RBC_ENVELOPE_WIRE_SIZE
static bool rbc_envelope_is_set_log_level(const uint8_t in[RBC_ENVELOPE_WIRE_SIZE], uint8_t *out_level)
true if in is a set-log-level control frame; *out_level (if non-NULL) then receives the requested lev...
rbc_il_status_t
RBC_MSG_IL_STATUS.il_status - IL process health.
@ RBC_IL_STATUS_RESTARTING
static bool rbc_envelope_is_sim_status(const uint8_t in[RBC_ENVELOPE_WIRE_SIZE], char *out_payload, uint16_t out_size)
true if in is a sim-status frame; when it is and out_payload is non-NULL, copies the ASCII payload th...
static bool rbc_envelope_queue_push(rbc_envelope_queue_t *queue, const uint8_t bytes[RBC_ENVELOPE_WIRE_SIZE])
#define RBC_ENVELOPE_QUEUE_CAPACITY
Fixed-capacity single-producer/single-consumer envelope queue - REQ-RBC-003. Unlike the M136/ANSWER s...
rbc_alarm_severity_t
Severity of an RBC_MSG_CTC_ALARM envelope (msg_type field on the wire) - deliberately a small,...
@ RBC_ALARM_SEVERITY_WARNING
@ RBC_ALARM_SEVERITY_INFO
@ RBC_ALARM_SEVERITY_ERROR
rbc_msg_kind_t
Which of this envelope's fields are meaningful, and which direction it travels - see this file's own ...
@ RBC_MSG_RELAY_KEEPALIVE
@ RBC_MSG_IL_ROUTE_INDICATION
@ RBC_MSG_CTC_MA_EXTENDED
@ RBC_MSG_TRAIN_POSITION_IN_ROUTE
@ RBC_MSG_TEXT_MESSAGE_ACK
@ RBC_MSG_TRAIN_DISCONNECT
@ RBC_MSG_ROUTE_STATUS_REPORT
rbc_route_status_t
TRAIN_POSITION_IN_ROUTE's own route_status field - see that kind's own doc (rbc_msg_kind_t)....
@ RBC_ROUTE_STATUS_NO_TRAIN
@ RBC_ROUTE_STATUS_TRAIN_IN_ROUTE
rbc_il_emergency_type_t
RBC_MSG_IL_ROUTE_INDICATION.emergency_type - carried as a SIGNED int8 on the wire,...
@ RBC_IL_EMERGENCY_TYPE_UEM
@ RBC_IL_EMERGENCY_TYPE_SAM
@ RBC_IL_EMERGENCY_TYPE_CEM
@ RBC_IL_EMERGENCY_TYPE_NONE
rbc_il_degraded_status_t
RBC_MSG_IL_ROUTE_CMD.degraded_status - severity, meaningful only when route_status == RBC_IL_ROUTE_ST...
@ RBC_IL_DEGRADED_STATUS_NO_STATUS
@ RBC_IL_DEGRADED_STATUS_MEDIUM
@ RBC_IL_DEGRADED_STATUS_HIGH
@ RBC_IL_DEGRADED_STATUS_LOW
static void rbc_envelope_write_sim_status(uint8_t out[RBC_ENVELOPE_WIRE_SIZE], const char *payload)
Fills out with an ADR-038 sim-status frame: RBC_MSG_SIM_STATUS in byte 0, the ASCII payload length in...
static void rbc_envelope_queue_init(rbc_envelope_queue_t *queue)
static bool rbc_envelope_is_keepalive(const uint8_t in[RBC_ENVELOPE_WIRE_SIZE])
true if in is a keepalive frame - see rbc_envelope_write_keepalive()'s own doc. Callers on the receiv...
static bool rbc_envelope_queue_pop(rbc_envelope_queue_t *queue, uint8_t out_bytes[RBC_ENVELOPE_WIRE_SIZE])
static void rbc_envelope_write_keepalive(uint8_t out[RBC_ENVELOPE_WIRE_SIZE])
Fills out with a keepalive frame (RBC_MSG_RELAY_KEEPALIVE in byte 0, every other byte zero) - see tha...
rbc_route_type_t
ROUTE_ADD's own route_type field - the supervision mode IL is granting this route under (real ETCS co...
rbc_il_route_type_t
RBC_MSG_IL_ROUTE_CMD.route_type - is IL indicating a route here at all, and is it locked....
@ RBC_IL_ROUTE_TYPE_NO_ROUTE
@ RBC_IL_ROUTE_TYPE_LOCKED
static void rbc_envelope_write_set_log_level(uint8_t out[RBC_ENVELOPE_WIRE_SIZE], uint8_t level)
Fills out with a set-log-level control frame: RBC_MSG_SET_LOG_LEVEL in byte 0, level in byte 1,...
rbc_il_route_status_t
RBC_MSG_IL_ROUTE_CMD.route_status - the supervision mode / lifecycle status IL reports for the route.
@ RBC_IL_ROUTE_STATUS_NO_STATUS
@ RBC_IL_ROUTE_STATUS_DEGRADED
@ RBC_IL_ROUTE_STATUS_USED
volatile uint32_t write_index
volatile uint32_t read_index
uint8_t entries[RBC_ENVELOPE_QUEUE_CAPACITY][RBC_ENVELOPE_WIRE_SIZE]
One decoded envelope - see this file's own module doc for where the wire<->struct conversion now live...