Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions erpc_c/infra/erpc_arbitrated_client_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ void ArbitratedClientManager::performClientRequest(RequestContext &request)
if (request.getCodec()->isStatusOk() == true)
{
// Complete the receive through the arbitrator.
err = m_arbitrator->clientReceive(token);
request.getCodec()->updateStatus(err);
m_arbitrator->clientReceive(token);
}

if (token != 0)
Expand Down
8 changes: 4 additions & 4 deletions erpc_c/infra/erpc_transport_arbitrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ erpc_status_t TransportArbitrator::receive(MessageBuffer *message)
if (err != kErpcStatus_Success)
{
// if we timeout, we must unblock all pending client(s)
if (err == kErpcStatus_Timeout)
if (err == kErpcStatus_Timeout || err == kErpcStatus_ReceiveFailed)
{
client = m_clientList;
for (; client; client = client->m_next)
{
if (client->m_isValid)
{
client->m_request->getCodec()->updateStatus(err);
client->m_sem.put();
}
}
Expand Down Expand Up @@ -107,6 +108,7 @@ erpc_status_t TransportArbitrator::receive(MessageBuffer *message)
{
// Swap the received message buffer with the client's message buffer.
client->m_request->getCodec()->getBufferRef().swap(message);
client->m_request->getCodec()->updateStatus(kErpcStatus_Success);

// Wake up the client receive thread.
client->m_sem.put();
Expand Down Expand Up @@ -183,7 +185,7 @@ TransportArbitrator::client_token_t TransportArbitrator::prepareClientReceive(Re
return reinterpret_cast<client_token_t>(info);
}

erpc_status_t TransportArbitrator::clientReceive(client_token_t token)
void TransportArbitrator::clientReceive(client_token_t token)
{
erpc_assert((token != 0) && ("invalid client token" != NULL));

Expand All @@ -192,8 +194,6 @@ erpc_status_t TransportArbitrator::clientReceive(client_token_t token)

// Wait on the semaphore until we're signaled.
info->m_sem.get(Semaphore::kWaitForever);

return kErpcStatus_Success;
}

TransportArbitrator::PendingClientInfo *TransportArbitrator::createPendingClient(void){ ERPC_CREATE_NEW_OBJECT(
Expand Down
4 changes: 1 addition & 3 deletions erpc_c/infra/erpc_transport_arbitrator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,8 @@ class TransportArbitrator : public Transport
* associated with @a token. The client must have called prepareClientReceive() previously.
*
* @param[in] token The token previously returned by prepareClientReceive().
*
* @return erpc_status_t Return erpc status of client receive function.
*/
erpc_status_t clientReceive(client_token_t token);
void clientReceive(client_token_t token);

/*!
* @brief This function free client token.
Expand Down