eRPC API Reference  Rev. 1.7.2
NXP Semiconductors
erpc::SimpleServer Class Reference

Based server implementation. More...

#include <erpc_simple_server.h>

+ Inheritance diagram for erpc::SimpleServer:
+ Collaboration diagram for erpc::SimpleServer:

Public Member Functions

 SimpleServer (void)
 Constructor. More...
 
virtual ~SimpleServer (void)
 SimpleServer destructor.
 
virtual erpc_status_t run (void)
 Run server in infinite loop. More...
 
virtual erpc_status_t poll (void)
 Run server implementation only if exist message to process. More...
 
virtual void stop (void)
 This function sets server from ON to OFF.
 
- Public Member Functions inherited from erpc::Server
 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...
 

Protected Member Functions

erpc_status_t runInternalBegin (Codec **codec, MessageBuffer &buff, message_type_t &msgType, uint32_t &serviceId, uint32_t &methodId, uint32_t &sequence)
 This function handle receiving request message and reading base info about message. More...
 
erpc_status_t runInternalEnd (Codec *codec, message_type_t msgType, uint32_t serviceId, uint32_t methodId, uint32_t sequence)
 This function process message and handle sending respond. More...
 
erpc_status_t runInternal (void)
 Run server implementation. More...
 
void disposeBufferAndCodec (Codec *codec)
 Disposing message buffers and codecs. More...
 
- Protected Member Functions inherited from erpc::Server
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

bool m_isServerOn
 
- Protected Attributes inherited from erpc::Server
MessageBufferFactorym_messageFactory
 
CodecFactorym_codecFactory
 
Transportm_transport
 
Servicem_firstService
 

Detailed Description

Based server implementation.

Constructor & Destructor Documentation

erpc::SimpleServer::SimpleServer ( void  )
inline

Constructor.

This function initializes object attributes.

Member Function Documentation

erpc_status_t SimpleServer::run ( void  )
virtual

Run server in infinite loop.

Will never jump out from this function.

Implements erpc::Server.

erpc_status_t SimpleServer::poll ( void  )
virtual

Run server implementation only if exist message to process.

If is message to process, server process it and jumps out from this function, useful for bare-metal because doesn't block main loop, when are not messages to process.

Returns
Return true when server is ON, else false.
erpc_status_t SimpleServer::runInternalBegin ( Codec **  codec,
MessageBuffer buff,
message_type_t msgType,
uint32_t &  serviceId,
uint32_t &  methodId,
uint32_t &  sequence 
)
protected

This function handle receiving request message and reading base info about message.

Parameters
[in]codecInout codec to use.
[in]buffInout 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.
erpc_status_t SimpleServer::runInternalEnd ( Codec codec,
message_type_t  msgType,
uint32_t  serviceId,
uint32_t  methodId,
uint32_t  sequence 
)
protected

This function process message and handle sending respond.

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 service handleInvocation.
erpc_status_t SimpleServer::runInternal ( void  )
protected

Run server implementation.

This function call functions for receiving data, process this data and if reply exist, send it back.

void SimpleServer::disposeBufferAndCodec ( Codec codec)
protected

Disposing message buffers and codecs.

Parameters
[in]codecPointer to codec to dispose. It contains also message buffer to dispose.

Member Data Documentation

bool erpc::SimpleServer::m_isServerOn
protected

Information if server is ON or OFF.


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