| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Protected Attributes | List of all members
erpc::InterThreadBufferTransport Class Reference
Transport Layers » Inter-thread

Very basic transport to send/receive messages between threads. More...

`#include <erpc_inter_thread_buffer_transport.h>`

Inheritance diagram for erpc::InterThreadBufferTransport:
[legend]
Collaboration diagram for erpc::InterThreadBufferTransport:
[legend]

## Classes
struct | SharedState

## Public Member Functions
void | linkWithPeer (InterThreadBufferTransport *peer)
virtual erpc_status_t | receive (MessageBuffer *message)
| Prototype for receiving message. More...
virtual erpc_status_t | send (const MessageBuffer *message)
virtual int32_t | getAvailable (void) const
Public Member Functions inherited from erpc::Transport
| Transport (void)
| Constructor.
virtual | ~Transport (void)
| Transport destructor.
virtual erpc_status_t | send (MessageBuffer *message)=0
| Prototype for send message. More...
virtual bool | hasMessage (void)
| Poll for an incoming message. More...
virtual void | setCrc16 (Crc16 *crcImpl)
| This functions sets the CRC-16 implementation. More...

## Protected Attributes
SharedState * | m_state
InterThreadBufferTransport * | m_peer
Semaphore | m_inSem
Semaphore | m_outSem
MessageBuffer * | m_inBuffer

## Detailed Description

Very basic transport to send/receive messages between threads.

Can send and receive message buffers to/from another instance of the same class associated with another thread. Only one other thread may be communicated with. To set things up first create two instances. Then call the linkWithPeer() method on the first one, passing the second. The two instances of this class do not have to be created on their respective threads, but the send() and receive() calls must be invoked on the appropriate thread.

Only a single message may be pending for each of the two threads. If a message is pending for a thread and another is sent, then the sender will block until the currently pending message is received.

## Class Documentation

struct erpc::InterThreadBufferTransport::SharedState

Collaboration diagram for erpc::InterThreadBufferTransport::SharedState:
[legend]

Class Members
Mutex | m_mutex |

## Member Function Documentation

erpc_status_t InterThreadBufferTransport::receive | ( | MessageBuffer * | message | ) |
| virtual

Prototype for receiving message.

Each transport layer need define this function.

Parameters

  [out] | message | Will return pointer to received message buffer.

Returns
  based on receive implementation.

Implements erpc::Transport.

The documentation for this class was generated from the following files:

- erpc_inter_thread_buffer_transport.h
- erpc_inter_thread_buffer_transport.cpp