eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_simple_server.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * Copyright 2021 ACRIOS Systems s.r.o.
5  * All rights reserved.
6  *
7  *
8  * SPDX-License-Identifier: BSD-3-Clause
9  */
10 
11 #ifndef _EMBEDDED_RPC__SIMPLE_SERVER_H_
12 #define _EMBEDDED_RPC__SIMPLE_SERVER_H_
13 
14 #include "erpc_server.hpp"
15 
22 // Classes
25 
26 namespace erpc {
32 class SimpleServer : public Server
33 {
34 public:
40  SimpleServer(void);
41 
42  virtual ~SimpleServer(void);
43 
49  virtual erpc_status_t run(void) override;
50 
60  virtual erpc_status_t poll(void);
61 
65  virtual void stop(void) override;
66 
67 protected:
68  bool m_isServerOn;
77 
90  erpc_status_t runInternalBegin(Codec **codec, MessageBuffer &buff, message_type_t &msgType, uint32_t &serviceId,
91  uint32_t &methodId, uint32_t &sequence);
92 
104  erpc_status_t runInternalEnd(Codec *codec, message_type_t msgType, uint32_t serviceId, uint32_t methodId,
105  uint32_t sequence);
106 
107 #if ERPC_NESTED_CALLS
108 
113  virtual erpc_status_t run(RequestContext &request) override;
114 #endif
115 
121  void disposeBufferAndCodec(Codec *codec);
122 };
123 
124 } // namespace erpc
125 
128 #endif // _EMBEDDED_RPC__SIMPLE_SERVER_H_
erpc_status_t runInternal(void)
Run server implementation.
Definition: erpc_simple_server.cpp:60
message_type_t
Types of messages that can be encoded.
Definition: erpc_codec.hpp:35
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
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.
Definition: erpc_simple_server.cpp:148
virtual erpc_status_t poll(void)
Run server implementation only if exist message to process.
Definition: erpc_simple_server.cpp:32
Abstract serialization encoder/decoder interface.
Definition: erpc_codec.hpp:53
SimpleServer(void)
Constructor.
Definition: erpc_simple_server.cpp:18
bool m_isServerOn
Definition: erpc_simple_server.hpp:68
virtual erpc_status_t run(void) override
Run server in infinite loop.
Definition: erpc_simple_server.cpp:22
Based server functionality.
Definition: erpc_server.hpp:98
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.hpp:37
Definition: erpc_arbitrated_client_manager.hpp:25
virtual void stop(void) override
This function sets server from ON to OFF.
Definition: erpc_simple_server.cpp:55
void disposeBufferAndCodec(Codec *codec)
Disposing message buffers and codecs.
Definition: erpc_simple_server.cpp:234
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.
Definition: erpc_simple_server.cpp:80
Based server implementation.
Definition: erpc_simple_server.hpp:32
Encapsulates all information about a request.
Definition: erpc_client_manager.h:184