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_channel_service.h
Go to the documentation of this file.
1
#ifndef SAPI_CHANNEL_SERVICE_H
2
#define SAPI_CHANNEL_SERVICE_H
3
13
14
#include <stddef.h>
15
#include <stdint.h>
16
17
#include "
safeapi/utils/status/sapi_status.h
"
18
#include "
safeapi/utils/types/sapi_types.h
"
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
24
#define SAPI_CHANNEL_SERVICE_NAME_SIZE (32U)
25
27
typedef
struct
28
{
29
uint8_t reserved[128U];
30
}
sapi_channel_service_storage_t
;
31
33
typedef
sapi_channel_service_storage_t
sapi_channel_service_t
;
34
42
typedef
struct
43
{
44
sapi_status_t
(*setup)(
sapi_channel_service_storage_t
*storage,
45
const
char
*channel_name);
46
sapi_status_t
(*read)(
sapi_channel_service_storage_t
*storage,
47
void
*data,
48
size_t
data_size,
49
sapi_duration_ms_t
timeout_ms);
50
sapi_status_t
(*send)(
sapi_channel_service_storage_t
*storage,
51
const
void
*data,
52
size_t
data_size,
53
sapi_duration_ms_t
timeout_ms);
54
sapi_status_t
(*close)(
sapi_channel_service_storage_t
*storage);
55
}
sapi_channel_service_backend_t
;
56
57
sapi_status_t
sapi_channel_service_register_backend(
const
sapi_channel_service_backend_t
*backend);
58
sapi_status_t
sapi_channel_service_setup(
sapi_channel_service_t
*storage,
const
char
*channel_name);
59
sapi_status_t
sapi_channel_service_read(
sapi_channel_service_t
*storage,
60
void
*data,
61
size_t
data_size,
62
sapi_duration_ms_t
timeout_ms);
63
sapi_status_t
sapi_channel_service_send(
sapi_channel_service_t
*storage,
64
const
void
*data,
65
size_t
data_size,
66
sapi_duration_ms_t
timeout_ms);
67
sapi_status_t
sapi_channel_service_close(
sapi_channel_service_t
*storage);
68
69
#ifdef __cplusplus
70
}
71
#endif
72
73
#endif
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
sapi_channel_service_t
sapi_channel_service_storage_t sapi_channel_service_t
Opaque handle to a named channel service instance.
Definition
sapi_channel_service.h:33
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_channel_service_backend_t
Backend implementation for named channel operations.
Definition
sapi_channel_service.h:43
sapi_channel_service_storage_t
Caller-owned storage for one named channel service instance.
Definition
sapi_channel_service.h:28
include
safeapi
redundancy
channel_service
sapi_channel_service.h
Generated by
1.18.0