| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- File List
- File Members

erpc_inter_thread_buffer_transport.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2014, Freescale Semiconductor, Inc.
3 * Copyright 2016 NXP
4 * All rights reserved.
5 *
6 *
7 * SPDX-License-Identifier: BSD-3-Clause
8 */
9
10 #ifndef _EMBEDDED_RPC__INTER_THREAD_BUFFER_TRANSPORT_H_
11 #define _EMBEDDED_RPC__INTER_THREAD_BUFFER_TRANSPORT_H_
12
13 #include "erpc_message_buffer.h"
14 #include "erpc_threading.h"
15 #include "erpc_transport.h"
16
23 // Classes
26
27 namespace erpc {
44 class InterThreadBufferTransport : public Transport
45 {
46 public:
47 InterThreadBufferTransport(void)
48 : Transport()
49 , m_state(NULL)
50 , m_peer(NULL)
51 , m_inSem()
52 , m_outSem(1)
53 , m_inBuffer(NULL)
54 {
55 }
56 virtual ~InterThreadBufferTransport(void);
57
58 void linkWithPeer(InterThreadBufferTransport *peer);
59
60 virtual erpc_status_t receive(MessageBuffer *message);
61 virtual erpc_status_t send(const MessageBuffer *message);
62
63 virtual int32_t getAvailable(void) const { return 0; }
64
65 protected:
66 struct SharedState
67 {
68 Mutex m_mutex;
69 };
70
71 SharedState *m_state;
72 InterThreadBufferTransport *m_peer;
73 Semaphore m_inSem;
74 Semaphore m_outSem;
75 MessageBuffer *m_inBuffer;
76 };
77
78 } // namespace erpc
79
82 #endif // _EMBEDDED_RPC__INTER_THREAD_BUFFER_TRANSPORT_H_
erpc::Transport
Abstract interface for transport layer.
Definition: erpc_transport.h:36
erpc::InterThreadBufferTransport::SharedState
Definition: erpc_inter_thread_buffer_transport.h:66
erpc::InterThreadBufferTransport::receive
virtual erpc_status_t receive(MessageBuffer *message)
Prototype for receiving message.
Definition: erpc_inter_thread_buffer_transport.cpp:42
erpc::Transport::Transport
Transport(void)
Constructor.
Definition: erpc_transport.h:42
erpc_status_t
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:87
erpc_transport.h
erpc::MessageBuffer
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.h:37
erpc
Definition: erpc_arbitrated_client_manager.h:25
erpc::InterThreadBufferTransport
Very basic transport to send/receive messages between threads.
Definition: erpc_inter_thread_buffer_transport.h:44
erpc_threading.h
erpc_message_buffer.h
erpc::Mutex
Mutex.
Definition: erpc_threading.h:307
erpc::Semaphore
Simple semaphore class.
Definition: erpc_threading.h:411