RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Loading...
Searching...
No Matches
ab_gp_site_status.h File Reference

The site status monitor: collects, in one struct, the facts that decide and explain this channel's site role. More...

#include <stddef.h>
#include "ab_gp_channel_types.h"
#include "rte/redundancy/site_role/rte_site_role_policy.h"
Include dependency graph for ab_gp_site_status.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ab_gp_site_status_t

Enumerations

enum  ab_gp_site_wait_t { AB_GP_SITE_WAIT_NOTHING = 0 , AB_GP_SITE_WAIT_DISPATCHER , AB_GP_SITE_WAIT_LINK , AB_GP_SITE_WAIT_READY }

Functions

bool ab_gp_site_status_ready_for_online (const ab_gp_channel_context_t *ctx)
 Whether this channel confirms it is ready to be ONLINE: the Gateway relay delivered a frame within the last 10 cycles (so a train's connect would reach this channel).
void ab_gp_site_status_collect (const ab_gp_channel_context_t *ctx, ab_gp_site_status_t *out)
size_t ab_gp_site_status_append_text (const ab_gp_site_status_t *st, char *buf, size_t size)
 Appends " site_wait=<none|dispatcher|link> site_why=<short reason>" to a status payload.

Detailed Description

The site status monitor: collects, in one struct, the facts that decide and explain this channel's site role.

The site role service (Platform_RTE rte_site_role.h) decides; the monitor observes and reports. The snapshot feeds the status frame sent to the Gateway (so the Maintenance Web can show why a site is not ONLINE and that a dispatcher confirmation is awaited) and the log. It only reads the context and never changes it.

Definition in file ab_gp_site_status.h.

Enumeration Type Documentation

◆ ab_gp_site_wait_t

What this channel is waiting for, if anything.

Enumerator
AB_GP_SITE_WAIT_NOTHING 
AB_GP_SITE_WAIT_DISPATCHER 

STANDBY, counterpart silent: only a dispatcher confirmation can promote

AB_GP_SITE_WAIT_LINK 

the negotiation link is closed and being reopened

AB_GP_SITE_WAIT_READY 

a promotion is due; waiting for both A/B channels to confirm they are ready

Definition at line 18 of file ab_gp_site_status.h.

Function Documentation

◆ ab_gp_site_status_ready_for_online()

bool ab_gp_site_status_ready_for_online ( const ab_gp_channel_context_t * ctx)

Whether this channel confirms it is ready to be ONLINE: the Gateway relay delivered a frame within the last 10 cycles (so a train's connect would reach this channel).

Definition at line 9 of file ab_gp_site_status.c.

◆ ab_gp_site_status_collect()

void ab_gp_site_status_collect ( const ab_gp_channel_context_t * ctx,
ab_gp_site_status_t * out )

Collects the snapshot from the channel context.

Definition at line 19 of file ab_gp_site_status.c.

◆ ab_gp_site_status_append_text()

size_t ab_gp_site_status_append_text ( const ab_gp_site_status_t * st,
char * buf,
size_t size )

Appends " site_wait=<none|dispatcher|link> site_why=<short reason>" to a status payload.

Returns
the number of characters written (0 if it did not fit)

Definition at line 52 of file ab_gp_site_status.c.