Skip to content

Commit 6e61efd

Browse files
committed
transport arbitrator: override Transport::hasMessage
Override the default implementation of hasMessage from Transport with a version that calls through to the hasMessage of the shared transport that the transport arbitrator is using.
1 parent 99afd49 commit 6e61efd

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

erpc_c/infra/erpc_transport_arbitrator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ void TransportArbitrator::setCrc16(Crc16 *crcImpl)
4848
m_sharedTransport->setCrc16(crcImpl);
4949
}
5050

51+
bool TransportArbitrator::hasMessage(void)
52+
{
53+
return m_sharedTransport->hasMessage();
54+
}
55+
5156
erpc_status_t TransportArbitrator::receive(MessageBuffer *message)
5257
{
5358
assert(m_sharedTransport && "shared transport is not set");

erpc_c/infra/erpc_transport_arbitrator.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ class TransportArbitrator : public Transport
9797
*/
9898
virtual void setCrc16(Crc16 *crcImpl);
9999

100+
/*!
101+
* @brief Check if the underlying shared transport has a message
102+
*
103+
* @retval The underlying transport is expected to return true when a message is available to
104+
* process and false otherwise.
105+
*/
106+
virtual bool hasMessage(void);
107+
100108
protected:
101109
Transport *m_sharedTransport; //!< Transport being shared through this arbitrator.
102110
Codec *m_codec; //!< Codec used to read incoming message headers.

0 commit comments

Comments
 (0)