diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index 78aaed63c0ca98..acbc59f5e431e7 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -105,8 +105,8 @@ CHIP_ERROR CommandHandler::ProcessInvokeRequest(System::PacketBufferHandle && pa { // The message thinks it should be part of a timed interaction but it's // not, or vice versa. Spec says to Respond with UNSUPPORTED_ACCESS. - err = StatusResponse::SendStatusResponse(Protocols::InteractionModel::Status::UnsupportedAccess, mpExchangeCtx, - /* aExpectResponse = */ false); + err = StatusResponse::Send(Protocols::InteractionModel::Status::UnsupportedAccess, mpExchangeCtx, + /* aExpectResponse = */ false); // Some unit tests call this function in an abnormal state when we don't // even have an exchange. diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index f9655ea0ee104e..a3f2c9f6a3f586 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -462,7 +462,7 @@ CHIP_ERROR InteractionModelEngine::OnMessageReceived(Messaging::ExchangeContext exit: if (status != Protocols::InteractionModel::Status::Success && !apExchangeContext->IsGroupExchangeContext()) { - err = StatusResponse::SendStatusResponse(status, apExchangeContext, false /*aExpectResponse*/); + err = StatusResponse::Send(status, apExchangeContext, false /*aExpectResponse*/); } return err; } @@ -718,7 +718,7 @@ void InteractionModelEngine::OnTimedInvoke(TimedHandler * apTimedHandler, Messag OnInvokeCommandRequest(apExchangeContext, aPayloadHeader, std::move(aPayload), /* aIsTimedInvoke = */ true, status); if (status != Status::Success) { - StatusResponse::SendStatusResponse(status, apExchangeContext, /* aExpectResponse = */ false); + StatusResponse::Send(status, apExchangeContext, /* aExpectResponse = */ false); } } diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index fdc783b058d2a2..399d856d220d8e 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -410,9 +410,9 @@ CHIP_ERROR ReadClient::ProcessReportData(System::PacketBufferHandle && aPayload) if (!suppressResponse) { bool noResponseExpected = IsSubscriptionIdle() && !mPendingMoreChunks; - err = StatusResponse::SendStatusResponse(err == CHIP_NO_ERROR ? Protocols::InteractionModel::Status::Success - : Protocols::InteractionModel::Status::InvalidSubscription, - mpExchangeCtx, !noResponseExpected); + err = StatusResponse::Send(err == CHIP_NO_ERROR ? Protocols::InteractionModel::Status::Success + : Protocols::InteractionModel::Status::InvalidSubscription, + mpExchangeCtx, !noResponseExpected); if (noResponseExpected || (err != CHIP_NO_ERROR)) { diff --git a/src/app/StatusResponse.cpp b/src/app/StatusResponse.cpp index dbc5afc6ec2f2a..f6f5335b50de79 100644 --- a/src/app/StatusResponse.cpp +++ b/src/app/StatusResponse.cpp @@ -21,8 +21,8 @@ namespace chip { namespace app { -CHIP_ERROR StatusResponse::SendStatusResponse(Protocols::InteractionModel::Status aStatus, - Messaging::ExchangeContext * apExchangeContext, bool aExpectResponse) +CHIP_ERROR StatusResponse::Send(Protocols::InteractionModel::Status aStatus, Messaging::ExchangeContext * apExchangeContext, + bool aExpectResponse) { VerifyOrReturnError(apExchangeContext != nullptr, CHIP_ERROR_INCORRECT_STATE); System::PacketBufferHandle msgBuf = System::PacketBufferHandle::New(kMaxSecureSduLengthBytes); diff --git a/src/app/StatusResponse.h b/src/app/StatusResponse.h index 03114def8f1da6..eb772a06771116 100644 --- a/src/app/StatusResponse.h +++ b/src/app/StatusResponse.h @@ -30,8 +30,8 @@ static constexpr size_t kMaxSecureSduLengthBytes = 1024; class StatusResponse { public: - static CHIP_ERROR SendStatusResponse(Protocols::InteractionModel::Status aStatus, - Messaging::ExchangeContext * apExchangeContext, bool aExpectResponse); + static CHIP_ERROR Send(Protocols::InteractionModel::Status aStatus, Messaging::ExchangeContext * apExchangeContext, + bool aExpectResponse); static CHIP_ERROR ProcessStatusResponse(System::PacketBufferHandle && aPayload, StatusIB & aStatus); }; } // namespace app diff --git a/src/app/TimedHandler.cpp b/src/app/TimedHandler.cpp index d1349f7dd2a4e8..c29ec0499bdaf6 100644 --- a/src/app/TimedHandler.cpp +++ b/src/app/TimedHandler.cpp @@ -53,7 +53,7 @@ CHIP_ERROR TimedHandler::OnMessageReceived(Messaging::ExchangeContext * aExchang { ChipLogError(DataManagement, "Failed to parse Timed Request action: handler %p exchange " ChipLogFormatExchange, this, ChipLogValueExchange(aExchangeContext)); - StatusResponse::SendStatusResponse(Status::InvalidAction, aExchangeContext, /* aExpectResponse = */ false); + StatusResponse::Send(Status::InvalidAction, aExchangeContext, /* aExpectResponse = */ false); } return err; } @@ -65,7 +65,7 @@ CHIP_ERROR TimedHandler::OnMessageReceived(Messaging::ExchangeContext * aExchang // Time is up. Spec says to send UNSUPPORTED_ACCESS. ChipLogError(DataManagement, "Timeout expired: handler %p exchange " ChipLogFormatExchange, this, ChipLogValueExchange(aExchangeContext)); - return StatusResponse::SendStatusResponse(Status::UnsupportedAccess, aExchangeContext, /* aExpectResponse = */ false); + return StatusResponse::Send(Status::UnsupportedAccess, aExchangeContext, /* aExpectResponse = */ false); } if (aPayloadHeader.HasMessageType(MsgType::InvokeCommandRequest)) @@ -86,7 +86,7 @@ CHIP_ERROR TimedHandler::OnMessageReceived(Messaging::ExchangeContext * aExchang ChipLogError(DataManagement, "Unexpected unknown message in tiemd interaction: handler %p exchange " ChipLogFormatExchange, this, ChipLogValueExchange(aExchangeContext)); - return StatusResponse::SendStatusResponse(Status::InvalidAction, aExchangeContext, /* aExpectResponse = */ false); + return StatusResponse::Send(Status::InvalidAction, aExchangeContext, /* aExpectResponse = */ false); } void TimedHandler::OnExchangeClosing(Messaging::ExchangeContext *) @@ -120,7 +120,7 @@ CHIP_ERROR TimedHandler::HandleTimedRequestAction(Messaging::ExchangeContext * a // stuck waiting forever if the client never sends another message. auto delay = System::Clock::Milliseconds32(timeoutMs); aExchangeContext->SetResponseTimeout(delay); - ReturnErrorOnFailure(StatusResponse::SendStatusResponse(Status::Success, aExchangeContext, /* aExpectResponse = */ true)); + ReturnErrorOnFailure(StatusResponse::Send(Status::Success, aExchangeContext, /* aExpectResponse = */ true)); // Now just wait for the client. mState = State::kExpectingFollowingAction;