Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_ipc.h
Go to the documentation of this file.
1
20#ifndef SAFEAPI_OS_IPC_H
21#define SAFEAPI_OS_IPC_H
22
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
31SAFEAPI_DECLARE_STORAGE(sapi_ipc_storage_t, 64U);
32
34typedef struct sapi_ipc_impl_s *sapi_ipc_handle_t;
35
37typedef struct sapi_ipc_config_s
38{
39 const char *name;
40 size_t message_size;
41 size_t queue_depth;
43
56sapi_status_t sapi_ipc_create(sapi_ipc_storage_t *storage,
57 const sapi_ipc_config_t *config,
58 sapi_ipc_handle_t *out_handle);
59
72 const void *message,
73 size_t message_size,
74 sapi_duration_ms_t timeout_ms);
75
88 void *out_message,
89 size_t buffer_size,
90 sapi_duration_ms_t timeout_ms);
91
100
101/*
102 * The backend vtable (sapi_ipc_backend_t) and sapi_ipc_register_backend()
103 * live in safeapi_backend/ipc/sapi_ipc_backend.h, not here (ADR-021).
104 * This header is the consumer-facing surface only.
105 */
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif /* SAFEAPI_OS_IPC_H */
112 /* IPC */
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.
Definition sapi_ipc.c:44
struct sapi_ipc_impl_s * sapi_ipc_handle_t
Opaque handle to a created IPC channel, returned by sapi_ipc_create().
Definition sapi_ipc.h:34
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.
Definition sapi_ipc.c:88
sapi_status_t sapi_ipc_destroy(sapi_ipc_handle_t handle)
Destroys a message channel.
Definition sapi_ipc.c:108
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.
Definition sapi_ipc.c:68
sapi_status_t
Common result/status codes.
Definition sapi_status.h:27
uint32_t sapi_duration_ms_t
Definition sapi_types.h:27
#define SAFEAPI_DECLARE_STORAGE(type_name, byte_size)
Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout...
Definition sapi_types.h:69
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
Configuration for sapi_ipc_create().
Definition sapi_ipc.h:38
size_t message_size
Definition sapi_ipc.h:40
size_t queue_depth
Definition sapi_ipc.h:41
const char * name
Definition sapi_ipc.h:39