eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc::InterThreadBufferTransport Class Reference

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

#include <erpc_inter_thread_buffer_transport.hpp>

+ Inheritance diagram for erpc::InterThreadBufferTransport:
+ Collaboration diagram for erpc::InterThreadBufferTransport:

Classes

struct  SharedState
 

Public Member Functions

void linkWithPeer (InterThreadBufferTransport *peer)
 
virtual erpc_status_t receive (MessageBuffer *message) override
 Prototype for receiving message. More...
 
virtual erpc_status_t send (MessageBuffer *message) override
 Prototype for send message. More...
 
virtual int32_t getAvailable (void) const
 
- Public Member Functions inherited from erpc::Transport
 Transport (void)
 Constructor.
 
virtual ~Transport (void)
 Transport destructor.
 
virtual uint8_t reserveHeaderSize (void)
 Size of data placed in MessageBuffer before serializing eRPC data. More...
 
virtual bool hasMessage (void)
 Poll for an incoming message. More...
 
virtual void setCrc16 (Crc16 *crcImpl)
 This functions sets the CRC-16 implementation. More...
 
virtual Crc16getCrc16 (void)
 This functions gets the CRC-16 object. More...
 

Protected Attributes

SharedStatem_state
 
InterThreadBufferTransportm_peer
 
Semaphore m_inSem
 
Semaphore m_outSem
 
MessageBufferm_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:
Class Members
Mutex m_mutex

Member Function Documentation

erpc_status_t InterThreadBufferTransport::receive ( MessageBuffer message)
overridevirtual

Prototype for receiving message.

Each transport layer need define this function.

Parameters
[out]messageWill return pointer to received message buffer.
Returns
based on receive implementation.

Implements erpc::Transport.

erpc_status_t InterThreadBufferTransport::send ( MessageBuffer message)
overridevirtual

Prototype for send message.

Each transport layer need define this function.

Parameters
[in]messagePass message buffer to send.
Returns
based on send implementation.

Implements erpc::Transport.


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