| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- File List
- File Members

erpc_simple_server.h
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.h"
15
22 // Classes
25
26 namespace erpc {
32 class SimpleServer : public Server
33 {
34 public:
40 SimpleServer(void)
41 : m_isServerOn(true)
42 {
43 }
44
50 virtual erpc_status_t run(void) override;
51
61 virtual erpc_status_t poll(void);
62
66 virtual void stop(void) override;
67
68 protected:
81 erpc_status_t runInternalBegin(Codec **codec, MessageBuffer &buff, message_type_t &msgType, uint32_t &serviceId,
82 uint32_t &methodId, uint32_t &sequence);
83
95 erpc_status_t runInternalEnd(Codec *codec, message_type_t msgType, uint32_t serviceId, uint32_t methodId,
96 uint32_t sequence);
97
98 #if ERPC_NESTED_CALLS
99
104 virtual erpc_status_t run(RequestContext &request) override;
105 #endif
106
113 erpc_status_t runInternal(void);
114
120 void disposeBufferAndCodec(Codec *codec);
121
122 bool m_isServerOn;
123 };
124
125 } // namespace erpc
126
129 #endif // _EMBEDDED_RPC__SIMPLE_SERVER_H_
erpc::message_type_t
message_type_t
Types of messages that can be encoded.
Definition: erpc_codec.h:35
erpc::SimpleServer::runInternal
erpc_status_t runInternal(void)
Run server implementation.
Definition: erpc_simple_server.cpp:31
erpc_status_t
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:87
erpc::SimpleServer::runInternalEnd
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:119
erpc::SimpleServer::poll
virtual erpc_status_t poll(void)
Run server implementation only if exist message to process.
Definition: erpc_simple_server.cpp:215
erpc::Codec
Abstract serialization encoder/decoder interface.
Definition: erpc_codec.h:53
erpc::SimpleServer::SimpleServer
SimpleServer(void)
Constructor.
Definition: erpc_simple_server.h:40
erpc::SimpleServer::m_isServerOn
bool m_isServerOn
Definition: erpc_simple_server.h:122
erpc::SimpleServer::run
virtual erpc_status_t run(void) override
Run server in infinite loop.
Definition: erpc_simple_server.cpp:154
erpc::Server
Based server functionality.
Definition: erpc_server.h:103
erpc::MessageBuffer
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.h:37
erpc
Definition: erpc_arbitrated_client_manager.h:25
erpc::SimpleServer::stop
virtual void stop(void) override
This function sets server from ON to OFF.
Definition: erpc_simple_server.cpp:238
erpc::SimpleServer::disposeBufferAndCodec
void disposeBufferAndCodec(Codec *codec)
Disposing message buffers and codecs.
Definition: erpc_simple_server.cpp:19
erpc::SimpleServer::runInternalBegin
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:51
erpc::SimpleServer
Based server implementation.
Definition: erpc_simple_server.h:32
erpc_server.h
erpc::RequestContext
Encapsulates all information about a request.
Definition: erpc_client_manager.h:212