Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Toggle main menu visibility
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
23
#include "
safeapi/utils/status/sapi_status.h
"
24
#include "
safeapi/utils/types/sapi_types.h
"
25
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
31
SAFEAPI_DECLARE_STORAGE
(sapi_ipc_storage_t, 64U);
32
34
typedef
struct
sapi_ipc_impl_s *
sapi_ipc_handle_t
;
35
37
typedef
struct
sapi_ipc_config_s
38
{
39
const
char
*
name
;
40
size_t
message_size
;
41
size_t
queue_depth
;
42
}
sapi_ipc_config_t
;
43
56
sapi_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
71
sapi_status_t
sapi_ipc_send
(
sapi_ipc_handle_t
handle,
72
const
void
*message,
73
size_t
message_size,
74
sapi_duration_ms_t
timeout_ms);
75
87
sapi_status_t
sapi_ipc_receive
(
sapi_ipc_handle_t
handle,
88
void
*out_message,
89
size_t
buffer_size,
90
sapi_duration_ms_t
timeout_ms);
91
99
sapi_status_t
sapi_ipc_destroy
(
sapi_ipc_handle_t
handle);
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_ipc_create
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
sapi_ipc_handle_t
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_ipc_receive
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_ipc_destroy
sapi_status_t sapi_ipc_destroy(sapi_ipc_handle_t handle)
Destroys a message channel.
Definition
sapi_ipc.c:108
sapi_ipc_send
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
sapi_status_t
Common result/status codes.
Definition
sapi_status.h:27
sapi_duration_ms_t
uint32_t sapi_duration_ms_t
Definition
sapi_types.h:27
SAFEAPI_DECLARE_STORAGE
#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
sapi_status.h
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
sapi_types.h
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
sapi_ipc_config_t
Configuration for sapi_ipc_create().
Definition
sapi_ipc.h:38
sapi_ipc_config_t::message_size
size_t message_size
Definition
sapi_ipc.h:40
sapi_ipc_config_t::queue_depth
size_t queue_depth
Definition
sapi_ipc.h:41
sapi_ipc_config_t::name
const char * name
Definition
sapi_ipc.h:39
include
safeapi
oal
ipc
sapi_ipc.h
Generated by
1.18.0