eRPC API Reference  Rev. 1.7.0
NXP Semiconductors
erpc_server_setup.h
Go to the documentation of this file.
1 /*
2  * The Clear BSD License
3  * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
4  * Copyright 2016-2017 NXP
5  * All rights reserved.
6  *
7  *
8  * Redistribution and use in source and binary forms, with or without modification,
9  * are permitted (subject to the limitations in the disclaimer below) provided
10  * that the following conditions are met:
11  *
12  * o Redistributions of source code must retain the above copyright notice, this list
13  * of conditions and the following disclaimer.
14  *
15  * o Redistributions in binary form must reproduce the above copyright notice, this
16  * list of conditions and the following disclaimer in the documentation and/or
17  * other materials provided with the distribution.
18  *
19  * o Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from this
21  * software without specific prior written permission.
22  *
23  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
28  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef _EMBEDDED_RPC__SERVER_SETUP_H_
37 #define _EMBEDDED_RPC__SERVER_SETUP_H_
38 
39 #include "erpc_common.h"
40 #include "erpc_config_internal.h"
41 #include "erpc_mbf_setup.h"
42 #include "erpc_transport_setup.h"
43 
50 // API
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #include <stdbool.h>
59 #include <stdint.h>
60 
62 typedef struct ServerType *erpc_server_t;
63 
65 
66 
74 erpc_server_t erpc_server_init(erpc_transport_t transport, erpc_mbf_t message_buffer_factory);
75 
81 void erpc_server_deinit(void);
82 
90 void erpc_add_service_to_server(void *service);
91 
101 void erpc_server_set_crc(uint32_t crcStart);
103 
105 
106 
116 
125 
132 void erpc_server_stop(void);
133 
134 #if ERPC_MESSAGE_LOGGING
135 
143 bool erpc_server_add_message_logger(erpc_transport_t transport);
144 #endif
145 
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
154 #endif // _EMBEDDED_RPC__SERVER_SETUP_H_
int32_t erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:112
struct ErpcTransport * erpc_transport_t
Opaque transport object type.
Definition: erpc_transport_setup.h:50
void erpc_server_stop(void)
This functions should be used when client is calling quit server.
Definition: erpc_server_setup.cpp:119
struct ErpcMessageBufferFactory * erpc_mbf_t
Opaque MessageBufferFactory object type.
Definition: erpc_mbf_setup.h:52
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:61
void erpc_server_set_crc(uint32_t crcStart)
Can be used to set own crcStart number.
Definition: erpc_server_setup.cpp:96
erpc_status_t erpc_server_run(void)
This function calls server implementation until it is stopped.
Definition: erpc_server_setup.cpp:101
erpc_status_t erpc_server_poll(void)
This function calls server implementation only once.
Definition: erpc_server_setup.cpp:110
struct ServerType * erpc_server_t
Opaque server object type.
Definition: erpc_server_setup.h:62
void erpc_server_deinit(void)
This function de-initializes server.
Definition: erpc_server_setup.cpp:80
void erpc_add_service_to_server(void *service)
This function adds service to server.
Definition: erpc_server_setup.cpp:88