|
Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Bounded message queues between safety tasks (ADR-001). More...
Files | |
| file | include/safeapi/oal/ipc/sapi_ipc_pubsub.h |
| IPC Publish-Subscribe Pattern (one-to-many broadcasting). | |
| file | include/safeapi/oal/ipc/sapi_ipc_request_reply.h |
| IPC Request-Reply Pattern (RPC-style communication). | |
| file | src/oal/ipc/sapi_ipc.c |
| IPC service: validates parameters, then dispatches to the backend registered via sapi_ipc_register_backend() (ADR-005). | |
| file | src/oal/ipc/sapi_ipc_pubsub.c |
| IPC Publish-Subscribe implementation. | |
| file | src/oal/ipc/sapi_ipc_request_reply.c |
| IPC Request-Reply implementation. | |
Data Structures | |
| struct | sapi_ipc_config_t |
| Configuration for sapi_ipc_create(). More... | |
Typedefs | |
| typedef struct sapi_ipc_impl_s * | sapi_ipc_handle_t |
| Opaque handle to a created IPC channel, returned by sapi_ipc_create(). | |
Functions | |
| SAFEAPI_DECLARE_STORAGE (sapi_ipc_storage_t, 64U) | |
| Caller-owned, fixed-size storage backing one sapi_ipc_handle_t. | |
| sapi_status_t | sapi_ipc_create (sapi_ipc_storage_t *storage, const sapi_ipc_config_t *config, sapi_ipc_handle_t *out_handle) |
| Creates a bounded message channel. | |
| sapi_status_t | sapi_ipc_send (sapi_ipc_handle_t handle, const void *message, size_t message_size, sapi_duration_ms_t timeout_ms) |
| Sends one message, blocking at most timeout_ms. | |
| sapi_status_t | sapi_ipc_receive (sapi_ipc_handle_t handle, void *out_message, size_t buffer_size, sapi_duration_ms_t timeout_ms) |
| Receives one message, blocking at most timeout_ms. | |
| sapi_status_t | sapi_ipc_destroy (sapi_ipc_handle_t handle) |
| Destroys a message channel. | |
Bounded message queues between safety tasks (ADR-001).
| typedef struct sapi_ipc_impl_s* sapi_ipc_handle_t |
Opaque handle to a created IPC channel, returned by sapi_ipc_create().
Definition at line 34 of file sapi_ipc.h.
| sapi_status_t sapi_ipc_create | ( | sapi_ipc_storage_t * | storage, |
| const sapi_ipc_config_t * | config, | ||
| sapi_ipc_handle_t * | out_handle ) |
Creates a bounded message channel.
| storage | Caller-owned storage for the handle's state. Must not be NULL. |
| config | Channel configuration. Must not be NULL; config->message_size and config->queue_depth must both be > 0. |
| out_handle | Receives the created channel's handle. Must not be NULL. |
Definition at line 44 of file sapi_ipc.c.
| sapi_status_t sapi_ipc_send | ( | sapi_ipc_handle_t | handle, |
| const void * | message, | ||
| size_t | message_size, | ||
| sapi_duration_ms_t | timeout_ms ) |
Sends one message, blocking at most timeout_ms.
| handle | Channel handle. Must not be NULL. |
| message | Message data to send. Must not be NULL. |
| message_size | Size of message in bytes; must be > 0. |
| timeout_ms | Maximum time to wait for queue space. |
Definition at line 68 of file sapi_ipc.c.
| sapi_status_t sapi_ipc_receive | ( | sapi_ipc_handle_t | handle, |
| void * | out_message, | ||
| size_t | buffer_size, | ||
| sapi_duration_ms_t | timeout_ms ) |
Receives one message, blocking at most timeout_ms.
| handle | Channel handle. Must not be NULL. |
| out_message | Destination buffer. Must not be NULL. |
| buffer_size | Usable size of out_message in bytes; must be > 0. |
| timeout_ms | Maximum time to wait for a message to arrive. |
Definition at line 88 of file sapi_ipc.c.
| sapi_status_t sapi_ipc_destroy | ( | sapi_ipc_handle_t | handle | ) |
Destroys a message channel.
| handle | Channel handle. Must not be NULL. Invalid to use after this call. |
Definition at line 108 of file sapi_ipc.c.