SimCore
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 CommServer-facing client link for a sim (train).

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

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

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.

Stub, matching the C side: the Safety Functional Module (authentication,
per-message MAC, sequence numbering - ``safecomm::safety``) is
NOT_IMPLEMENTED, so this link is a transparent byte pipe with fixed
``message_size`` framing. When the SaF PDU layout lands in
``safeCommFreamwork`` this module gets the matching wrapper/unwrapper,
kept byte-identical the same way ``simcore.rbc_wire`` mirrors the C codec.

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.