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
Loading...
Searching...
No Matches
cfm.c File Reference

Communication Functional Module — SKELETON. More...

#include "safecomm/cfm/cfm.h"
#include <string.h>
Include dependency graph for cfm.c:

Go to the source code of this file.

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.

Detailed Description

Communication Functional Module — SKELETON.

safecomm_cfm_from_config() parses+range-checks the cfm.* config keys; the connection management and the upward transport are stubs.

Definition in file cfm.c.

Function Documentation

◆ safecomm_cfm_from_config()

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.

Parameters
cfgloaded configuration. Non-NULL.
lowerthe 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.
outreceives the CFM. Non-NULL.
Returns
SAFECOMM_STATUS_OK / _INVALID_PARAM / _NOT_IMPLEMENTED.
Note
REQ-SC-CFM-003.

Definition at line 12 of file cfm.c.

◆ safecomm_cfm_transport()

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.

Parameters
cfma CFM from safecomm_cfm_from_config(). Non-NULL.
outreceives the upward-facing transport. Non-NULL.
Returns
SAFECOMM_STATUS_OK / _INVALID_PARAM / _NOT_IMPLEMENTED.
Note
REQ-SC-CFM-008.

Definition at line 70 of file cfm.c.