|
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
|
Transports built on safeAPIFreamwork's channel API. More...
#include "safecomm/transport/transport.h"Go to the source code of this file.
Functions | |
| safecomm_status_t | safecomm_transport_from_channel_service (safecomm_transport_t *out, safecomm_transport_channel_ctx_t *ctx, void *channel, uint32_t recv_timeout_ms) |
Populate out with a transport that runs over an already-open, caller-owned Platform_RTE named channel (rte_channel_service_t) — e.g. RBC_GP's own train or IL relay channel, opened and closed by the caller for its own reasons independent of this transport's lifetime. Unlike safecomm_transport_oal_tcp, this does not open a bearer itself: it wraps one the caller already has, which is the shape RBC_GP's vital A/B processes need (the relay channel is shared infrastructure, not something the SaF layer should own or close). | |
| safecomm_status_t | safecomm_transport_oal_tcp (safecomm_transport_t *out, const char *host, uint16_t port, uint32_t recv_timeout_ms) |
Populate out with an OAL/TCP transport built on safeAPIFreamwork. | |
Transports built on safeAPIFreamwork's channel API.
The ONLY file in this library that references safeAPIFreamwork's OAL — the SaF / MAC logic stays framework-free and unit-testable. Compiled with SAFECOMM_HAVE_FRAMEWORK defined only when SAFECOMM_USE_INSTALLED_FRAMEWORK links rte::channels (see CMakeLists.txt); otherwise every function here returns SAFECOMM_STATUS_NOT_IMPLEMENTED, so a pure SaF/MAC unit test build never needs the framework present at all.
Definition in file transport.c.
| safecomm_status_t safecomm_transport_from_channel_service | ( | safecomm_transport_t * | out, |
| safecomm_transport_channel_ctx_t * | ctx, | ||
| void * | channel, | ||
| uint32_t | recv_timeout_ms ) |
Populate out with a transport that runs over an already-open, caller-owned Platform_RTE named channel (rte_channel_service_t) — e.g. RBC_GP's own train or IL relay channel, opened and closed by the caller for its own reasons independent of this transport's lifetime. Unlike safecomm_transport_oal_tcp, this does not open a bearer itself: it wraps one the caller already has, which is the shape RBC_GP's vital A/B processes need (the relay channel is shared infrastructure, not something the SaF layer should own or close).
channel must point to an already-set-up rte_channel_service_t (opaque void* here so this public header does not depend on Platform_RTE's own headers — only this function's .c file does, and only when built with the framework present).
This transport's own close() is a deliberate no-op: closing the underlying channel remains the caller's responsibility, since other traffic (or the plain, unauthenticated path during migration, REQ-SC integration plan step 6) may still need it after a SaF session ends.
| out | receives the transport. Non-NULL. |
| ctx | caller-owned storage this transport's callbacks close over. Non-NULL, must outlive out. |
| channel | an already-open rte_channel_service_t*, owned by the caller. Non-NULL. |
| recv_timeout_ms | per-recv supervision timeout passed straight through to rte_channel_service_read_ex(), 0 = block forever. |
Definition at line 84 of file transport.c.
| safecomm_status_t safecomm_transport_oal_tcp | ( | safecomm_transport_t * | out, |
| const char * | host, | ||
| uint16_t | port, | ||
| uint32_t | recv_timeout_ms ) |
Populate out with an OAL/TCP transport built on safeAPIFreamwork.
| out | receives the transport. Non-NULL. |
| host | peer host (NUL-terminated). Non-NULL. |
| port | peer TCP port. |
| recv_timeout_ms | per-recv supervision timeout, 0 = block forever. |
Definition at line 99 of file transport.c.