RBC_Test_Sim_Core 0.1.0 build 51fd23e
Shared transport-layer plumbing for the ADR-029 Train/IL/CTC RBC simulators
Loading...
Searching...
No Matches
simcore.safecomm Namespace Reference

Classes

Functions

 link_from_config (log, config, message_size, sim_config)

Variables

str _SITE = "WEST"
str _UNUSED_SITE = "EAST"
float _CONNECT_TIMEOUT_S = 0.75
float _RECONNECT_MIN_INTERVAL_S = 1.0

Detailed Description

SafeCommLink - the RBC_Test_CommServer-facing client link for a sim (train).

This is the Python client side of the safe-communication path introduced
with the C ``Platform_Protocol_SafeComm`` / ``RBC_Test_CommServer`` product:

    TrainSim --(this module, plain TCP)--> RBC_Test_CommServer --> RBC role-C gateway

RBC_Test_CommServer owns the WEST/EAST dual-homing, so from the sim's point of view
there is a single logical link. It is a drop-in alternative to
``simcore.dual_link.DualHomedLink`` - same ``ensure_connected()`` /
``send_all()`` / ``poll_recv()`` surface - selected by ``train_sim`` when
the config carries a ``commServer`` block.

This link itself is a transparent byte pipe with fixed ``message_size``
framing, as RBC_Test_CommServer is a non-vital carrier. Safety protection of
the ERTMS traffic (Subset-037 SaF, terminated in RBC_GP's A/B processes) is
layered on top by ``simcore.saf_train_link.SafTrainLink``, which wraps this
link or ``DualHomedLink`` alike (``train_sim`` does so when
``RTE_SAFECOMM_TRAIN_RBC_ID`` is set).

Function Documentation

◆ link_from_config()

link_from_config ( log,
config,
message_size,
sim_config )
Return a SafeCommLink if the config has a ``commServer`` block,
else None (caller falls back to DualHomedLink).

Definition at line 163 of file safecomm.py.

Variable Documentation

◆ _CONNECT_TIMEOUT_S

float simcore.safecomm._CONNECT_TIMEOUT_S = 0.75
protected

Definition at line 38 of file safecomm.py.

◆ _RECONNECT_MIN_INTERVAL_S

float simcore.safecomm._RECONNECT_MIN_INTERVAL_S = 1.0
protected

Definition at line 39 of file safecomm.py.

◆ _SITE

str simcore.safecomm._SITE = "WEST"
protected

Definition at line 29 of file safecomm.py.

◆ _UNUSED_SITE

str simcore.safecomm._UNUSED_SITE = "EAST"
protected

Definition at line 30 of file safecomm.py.