eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_server_setup.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * Copyright 2020 ACRIOS Systems s.r.o.
5  * All rights reserved.
6  *
7  *
8  * SPDX-License-Identifier: BSD-3-Clause
9  */
10 
11 #ifndef _EMBEDDED_RPC__SERVER_SETUP_H_
12 #define _EMBEDDED_RPC__SERVER_SETUP_H_
13 
14 #include "erpc_common.h"
15 #include "erpc_config_internal.h"
16 #include "erpc_mbf_setup.h"
17 #include "erpc_transport_setup.h"
18 #if ERPC_PRE_POST_ACTION
19 #include "erpc_pre_post_action.h"
20 #endif
21 
28 // API
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <stdbool.h>
37 #include <stdint.h>
38 
40 typedef struct ServerType *erpc_server_t;
41 
43 
44 
55 erpc_server_t erpc_server_init(erpc_transport_t transport, erpc_mbf_t message_buffer_factory);
56 
64 void erpc_server_deinit(erpc_server_t server);
65 
74 void erpc_add_service_to_server(erpc_server_t server, void *service);
75 
82 void erpc_remove_service_from_server(erpc_server_t server, void *service);
83 
94 void erpc_server_set_crc(erpc_server_t server, uint32_t crcStart);
96 
98 
99 
110 erpc_status_t erpc_server_run(erpc_server_t server);
111 
121 erpc_status_t erpc_server_poll(erpc_server_t server);
122 
131 void erpc_server_stop(erpc_server_t server);
132 
133 #if ERPC_MESSAGE_LOGGING
134 
143 bool erpc_server_add_message_logger(erpc_server_t server, erpc_transport_t transport);
144 #endif
145 
146 #if ERPC_PRE_POST_ACTION
147 
154 void erpc_server_add_pre_cb_action(erpc_server_t server, pre_post_action_cb preCB);
155 
163 void erpc_server_add_post_cb_action(erpc_server_t server, pre_post_action_cb postCB);
164 #endif
165 
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
174 #endif // _EMBEDDED_RPC__SERVER_SETUP_H_
struct ErpcTransport * erpc_transport_t
Opaque transport object type.
Definition: erpc_transport_setup.h:25
erpc_status_t erpc_server_run(erpc_server_t server)
This function calls server implementation until it is stopped.
Definition: erpc_server_setup.cpp:153
erpc_status_t erpc_server_poll(erpc_server_t server)
This function calls server implementation only once.
Definition: erpc_server_setup.cpp:162
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
struct ErpcMessageBufferFactory * erpc_mbf_t
Opaque MessageBufferFactory object type.
Definition: erpc_mbf_setup.h:26
void erpc_server_set_crc(erpc_server_t server, uint32_t crcStart)
Can be used to set own crcStart number.
Definition: erpc_server_setup.cpp:144
erpc_server_t erpc_server_init(erpc_transport_t transport, erpc_mbf_t message_buffer_factory)
This function initializes server.
Definition: erpc_server_setup.cpp:35
void erpc_add_service_to_server(erpc_server_t server, void *service)
This function adds service to server.
Definition: erpc_server_setup.cpp:125
void erpc_remove_service_from_server(erpc_server_t server, void *service)
This function removes service from server.
Definition: erpc_server_setup.cpp:134
void erpc_server_deinit(erpc_server_t server)
This function de-initializes server.
Definition: erpc_server_setup.cpp:105
void erpc_server_stop(erpc_server_t server)
This functions should be used when client is calling quit server.
Definition: erpc_server_setup.cpp:171
struct ServerType * erpc_server_t
Opaque server object type.
Definition: erpc_server_setup.h:40