diff --git a/erpc_c/infra/erpc_arbitrated_client_manager.cpp b/erpc_c/infra/erpc_arbitrated_client_manager.cpp index 9ad1072c..953a2acd 100644 --- a/erpc_c/infra/erpc_arbitrated_client_manager.cpp +++ b/erpc_c/infra/erpc_arbitrated_client_manager.cpp @@ -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) diff --git a/erpc_c/infra/erpc_transport_arbitrator.cpp b/erpc_c/infra/erpc_transport_arbitrator.cpp index 45368c8d..255dd0b8 100644 --- a/erpc_c/infra/erpc_transport_arbitrator.cpp +++ b/erpc_c/infra/erpc_transport_arbitrator.cpp @@ -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(); } } @@ -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(); @@ -183,7 +185,7 @@ TransportArbitrator::client_token_t TransportArbitrator::prepareClientReceive(Re return reinterpret_cast(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)); @@ -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( diff --git a/erpc_c/infra/erpc_transport_arbitrator.hpp b/erpc_c/infra/erpc_transport_arbitrator.hpp index 6a55efb0..222f7288 100644 --- a/erpc_c/infra/erpc_transport_arbitrator.hpp +++ b/erpc_c/infra/erpc_transport_arbitrator.hpp @@ -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.