|
Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Application-facing named channel service. More...
#include <stddef.h>#include <stdint.h>#include "safeapi/utils/status/sapi_status.h"#include "safeapi/utils/types/sapi_types.h"Go to the source code of this file.
Data Structures | |
| struct | sapi_channel_service_storage_t |
| Caller-owned storage for one named channel service instance. More... | |
| struct | sapi_channel_service_backend_t |
| Backend implementation for named channel operations. More... | |
Macros | |
| #define | SAPI_CHANNEL_SERVICE_NAME_SIZE (32U) |
Typedefs | |
| typedef sapi_channel_service_storage_t | sapi_channel_service_t |
| Opaque handle to a named channel service instance. | |
Functions | |
| sapi_status_t | sapi_channel_service_register_backend (const sapi_channel_service_backend_t *backend) |
| sapi_status_t | sapi_channel_service_setup (sapi_channel_service_t *storage, const char *channel_name) |
| sapi_status_t | sapi_channel_service_read (sapi_channel_service_t *storage, void *data, size_t data_size, sapi_duration_ms_t timeout_ms) |
| sapi_status_t | sapi_channel_service_send (sapi_channel_service_t *storage, const void *data, size_t data_size, sapi_duration_ms_t timeout_ms) |
| sapi_status_t | sapi_channel_service_close (sapi_channel_service_t *storage) |
Application-facing named channel service.
The application addresses a channel by its configured name and performs setup, read, and send operations from its own execution thread. Transport lifecycle, reconnect, buffering, and synchronization belong to the registered backend.
Definition in file sapi_channel_service.h.
| #define SAPI_CHANNEL_SERVICE_NAME_SIZE (32U) |
Definition at line 24 of file sapi_channel_service.h.
Opaque handle to a named channel service instance.
Definition at line 33 of file sapi_channel_service.h.
| sapi_status_t sapi_channel_service_register_backend | ( | const sapi_channel_service_backend_t * | backend | ) |
Definition at line 20 of file sapi_channel_service.c.
| sapi_status_t sapi_channel_service_setup | ( | sapi_channel_service_t * | storage, |
| const char * | channel_name ) |
Definition at line 31 of file sapi_channel_service.c.
| sapi_status_t sapi_channel_service_read | ( | sapi_channel_service_t * | storage, |
| void * | data, | ||
| size_t | data_size, | ||
| sapi_duration_ms_t | timeout_ms ) |
Definition at line 47 of file sapi_channel_service.c.
| sapi_status_t sapi_channel_service_send | ( | sapi_channel_service_t * | storage, |
| const void * | data, | ||
| size_t | data_size, | ||
| sapi_duration_ms_t | timeout_ms ) |
Definition at line 66 of file sapi_channel_service.c.
| sapi_status_t sapi_channel_service_close | ( | sapi_channel_service_t * | storage | ) |
Definition at line 85 of file sapi_channel_service.c.