SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
Loading...
Searching...
No Matches
ab_ga_il_wire.h
Go to the documentation of this file.
1
53
54#ifndef AB_GA_IL_WIRE_H
55#define AB_GA_IL_WIRE_H
56
57#include <stdbool.h>
58#include <stdint.h>
59
60#include "rbc_wire_types.h" /* rbc_il_* enums, RBC_ENVELOPE_WIRE_SIZE, kinds */
61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
67typedef struct
68{
69 int32_t route_id;
70 int32_t start_signal;
71 int32_t end_signal;
72 rbc_il_route_type_t route_type;
73 rbc_il_route_status_t route_status;
74 rbc_il_degraded_status_t degraded_status;
75 bool release_route_request;
76 bool first_route_in_path;
78
80typedef struct
81{
82 rbc_il_status_t il_status;
84
86typedef struct
87{
88 int32_t route_id;
89 int32_t start_signal;
90 int32_t end_signal;
92 bool train_in_route;
93 bool train_has_ma_in_route;
94 bool emergency_in_route;
95 rbc_il_emergency_type_t emergency_type;
99
110bool ab_ga_il_wire_decode_route_cmd(const uint8_t frame[RBC_ENVELOPE_WIRE_SIZE],
112
114bool ab_ga_il_wire_decode_status(const uint8_t frame[RBC_ENVELOPE_WIRE_SIZE],
116
124void ab_ga_il_wire_encode_route_indication(uint8_t frame[RBC_ENVELOPE_WIRE_SIZE],
126
127#ifdef __cplusplus
128}
129#endif
130
131#endif /* AB_GA_IL_WIRE_H */
bool ab_ga_il_wire_decode_route_cmd(const uint8_t frame[RBC_ENVELOPE_WIRE_SIZE], ab_ga_il_route_cmd_t *out)
Decodes + fully range-validates an RBC_MSG_IL_ROUTE_CMD frame.
void ab_ga_il_wire_encode_route_indication(uint8_t frame[RBC_ENVELOPE_WIRE_SIZE], const ab_ga_il_route_indication_t *in)
Encodes an RBC_MSG_IL_ROUTE_INDICATION frame (zero-fills the whole RBC_ENVELOPE_WIRE_SIZE slot first)...
bool ab_ga_il_wire_decode_status(const uint8_t frame[RBC_ENVELOPE_WIRE_SIZE], ab_ga_il_status_msg_t *out)
Decodes + validates an RBC_MSG_IL_STATUS frame. Same contract.
Decoded RBC_MSG_IL_ROUTE_CMD payload.
RBC_MSG_IL_ROUTE_INDICATION payload (RBC -> IL).
rbc_il_emergency_type_t emergency_type
Decoded RBC_MSG_IL_STATUS payload.