|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
The A/B sibling's last site-state frame (PEER_MSG_KIND_SITE_STATE), kept raw and handed to Platform_RTE's rte_site_role through its sibling source (REQ-SITEROLE-016, ADR-040 step 5b). Pure, no I/O (the ab_gp_standby_policy pattern): the peer-link readers store the frame, the service takes it. More...
#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include "rte/redundancy/site_role/rte_site_role.h"#include "../../common/common_config.h"Go to the source code of this file.
Data Structures | |
| struct | ab_gp_sibling_state_t |
Functions | |
| void | ab_gp_sibling_state_reset (ab_gp_sibling_state_t *st) |
| Resets the state to "no frame seen" (all zero). | |
| bool | ab_gp_sibling_state_store (ab_gp_sibling_state_t *st, const uint8_t *payload, size_t size) |
| Stores a received site-state frame payload: the rule of on_peer_frame_received() (the payload must carry at least the whole frame). A later store before a take replaces the earlier bytes. | |
| bool | ab_gp_sibling_state_take (ab_gp_sibling_state_t *st, rte_site_role_sibling_t *out) |
| The rte_site_role_sibling_source_fn contract: hands out the frame stored since the previous take. | |
The A/B sibling's last site-state frame (PEER_MSG_KIND_SITE_STATE), kept raw and handed to Platform_RTE's rte_site_role through its sibling source (REQ-SITEROLE-016, ADR-040 step 5b). Pure, no I/O (the ab_gp_standby_policy pattern): the peer-link readers store the frame, the service takes it.
GP no longer decodes the frame itself: rte_site_role polls ab_gp_sibling_state_take() once per rte_site_role_execute(), derives the sibling's online / ready / reachable facts and runs the A/B agreement check (REQ-SITEROLE-014); GP only reacts to the verdict (ab_gp_channel_crosscompare_check_site_state()). The frame is not stamped with a cycle here: the service stamps the cycle of the poll that delivered it, so a frame read on the checkpoint path (poll_for_checkpoint_frame()) counts for reachability like one read by the per-cycle peer pump.
Wire layout (RTE_EXAMPLE_AB_SITE_STATE_WIRE_SIZE bytes): is_online(1) | single_mode(1) | ready_for_online(1).
Definition in file ab_gp_sibling_state.h.
| void ab_gp_sibling_state_reset | ( | ab_gp_sibling_state_t * | st | ) |
Resets the state to "no frame seen" (all zero).
| st | the state; NULL is ignored |
Definition at line 7 of file ab_gp_sibling_state.c.
| bool ab_gp_sibling_state_store | ( | ab_gp_sibling_state_t * | st, |
| const uint8_t * | payload, | ||
| size_t | size ) |
Stores a received site-state frame payload: the rule of on_peer_frame_received() (the payload must carry at least the whole frame). A later store before a take replaces the earlier bytes.
| st | the state |
| payload | the frame payload (the bytes after the message kind) |
| size | number of bytes available in payload |
size is at least RTE_EXAMPLE_AB_SITE_STATE_WIRE_SIZE and the first RTE_EXAMPLE_AB_SITE_STATE_WIRE_SIZE bytes were copied (known and fresh set); false otherwise (NULL argument or a short payload: the state is left unchanged) Definition at line 22 of file ab_gp_sibling_state.c.
| bool ab_gp_sibling_state_take | ( | ab_gp_sibling_state_t * | st, |
| rte_site_role_sibling_t * | out ) |
The rte_site_role_sibling_source_fn contract: hands out the frame stored since the previous take.
| st | the state |
| out | receives known = true, online = (byte 0 != 0), single_mode = (byte 1 == RTE_EXAMPLE_SINGLE_MODE_FLAG_SINGLE), ready = (byte 2 != 0) when the result is true; left untouched otherwise |
Definition at line 41 of file ab_gp_sibling_state.c.