|
Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Validation and dispatch for the named channel service. More...
#include "rte/redundancy/channel_service/rte_channel_service.h"#include "rte/utils/lifecycle/rte_lifecycle.h"#include "rte/redundancy/config/rte_redundancy_config.h"Go to the source code of this file.
Functions | |
| static rte_status_t | validate_osadapter (void) |
| rte_status_t | rte_osadapter_channel_service_register (const rte_osadapter_channel_service_t *osadapter) |
| Registers the OSAdapter that implements named channels (ADR-005). | |
| rte_status_t | rte_channel_service_setup (rte_channel_service_t *storage, const char *channel_name) |
| rte_status_t | rte_channel_service_setup_by_id (rte_channel_service_t *storage, uint32_t channel_id) |
| rte_status_t | rte_channel_service_read (rte_channel_service_t *storage, void *data, size_t data_size, rte_duration_ms_t timeout_ms) |
| rte_status_t | rte_channel_service_read_ex (rte_channel_service_t *storage, void *data, size_t data_size, rte_duration_ms_t timeout_ms, size_t *out_actual_size) |
Same as rte_channel_service_read, but also reports the actual number of bytes received into data (never more than data_size). Use this instead of rte_channel_service_read whenever a channel may carry messages shorter than its configured buffer size - a caller that only has the plain read can't tell a short message from one that filled the buffer exactly, and forwarding data_size bytes verbatim would forward trailing garbage. out_actual_size must not be NULL. On any non-OK return its value is unspecified - the caller does not have a valid message to look at anyway. | |
| rte_status_t | rte_channel_service_send (rte_channel_service_t *storage, const void *data, size_t data_size, rte_duration_ms_t timeout_ms) |
Sends data_size bytes of data on the named channel in storage through the registered OSAdapter's send. | |
| rte_status_t | rte_channel_service_close (rte_channel_service_t *storage) |
Variables | |
| static const rte_osadapter_channel_service_t * | s_osadapter |
Validation and dispatch for the named channel service.
Definition in file rte_channel_service.c.
|
static |
Definition at line 12 of file rte_channel_service.c.
| rte_status_t rte_osadapter_channel_service_register | ( | const rte_osadapter_channel_service_t * | osadapter | ) |
Registers the OSAdapter that implements named channels (ADR-005).
Definition at line 22 of file rte_channel_service.c.
| rte_status_t rte_channel_service_setup | ( | rte_channel_service_t * | storage, |
| const char * | channel_name ) |
Definition at line 33 of file rte_channel_service.c.
| rte_status_t rte_channel_service_setup_by_id | ( | rte_channel_service_t * | storage, |
| uint32_t | channel_id ) |
Definition at line 58 of file rte_channel_service.c.
| rte_status_t rte_channel_service_read | ( | rte_channel_service_t * | storage, |
| void * | data, | ||
| size_t | data_size, | ||
| rte_duration_ms_t | timeout_ms ) |
Definition at line 80 of file rte_channel_service.c.
| rte_status_t rte_channel_service_read_ex | ( | rte_channel_service_t * | storage, |
| void * | data, | ||
| size_t | data_size, | ||
| rte_duration_ms_t | timeout_ms, | ||
| size_t * | out_actual_size ) |
Same as rte_channel_service_read, but also reports the actual number of bytes received into data (never more than data_size). Use this instead of rte_channel_service_read whenever a channel may carry messages shorter than its configured buffer size - a caller that only has the plain read can't tell a short message from one that filled the buffer exactly, and forwarding data_size bytes verbatim would forward trailing garbage. out_actual_size must not be NULL. On any non-OK return its value is unspecified - the caller does not have a valid message to look at anyway.
Definition at line 99 of file rte_channel_service.c.
| rte_status_t rte_channel_service_send | ( | rte_channel_service_t * | storage, |
| const void * | data, | ||
| size_t | data_size, | ||
| rte_duration_ms_t | timeout_ms ) |
Sends data_size bytes of data on the named channel in storage through the registered OSAdapter's send.
| storage | Channel set up by rte_channel_service_setup; must not be NULL. |
| data | Bytes to send; must not be NULL. |
| data_size | Number of bytes to send; must not be 0. |
| timeout_ms | Upper bound for the OSAdapter's send. |
RTE_STATUS_INVALID_PARAM for a NULL storage / data or a zero data_size; RTE_STATUS_NOT_INITIALIZED with no complete OSAdapter registered; RTE_STATUS_NOT_CONNECTED when a listen-role link has no peer yet and nothing was sent (REQ-CHANSVC-001); otherwise the OSAdapter's own result, unchanged. Definition at line 130 of file rte_channel_service.c.
| rte_status_t rte_channel_service_close | ( | rte_channel_service_t * | storage | ) |
Definition at line 149 of file rte_channel_service.c.
|
static |
Definition at line 10 of file rte_channel_service.c.