eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
Server Setup

Server side setup and control functions. More...

Overview

Server side setup and control functions.

+ Collaboration diagram for Server Setup:

Files

file  erpc_server_setup.h
 

Typedefs

typedef struct ServerType * erpc_server_t
 Opaque server object type.
 

Server setup

erpc_server_t erpc_server_init (erpc_transport_t transport, erpc_mbf_t message_buffer_factory)
 This function initializes server. More...
 
void erpc_server_deinit (erpc_server_t server)
 This function de-initializes server. More...
 
void erpc_add_service_to_server (erpc_server_t server, void *service)
 This function adds service to server. More...
 
void erpc_remove_service_from_server (erpc_server_t server, void *service)
 This function removes service from server. More...
 
void erpc_server_set_crc (erpc_server_t server, uint32_t crcStart)
 Can be used to set own crcStart number. More...
 

Server control

erpc_status_t erpc_server_run (erpc_server_t server)
 This function calls server implementation until it is stopped. More...
 
erpc_status_t erpc_server_poll (erpc_server_t server)
 This function calls server implementation only once. More...
 
void erpc_server_stop (erpc_server_t server)
 This functions should be used when client is calling quit server. More...
 

Function Documentation

erpc_server_t erpc_server_init ( erpc_transport_t  transport,
erpc_mbf_t  message_buffer_factory 
)

This function initializes server.

This function initializes server with all components necessary for running server.

Parameters
[in]transportInitiated transport.
[in]message_buffer_factoryInitiated message buffer factory.
Returns
erpc_server_t Pointer to server structure.
void erpc_server_deinit ( erpc_server_t  server)

This function de-initializes server.

This function de-initializes server and all components which it own.

Parameters
[in]serverPointer to server structure.
void erpc_add_service_to_server ( erpc_server_t  server,
void *  service 
)

This function adds service to server.

Services contain implementations of functions called from client to server.

Parameters
[in]serverPointer to server structure.
[in]serviceService which contains implementations of functions called from client to server.
void erpc_remove_service_from_server ( erpc_server_t  server,
void *  service 
)

This function removes service from server.

Parameters
[in]serverPointer to server structure.
[in]serviceService which contains implementations of functions called from client to server.
void erpc_server_set_crc ( erpc_server_t  server,
uint32_t  crcStart 
)

Can be used to set own crcStart number.

For example can be used generated crc from erpcgen which is providing when annotation is used. Accessed can be through 'extern const uint32_t erpc_generated_crc;'

Parameters
[in]serverPointer to server structure.
[in]crcStartSet start number for crc.
erpc_status_t erpc_server_run ( erpc_server_t  server)

This function calls server implementation until it is stopped.

This is blocking method, where server is trying read (and if it is requested also send) message until it is stopped.

Parameters
[in]serverPointer to server structure.
Returns
Return one of status from erpc_common.h
erpc_status_t erpc_server_poll ( erpc_server_t  server)

This function calls server implementation only once.

This is non-blocking method, where server is trying read (and if it is requested also send) message only once.

Parameters
[in]serverPointer to server structure.
Returns
Return one of status from erpc_common.h
void erpc_server_stop ( erpc_server_t  server)

This functions should be used when client is calling quit server.

This method sets server from On to OFF. When the server returns from its implementation, erpc_server_deinit() function should be called.

Parameters
[in]serverPointer to server structure.