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

Based server functionality. More...

#include <erpc_server.hpp>

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

Public Member Functions

 Server (void)
 Constructor. More...
 
virtual ~Server (void)
 Server destructor.
 
void addService (Service *service)
 Add service. More...
 
void removeService (Service *service)
 Remove service. More...
 
virtual erpc_status_t run (void)=0
 This function runs the server.
 
virtual void stop (void)=0
 This function stop the server.
 
- Public Member Functions inherited from erpc::ClientServerCommon
 ClientServerCommon (void)
 ClientServerCommon constructor.
 
 ~ClientServerCommon (void)
 ClientServerCommon destructor.
 
void setMessageBufferFactory (MessageBufferFactory *factory)
 This function sets message buffer factory to use. More...
 
void setCodecFactory (CodecFactory *factory)
 This function sets codec factory to use. More...
 
CodecFactorygetCodecFactory (void)
 This function sets codec factory to use. More...
 
void setTransport (Transport *transport)
 This function sets transport layer to use. More...
 
TransportgetTransport (void)
 This function gets transport instance. More...
 

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

Servicem_firstService
 
- Protected Attributes inherited from erpc::ClientServerCommon
MessageBufferFactorym_messageFactory
 Message buffer factory to use.
 
CodecFactorym_codecFactory
 Codec to use.
 
Transportm_transport
 Transport layer to use.
 

Detailed Description

Based server functionality.

Constructor & Destructor Documentation

erpc::Server::Server ( void  )
inline

Constructor.

This function initializes object attributes.

Member Function Documentation

void Server::addService ( Service service)

Add service.

Parameters
[in]serviceService to use.
void Server::removeService ( Service service)

Remove service.

Parameters
[in]serviceService to remove.
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

Service* erpc::Server::m_firstService
protected

Contains pointer to first service.


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