From 28a75439bb0932155b903274b7e3a7b08ffb5582 Mon Sep 17 00:00:00 2001 From: cecille Date: Wed, 3 Jul 2024 10:42:21 -0400 Subject: [PATCH] Fix error on write request with incorrect timed request flag Please see https://github.com/project-chip/connectedhomeip/pull/33952#discussion_r1643204412 This was changed in the spec, but not in the SDK or unit tests. The unit test here covers this, but we should consider adding it to the cert testing as well. Please see https://github.com/CHIP-Specifications/chip-test-plans/issues/4256 --- src/app/WriteHandler.cpp | 4 ++-- src/app/tests/TestWriteInteraction.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index aadb59ae864176..d19d3ae3b37d0a 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -587,8 +587,8 @@ Status WriteHandler::ProcessWriteRequest(System::PacketBufferHandle && aPayload, if (mIsTimedRequest != aIsTimedWrite) { // 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. - status = Status::UnsupportedAccess; + // not, or vice versa. + status = Status::TimedRequestMismatch; goto exit; } diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 3f03b976e2937f..65f7c415a65550 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -328,7 +328,7 @@ TEST_F(TestWriteInteraction, TestWriteHandler) } else { - EXPECT_EQ(status, Status::UnsupportedAccess); + EXPECT_EQ(status, Status::TimedRequestMismatch); } mpTestContext->DrainAndServiceIO();