eRPC API Reference  Rev. 1.7.2
NXP Semiconductors
erpc::Server Class Referenceabstract

Based server functionality. More...

#include <erpc_server.h>

+ Inheritance diagram for erpc::Server:
+ Collaboration diagram for erpc::Server:

Public Member Functions

 Server (void)
 Constructor. More...
 
virtual ~Server (void)
 ClientManager destructor.
 
void setMessageBufferFactory (MessageBufferFactory *factory)
 Set MessageBufferFactory to use. More...
 
void setCodecFactory (CodecFactory *factory)
 Set CodecFactory to use. More...
 
void setTransport (Transport *transport)
 This function sets transport layer to use. More...
 
void addService (Service *service)
 Add service. More...
 
virtual erpc_status_t run (void)=0
 This function runs the server.
 
virtual void stop (void)=0
 This function stop the server.
 

Protected Member Functions

virtual erpc_status_t processMessage (Codec *codec, message_type_t msgType, uint32_t serviceId, uint32_t methodId, uint32_t sequence)
 Process message. More...
 
virtual erpc_status_t readHeadOfMessage (Codec *codec, message_type_t &msgType, uint32_t &serviceId, uint32_t &methodId, uint32_t &sequence)
 Read head of message to identify type of message. More...
 
virtual ServicefindServiceWithId (uint32_t serviceId)
 This function finds service base on service ID. More...
 

Protected Attributes

MessageBufferFactorym_messageFactory
 
CodecFactorym_codecFactory
 
Transportm_transport
 
Servicem_firstService
 

Detailed Description

Based server functionality.

Constructor & Destructor Documentation

erpc::Server::Server ( void  )
inline

Constructor.

This function initializes object attributes.

Member Function Documentation

void erpc::Server::setMessageBufferFactory ( MessageBufferFactory factory)
inline

Set MessageBufferFactory to use.

Parameters
[in]factoryMessageBufferFactory to use.
void erpc::Server::setCodecFactory ( CodecFactory factory)
inline

Set CodecFactory to use.

Parameters
[in]factoryCodecFactory to use.
void Server::setTransport ( Transport transport)

This function sets transport layer to use.

It also set messageBufferFactory to the same as in transport layer.

Parameters
[in]transportTransport layer to use.
void Server::addService ( Service service)

Add service.

Parameters
[in]serviceService to use.
erpc_status_t Server::processMessage ( Codec codec,
message_type_t  msgType,
uint32_t  serviceId,
uint32_t  methodId,
uint32_t  sequence 
)
protectedvirtual

Process message.

Parameters
[in]codecInout codec to use.
[in]msgTypeType of received message. Based on message type will be (will be not) sent respond.
[in]serviceIdTo identify interface.
[in]methodIdTo identify function in interface.
[in]sequenceTo connect correct answer with correct request.
Returns
kErpcStatus_Success or based on codec startReadMessage.
erpc_status_t Server::readHeadOfMessage ( Codec codec,
message_type_t msgType,
uint32_t &  serviceId,
uint32_t &  methodId,
uint32_t &  sequence 
)
protectedvirtual

Read head of message to identify type of message.

Parameters
[in]codecInout codec to use.
[out]msgTypeType of received message. Based on message type will be (will be not) sent respond.
[out]serviceIdTo identify interface.
[out]methodIdTo identify function in interface.
[out]sequenceTo connect correct answer with correct request.
Returns
kErpcStatus_Success or based on service handleInvocation.
Service * Server::findServiceWithId ( uint32_t  serviceId)
protectedvirtual

This function finds service base on service ID.

Parameters
[in]serviceIdService id number.
Returns
Pointer to service or NULL.

Member Data Documentation

MessageBufferFactory* erpc::Server::m_messageFactory
protected

Contains MessageBufferFactory to use.

CodecFactory* erpc::Server::m_codecFactory
protected

Contains CodecFactory to use.

Transport* erpc::Server::m_transport
protected

Transport layer used to send and receive data.

Service* erpc::Server::m_firstService
protected

Contains pointer to first service.


The documentation for this class was generated from the following files: