|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
See ab_gp_sibling_state.h. More...
#include "ab_gp_sibling_state.h"Go to the source code of this file.
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. | |
Definition in file ab_gp_sibling_state.c.
| 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.