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

Transport that uses RPMsg zero copy API for interprocessor messaging. More...

#include <erpc_rpmsg_lite_transport.hpp>

+ Inheritance diagram for erpc::RPMsgTransport:
+ Collaboration diagram for erpc::RPMsgTransport:

Public Member Functions

 RPMsgTransport (void)
 Constructor. More...
 
virtual ~RPMsgTransport (void)
 RPMsgTransport destructor.
 
virtual erpc_status_t init (uint32_t src_addr, uint32_t dst_addr, void *base_address, uint32_t length, uint32_t rpmsg_link_id)
 Initialization of RPMsgTransport layer - as RPMsg master. More...
 
virtual erpc_status_t init (uint32_t src_addr, uint32_t dst_addr, void *base_address, uint32_t rpmsg_link_id, void(*ready_cb)(void), char *nameservice_name)
 Initialization of RPMsgTransport layer - as RPMsg remote. More...
 
virtual erpc_status_t receive (MessageBuffer *message) override
 Set message to first received message. More...
 
virtual erpc_status_t send (MessageBuffer *message) override
 Function to send prepared message. More...
 
virtual bool hasMessage (void) override
 Function to check if is message in receive queue and wait for processing. More...
 
virtual void setCrc16 (Crc16 *crcImpl) override
 This functions sets the CRC-16 implementation. More...
 
virtual Crc16getCrc16 (void) override
 This functions gets the CRC-16 object. More...
 
- 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...
 
- Public Member Functions inherited from erpc::RPMsgBase
struct rpmsg_lite_instance * get_rpmsg_lite_instance (void)
 This function returns pointer to instance of RPMSG lite. More...
 

Static Protected Member Functions

static int32_t rpmsg_read_cb (void *payload, uint32_t payload_len, uint32_t src, void *priv)
 RPMSG callback for receiving data. More...
 

Protected Attributes

StaticQueue< MessageBuffer, 2U *ERPC_DEFAULT_BUFFERS_COUNT > m_messageQueue
 
uint32_t m_dst_addr
 
struct rpmsg_lite_endpoint * m_rpmsg_ept
 
Crc16m_crcImpl
 CRC object.
 

Additional Inherited Members

- Static Protected Attributes inherited from erpc::RPMsgBase
static struct rpmsg_lite_instance * s_rpmsg
 
static uint8_t s_initialized
 

Detailed Description

Transport that uses RPMsg zero copy API for interprocessor messaging.

Constructor & Destructor Documentation

RPMsgTransport::RPMsgTransport ( void  )

Constructor.

This function initializes object attributes.

Member Function Documentation

erpc_status_t RPMsgTransport::init ( uint32_t  src_addr,
uint32_t  dst_addr,
void *  base_address,
uint32_t  length,
uint32_t  rpmsg_link_id 
)
virtual

Initialization of RPMsgTransport layer - as RPMsg master.

Call init() for RPMsg. Create buffers for receiving messages.

Parameters
[in]src_addrSource address.
[in]dst_addrDestination address.
[in]base_addressRPMsg base address in the shared memory.
[in]lengthRPMsg shared memory region length.
[in]rpmsg_link_idSelection between what cores the communication will occur.
Return values
kErpcStatus_SuccessWhen rpmsg init function was executed successfully.
kErpcStatus_InitFailedWhen rpmsg init function wasn't executed successfully.
erpc_status_t RPMsgTransport::init ( uint32_t  src_addr,
uint32_t  dst_addr,
void *  base_address,
uint32_t  rpmsg_link_id,
void(*)(void)  ready_cb,
char *  nameservice_name 
)
virtual

Initialization of RPMsgTransport layer - as RPMsg remote.

Call init() for RPMsg. Create buffers for receiving messages.

Parameters
[in]src_addrSource address.
[in]dst_addrDestination address.
[in]base_addressRPMsg base address in the shared memory.
[in]rpmsg_link_idSelection between what cores the communication will occur.
[in]ready_cbCallback called after RPMsg init is done and the core is ready.
[in]nameservice_nameName of the nameservice channel to be announced to the other core.
Return values
kErpcStatus_SuccessWhen rpmsg init function was executed successfully.
kErpcStatus_InitFailedWhen rpmsg init function wasn't executed successfully.
erpc_status_t RPMsgTransport::receive ( MessageBuffer message)
overridevirtual

Set message to first received message.

In loop while no message come.

Parameters
[in]messageMessage buffer, to which will be stored incoming message.
Returns
kErpcStatus_Success

Implements erpc::Transport.

erpc_status_t RPMsgTransport::send ( MessageBuffer message)
overridevirtual

Function to send prepared message.

Parameters
[in]messagePass message buffer to send.
Return values
kErpcStatus_SendFailedFailed to send message buffer.
kErpcStatus_SuccessSuccessfully sent all data.

Implements erpc::Transport.

bool RPMsgTransport::hasMessage ( void  )
overridevirtual

Function to check if is message in receive queue and wait for processing.

This function should be called before function receive() to avoid waiting for new message.

Returns
True if exist received message, else false.

Reimplemented from erpc::Transport.

void RPMsgTransport::setCrc16 ( Crc16 crcImpl)
overridevirtual

This functions sets the CRC-16 implementation.

Parameters
[in]crcImplObject containing crc-16 compute function.

Reimplemented from erpc::Transport.

Crc16 * RPMsgTransport::getCrc16 ( void  )
overridevirtual

This functions gets the CRC-16 object.

Returns
Crc16* Pointer to CRC-16 object containing crc-16 compute function.

Reimplemented from erpc::Transport.

int32_t RPMsgTransport::rpmsg_read_cb ( void *  payload,
uint32_t  payload_len,
uint32_t  src,
void *  priv 
)
staticprotected

RPMSG callback for receiving data.

This function is used as RPMSG receive callback in which is copied message to free message buffer.

Parameters
payloadRPMSG data to receive.
payload_lenLength of data.
srcSource endpoint address.
privCallback data.
Returns

Member Data Documentation

StaticQueue<MessageBuffer, 2U * ERPC_DEFAULT_BUFFERS_COUNT> erpc::RPMsgTransport::m_messageQueue
protected

Received messages. Queue of messages with buffers filled in rpmsg callback.

uint32_t erpc::RPMsgTransport::m_dst_addr
protected

Destination address used by rpmsg.

struct rpmsg_lite_endpoint* erpc::RPMsgTransport::m_rpmsg_ept
protected

Pointer to RPMsg Lite Endpoint structure.


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