|
Safe Communication Framework 0.1.0 build feea4f9
ERTMS/ETCS safe communication (Subset-037 EuroRadio, Subset-098 RBC/RBC), CENELEC EN 50128 SIL 4 oriented
|
Communication Functional Module (CFM). More...
#include "safecomm/status.h"#include "safecomm/config/config.h"#include "safecomm/transport/transport.h"Go to the source code of this file.
Data Structures | |
| struct | safecomm_cfm_t |
| A CFM instance. Caller-allocated, opaque. More... | |
Enumerations | |
| enum | safecomm_cfm_profile_t { SAFECOMM_CFM_PROFILE_EURORADIO = 0 , SAFECOMM_CFM_PROFILE_RBC_RBC } |
| Which communication-layer profile the CFM runs. More... | |
Functions | |
| safecomm_status_t | safecomm_cfm_from_config (const safecomm_config_t *cfg, const safecomm_transport_t *lower, safecomm_cfm_t *out) |
| Build a CFM from a loaded config (cfm.* keys). | |
| safecomm_status_t | safecomm_cfm_transport (safecomm_cfm_t *cfm, safecomm_transport_t *out) |
| Expose the CFM to the SFM above it as a transport. | |
Communication Functional Module (CFM).
The lower half of the EuroRadio stack: it owns the bearer connection (open / close / redial / retry, keep-alive, the SS-037-vs-SS-098 communication-layer differences) and presents the SFM above it a framed byte pipe as a safecomm_transport_t.
Deployment (ADR-002): CFM is linked into the vital A/B channel (rte_example) alongside the SFM, per direct instruction. Its socket I/O runs on its own, but the interface it exposes UP to the SFM is discrete and cycle-aligned (one "PDU available" / "send this PDU" event at a time) so bearer non-determinism never enters the 2oo2 cross-compared path.
The bearer BELOW the CFM:
REQ-SC-CFM-001..015 — see docs/requirements/SRS.md.
Definition in file cfm.h.
| safecomm_status_t safecomm_cfm_from_config | ( | const safecomm_config_t * | cfg, |
| const safecomm_transport_t * | lower, | ||
| safecomm_cfm_t * | out ) |
Build a CFM from a loaded config (cfm.* keys).
Reads cfm.profile, cfm.peer_host, cfm.peer_port, cfm.bind_port, cfm.retry_ms; range-checks each; leaves out ready but not connected.
| cfg | loaded configuration. Non-NULL. |
| lower | the bearer the CFM sends/receives over (for the SS-037 stub this is the Gateway-relay transport; for SS-098 it is an OAL/TCP transport). Non-NULL, .send/.recv non-NULL. |
| out | receives the CFM. Non-NULL. |
| safecomm_status_t safecomm_cfm_transport | ( | safecomm_cfm_t * | cfm, |
| safecomm_transport_t * | out ) |
Expose the CFM to the SFM above it as a transport.
The returned transport's send/recv carry whole SaF PDUs; the CFM handles framing, keep-alive and reconnect underneath.
| cfm | a CFM from safecomm_cfm_from_config(). Non-NULL. |
| out | receives the upward-facing transport. Non-NULL. |