Skip to content

Commit

Permalink
Make the code more obvious identical with what was there before
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin authored and andy31415 committed Aug 8, 2024
1 parent f6e2ec6 commit 8599460
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/app/WriteHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,27 +573,24 @@ Status WriteHandler::ProcessWriteRequest(System::PacketBufferHandle && aPayload,
#endif
bool boolValue;

err = writeRequestParser.GetSuppressResponse(&boolValue);
if (err == CHIP_NO_ERROR)
{
mStateFlags.Set(StateBits::kSuppressResponse, boolValue);
}
else if (err == CHIP_END_OF_TLV)
boolValue = mStateFlags.Has(StateBits::kSuppressResponse);
err = writeRequestParser.GetSuppressResponse(&boolValue);
mStateFlags.Set(StateBits::kSuppressResponse, boolValue);
if (err == CHIP_END_OF_TLV)
{
err = CHIP_NO_ERROR;
}
SuccessOrExit(err);

err = writeRequestParser.GetTimedRequest(&boolValue);
SuccessOrExit(err);
boolValue = mStateFlags.Has(StateBits::kIsTimedRequest);
err = writeRequestParser.GetTimedRequest(&boolValue);
mStateFlags.Set(StateBits::kIsTimedRequest, boolValue);
SuccessOrExit(err);

err = writeRequestParser.GetMoreChunkedMessages(&boolValue);
if (err == CHIP_NO_ERROR)
{
mStateFlags.Set(StateBits::kHasMoreChunks, boolValue);
}
else if (err == CHIP_ERROR_END_OF_TLV)
boolValue = mStateFlags.Has(StateBits::kHasMoreChunks);
err = writeRequestParser.GetMoreChunkedMessages(&boolValue);
mStateFlags.Set(StateBits::kHasMoreChunks, boolValue);
if (err == CHIP_ERROR_END_OF_TLV)
{
err = CHIP_NO_ERROR;
}
Expand Down

0 comments on commit 8599460

Please sign in to comment.