|
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_util_link_gate.h. More...
Go to the source code of this file.
Functions | |
| void | ab_gp_util_link_gate_init (ab_gp_util_link_gate_t *gate) |
| Resets the gate: never opened, first attempt allowed at any time. | |
| bool | ab_gp_util_link_gate_is_open (const ab_gp_util_link_gate_t *gate) |
| Whether an open attempt has succeeded (the link is open for good). | |
| bool | ab_gp_util_link_gate_may_attempt (const ab_gp_util_link_gate_t *gate, rte_timestamp_ms_t now_ms) |
| Whether a send (and with it, before the first success, an open attempt) may run now. | |
| void | ab_gp_util_link_gate_on_attempt (ab_gp_util_link_gate_t *gate, rte_timestamp_ms_t now_ms) |
| Records that an open attempt starts now (call right before the send that triggers the open). | |
| void | ab_gp_util_link_gate_on_result (ab_gp_util_link_gate_t *gate, rte_status_t status, rte_timestamp_ms_t now_ms) |
| Feeds back the result of a send that ran under the gate. | |
Definition in file ab_gp_util_link_gate.c.
| void ab_gp_util_link_gate_init | ( | ab_gp_util_link_gate_t * | gate | ) |
Resets the gate: never opened, first attempt allowed at any time.
| gate | gate to reset; ignored when NULL |
Definition at line 9 of file ab_gp_util_link_gate.c.
| bool ab_gp_util_link_gate_is_open | ( | const ab_gp_util_link_gate_t * | gate | ) |
Whether an open attempt has succeeded (the link is open for good).
| gate | gate to query |
gate is NULL Definition at line 18 of file ab_gp_util_link_gate.c.
| bool ab_gp_util_link_gate_may_attempt | ( | const ab_gp_util_link_gate_t * | gate, |
| rte_timestamp_ms_t | now_ms ) |
Whether a send (and with it, before the first success, an open attempt) may run now.
| gate | gate to query |
| now_ms | current monotonic time |
now_ms has reached the next allowed attempt time; false otherwise and when gate is NULL Definition at line 29 of file ab_gp_util_link_gate.c.
| void ab_gp_util_link_gate_on_attempt | ( | ab_gp_util_link_gate_t * | gate, |
| rte_timestamp_ms_t | now_ms ) |
Records that an open attempt starts now (call right before the send that triggers the open).
Before the first success this reserves the back-off interval at once, so a nested call during the attempt (the open itself logs INFO lines, which the JRU forwarder republishes over this same link) is refused instead of starting a second attempt. No effect once the link is open.
| gate | gate to update; ignored when NULL |
| now_ms | current monotonic time |
Definition at line 40 of file ab_gp_util_link_gate.c.
| void ab_gp_util_link_gate_on_result | ( | ab_gp_util_link_gate_t * | gate, |
| rte_status_t | status, | ||
| rte_timestamp_ms_t | now_ms ) |
Feeds back the result of a send that ran under the gate.
RTE_STATUS_OK marks the link open for good. Any other status before the first success refuses further attempts until now_ms + RTE_EXAMPLE_UTIL_REOPEN_BACKOFF_MS. A failure after the first success changes nothing (the link stays open in the channel service and a send on it does not block).
| gate | gate to update; ignored when NULL |
| status | result of the send |
| now_ms | current monotonic time (after the attempt) |
Definition at line 48 of file ab_gp_util_link_gate.c.