Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_channel_service.h
Go to the documentation of this file.
1#ifndef RTE_CHANNEL_SERVICE_H
2#define RTE_CHANNEL_SERVICE_H
3
13
14#include <stddef.h>
15#include <stdint.h>
16
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#define RTE_CHANNEL_SERVICE_NAME_SIZE (32U)
25
27typedef struct
28{
29 uint8_t reserved[128U];
31
34
42typedef struct
43{
45 const char *channel_name);
47 void *data,
48 size_t data_size,
49 rte_duration_ms_t timeout_ms);
63 const void *data,
64 size_t data_size,
65 rte_duration_ms_t timeout_ms);
75 void *data,
76 size_t data_size,
77 rte_duration_ms_t timeout_ms,
78 size_t *out_actual_size);
80
86
87rte_status_t rte_channel_service_setup(rte_channel_service_t *storage, const char *channel_name);
88rte_status_t rte_channel_service_setup_by_id(rte_channel_service_t *storage, uint32_t channel_id);
89rte_status_t rte_channel_service_read(rte_channel_service_t *storage,
90 void *data,
91 size_t data_size,
92 rte_duration_ms_t timeout_ms);
104 void *data,
105 size_t data_size,
106 rte_duration_ms_t timeout_ms,
107 size_t *out_actual_size);
121 const void *data,
122 size_t data_size,
123 rte_duration_ms_t timeout_ms);
124rte_status_t rte_channel_service_close(rte_channel_service_t *storage);
125
126#ifdef __cplusplus
127}
128#endif
129
130#endif
rte_status_t
Common result/status codes.
Definition rte_status.h:27
uint32_t rte_duration_ms_t
Definition rte_types.h:27
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_channel_service_storage_t rte_channel_service_t
Opaque handle to a named channel service instance.
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 (nev...
rte_status_t rte_osadapter_channel_service_register(const rte_osadapter_channel_service_t *osadapter)
Registers the OSAdapter that implements named channels (ADR-005).
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...
Caller-owned storage for one named channel service instance.
OSAdapter implementation for named channel operations.
rte_status_t(*) send(rte_channel_service_storage_t *storage, const void *data, size_t data_size, rte_duration_ms_t timeout_ms)
Sends data_size bytes of data on the channel set up in storage, within timeout_ms.
rte_status_t(*) read_ex(rte_channel_service_storage_t *storage, void *data, size_t data_size, rte_duration_ms_t timeout_ms, size_t *out_actual_size)
Optional: same as read, but also reports the true number of bytes the transport actually received (a ...