| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

Files | Typedefs
Server Setup
Setup API

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 (void)
| This function de-initializes server. More...
void | erpc_add_service_to_server (void *service)
| This function adds service to server. More...
void | erpc_remove_service_from_server (void *service)
| This function removes service from server. More...
void | erpc_server_set_crc (uint32_t crcStart)
| Can be used to set own crcStart number. More...

## Server control
erpc_status_t | erpc_server_run (void)
| This function calls server implementation until it is stopped. More...
erpc_status_t | erpc_server_poll (void)
| This function calls server implementation only once. More...
void | erpc_server_stop (void)
| 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.

Returns
  Server object type.

void erpc_server_deinit | ( | void |  | ) |

This function de-initializes server.

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

void erpc_add_service_to_server | ( | void * | service | ) |

This function adds service to server.

Services contain implementations of functions called from client to server.

Parameters

  [in] | service | Service which contains implementations of functions called from client to server.

void erpc_remove_service_from_server | ( | void * | service | ) |

This function removes service from server.

Parameters

  [in] | service | Service which contains implementations of functions called from client to server.

void erpc_server_set_crc | ( | 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] | crcStart | Set start number for crc.

erpc_status_t erpc_server_run | ( | void |  | ) |

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.

Returns
  Return one of status from erpc_common.h

erpc_status_t erpc_server_poll | ( | void |  | ) |

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.

Returns
  Return one of status from erpc_common.h

void erpc_server_stop | ( | void |  | ) |

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.