eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_inter_thread_buffer_transport.hpp
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.hpp"
14 #include "erpc_threading.h"
15 #include "erpc_transport.hpp"
16 
23 // Classes
26 
27 namespace erpc {
45 {
46 public:
48  Transport(), m_state(NULL), m_peer(NULL), m_inSem(), m_outSem(1), m_inBuffer(NULL)
49  {
50  }
51  virtual ~InterThreadBufferTransport(void);
52 
53  void linkWithPeer(InterThreadBufferTransport *peer);
54 
55  virtual erpc_status_t receive(MessageBuffer *message) override;
56  virtual erpc_status_t send(MessageBuffer *message) override;
57 
58  virtual int32_t getAvailable(void) const { return 0; }
59 
60 protected:
61  struct SharedState
62  {
63  Mutex m_mutex;
64  };
65 
66  SharedState *m_state;
68  Semaphore m_inSem;
69  Semaphore m_outSem;
70  MessageBuffer *m_inBuffer;
71 };
72 
73 } // namespace erpc
74 
77 #endif // _EMBEDDED_RPC__INTER_THREAD_BUFFER_TRANSPORT_H_
Abstract interface for transport layer.
Definition: erpc_transport.hpp:36
Definition: erpc_inter_thread_buffer_transport.hpp:61
Transport(void)
Constructor.
Definition: erpc_transport.hpp:42
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.hpp:37
Definition: erpc_arbitrated_client_manager.hpp:25
virtual erpc_status_t send(MessageBuffer *message) override
Prototype for send message.
Definition: erpc_inter_thread_buffer_transport.cpp:59
Very basic transport to send/receive messages between threads.
Definition: erpc_inter_thread_buffer_transport.hpp:44
Mutex.
Definition: erpc_threading.h:339
virtual erpc_status_t receive(MessageBuffer *message) override
Prototype for receiving message.
Definition: erpc_inter_thread_buffer_transport.cpp:40
Simple semaphore class.
Definition: erpc_threading.h:442