eRPC API Reference
Rev. 1.12.0
NXP Semiconductors
|
Based server implementation. More...
#include <erpc_simple_server.hpp>
Public Member Functions | |
SimpleServer (void) | |
Constructor. More... | |
virtual erpc_status_t | run (void) override |
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) override |
This function sets server from ON to OFF. | |
Public Member Functions inherited from erpc::Server | |
Server (void) | |
Constructor. More... | |
virtual | ~Server (void) |
Server destructor. | |
void | addService (Service *service) |
Add service. More... | |
void | removeService (Service *service) |
Remove service. More... | |
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... | |
CodecFactory * | getCodecFactory (void) |
This function sets codec factory to use. More... | |
void | setTransport (Transport *transport) |
This function sets transport layer to use. More... | |
Transport * | getTransport (void) |
This function gets transport instance. More... | |
Protected Member Functions | |
erpc_status_t | runInternal (void) |
Run server implementation. More... | |
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... | |
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 Service * | findServiceWithId (uint32_t serviceId) |
This function finds service base on service ID. More... | |
Protected Attributes | |
bool | m_isServerOn |
Protected Attributes inherited from erpc::Server | |
Service * | m_firstService |
Protected Attributes inherited from erpc::ClientServerCommon | |
MessageBufferFactory * | m_messageFactory |
Message buffer factory to use. | |
CodecFactory * | m_codecFactory |
Codec to use. | |
Transport * | m_transport |
Transport layer to use. | |
Based server implementation.
SimpleServer::SimpleServer | ( | void | ) |
Constructor.
This function initializes object attributes.
|
overridevirtual |
|
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.
|
protected |
Run server implementation.
This function call functions for receiving data, process this data and if reply exist, send it back.
|
protected |
This function handle receiving request message and reading base info about message.
[in] | codec | Inout codec to use. |
[in] | buff | Inout codec to use. |
[out] | msgType | Type of received message. Based on message type will be (will be not) sent respond. |
[out] | serviceId | To identify interface. |
[out] | methodId | To identify function in interface. |
[out] | sequence | To connect correct answer with correct request. |
|
protected |
This function process message and handle sending respond.
[in] | codec | Inout codec to use. |
[in] | msgType | Type of received message. Based on message type will be (will be not) sent respond. |
[in] | serviceId | To identify interface. |
[in] | methodId | To identify function in interface. |
[in] | sequence | To connect correct answer with correct request. |
|
protected |
Disposing message buffers and codecs.
[in] | codec | Pointer to codec to dispose. It contains also message buffer to dispose. |
|
protected |
Information if server is ON or OFF.