eRPC API Reference
Rev. 1.12.0
NXP Semiconductors
|
Very basic transport to send/receive messages between threads. More...
#include <erpc_inter_thread_buffer_transport.hpp>
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 Crc16 * | getCrc16 (void) |
This functions gets the CRC-16 object. More... | |
Protected Attributes | |
SharedState * | m_state |
InterThreadBufferTransport * | m_peer |
Semaphore | m_inSem |
Semaphore | m_outSem |
MessageBuffer * | m_inBuffer |
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.
struct erpc::InterThreadBufferTransport::SharedState |
Class Members | ||
---|---|---|
Mutex | m_mutex |
|
overridevirtual |
Prototype for receiving message.
Each transport layer need define this function.
[out] | message | Will return pointer to received message buffer. |
Implements erpc::Transport.
|
overridevirtual |
Prototype for send message.
Each transport layer need define this function.
[in] | message | Pass message buffer to send. |
Implements erpc::Transport.