eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
Client Setup

Client side setup functions. More...

Overview

Client side setup functions.

+ Collaboration diagram for Client Setup:

Files

file  erpc_arbitrated_client_setup.h
 
file  erpc_client_setup.h
 

Arbitrated client setup

erpc_client_t erpc_arbitrated_client_init (erpc_transport_t transport, erpc_mbf_t message_buffer_factory, erpc_transport_t *arbitrator)
 Initializes a client that shares its transport with the server. More...
 
void erpc_arbitrated_client_set_error_handler (erpc_client_t client, client_error_handler_t error_handler)
 This function sets error handler function. More...
 
void erpc_arbitrated_client_set_crc (erpc_client_t client, uint32_t crcStart)
 Can be used to set own crcStart number. More...
 
void erpc_arbitrated_client_deinit (erpc_client_t client)
 This function de-initializes client. More...
 

Client setup

erpc_client_t erpc_client_init (erpc_transport_t transport, erpc_mbf_t message_buffer_factory)
 This function initializes client. More...
 
void erpc_client_set_error_handler (erpc_client_t client, client_error_handler_t error_handler)
 This function sets error handler function. More...
 
void erpc_client_set_crc (erpc_client_t client, uint32_t crcStart)
 Can be used to set own crcStart number. More...
 
void erpc_client_deinit (erpc_client_t client)
 This function de-initializes client. More...
 

Function Documentation

erpc_client_t erpc_arbitrated_client_init ( erpc_transport_t  transport,
erpc_mbf_t  message_buffer_factory,
erpc_transport_t arbitrator 
)

Initializes a client that shares its transport with the server.

This function initializes a client with all components necessary for sending client requests using the same transport instance as used by a server. Only one instance of the shared transport should be created. The transport arbitrator that wraps the shared transport is returned. This arbitrator, not the shared transport, should be passed to the server setup routine.

Example use:

1 erpc_transport_t arbitrator;
2 erpc_transport_t sharedSerial = erpc_transport_serial_init(...);
3 erpc_client_t client = erpc_arbitrated_client_init(sharedSerial, message_buffer_factory, &arbitrator);
4 erpc_server_init(arbitrator);
Parameters
[in]transportInitiated transport.
[in]message_buffer_factoryInitiated message buffer factory.
[out]arbitratorTransport arbitrator reference that should be passed to the server setup API.
Returns
erpc_client_t Pointer to client structure.
void erpc_arbitrated_client_set_error_handler ( erpc_client_t  client,
client_error_handler_t  error_handler 
)

This function sets error handler function.

Given error_handler function is called when error occur inside eRPC infrastructure.

Parameters
[in]clientPointer to client structure.
[in]error_handlerPointer to function error handler.
void erpc_arbitrated_client_set_crc ( erpc_client_t  client,
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]clientPointer to client structure.
[in]crcStartSet start number for crc.
void erpc_arbitrated_client_deinit ( erpc_client_t  client)

This function de-initializes client.

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

Parameters
[in]clientPointer to client structure.
erpc_client_t erpc_client_init ( erpc_transport_t  transport,
erpc_mbf_t  message_buffer_factory 
)

This function initializes client.

This function initializes client with all components necessary for serve client request.

Parameters
[in]transportInitiated transport.
[in]message_buffer_factoryInitiated message buffer factory.
Returns
erpc_client_t Pointer to client structure.
void erpc_client_set_error_handler ( erpc_client_t  client,
client_error_handler_t  error_handler 
)

This function sets error handler function.

Given error_handler function is called when error occur inside eRPC infrastructure.

Parameters
[in]clientPointer to client structure.
[in]error_handlerPointer to function error handler.
void erpc_client_set_crc ( erpc_client_t  client,
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]clientPointer to client structure.
[in]crcStartSet start number for crc.
void erpc_client_deinit ( erpc_client_t  client)

This function de-initializes client.

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

Parameters
[in]clientPointer to client structure.