|
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_standby_policy.h. More...
Go to the source code of this file.
Functions | |
| bool | ab_gp_session_adopt_allowed (uint32_t join_left, bool local_in_use, bool peer_in_use) |
| Whether a channel that has just become ONLINE adopts one train session from its A/B sibling. | |
| bool | ab_gp_stall_lost_contact (rte_timestamp_ms_t last_ms, rte_timestamp_ms_t now_ms, bool is_online, rte_timestamp_ms_t *stalled_ms) |
| Whether a channel that wakes up at a cycle tick has stalled long enough to count as having lost contact. | |
Definition in file ab_gp_standby_policy.c.
| bool ab_gp_session_adopt_allowed | ( | uint32_t | join_left, |
| bool | local_in_use, | ||
| bool | peer_in_use ) |
Whether a channel that has just become ONLINE adopts one train session from its A/B sibling.
A channel that starts receiving later than its sibling (after a staggered restart, its relay from the Gateway is not flowing yet) can miss a train's connect; the session tables then differ and the A/B cross-compare would declare a divergence and reboot a channel. Within the join window, a session the sibling holds and this channel lacks is copied (the same kind of state transfer as at a promotion); everything after that is computed independently and cross-compared as usual. Anything else that differs is NOT adopted: it is a real divergence.
| join_left | cycles left in the join window (0 = closed) |
| local_in_use | this channel holds the session |
| peer_in_use | the A/B sibling holds the session |
Definition at line 9 of file ab_gp_standby_policy.c.
| bool ab_gp_stall_lost_contact | ( | rte_timestamp_ms_t | last_ms, |
| rte_timestamp_ms_t | now_ms, | ||
| bool | is_online, | ||
| rte_timestamp_ms_t * | stalled_ms ) |
Whether a channel that wakes up at a cycle tick has stalled long enough to count as having lost contact.
The rule of the stall detector in ab_gp_channel_wait_cycle_tick(): an ONLINE channel whose previous cycle tick is more than AB_GP_STALL_LOST_CONTACT_MS back treats itself as having lost contact (the caller then calls rte_site_role_note_lost_contact()). Both times are the full 64-bit monotonic time; the previous tick used to be kept in 32 bits, which made the difference wrong from 2^32 ms of monotonic time on (ISS-052).
now_ms smaller than last_ms gives a large unsigned difference, so the answer is true. That only happens when rte_timer_now() fails and leaves 0 in the caller's variable; the ignored status is ISS-036 and this function keeps the behaviour the detector had before.
| last_ms | monotonic time of the previous cycle tick (0 = no cycle yet) |
| now_ms | monotonic time of this cycle tick |
| is_online | this channel is ONLINE |
| stalled_ms | out, may be NULL: now_ms - last_ms, written only when the result is true |
Definition at line 14 of file ab_gp_standby_policy.c.