Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and shubhamdp committed Aug 2, 2023
1 parent 06071cd commit 25a0f3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/protocols/secure_channel/CASEServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ CHIP_ERROR CASEServer::SendBusyStatusReport(Messaging::ExchangeContext * ec, uin
VerifyOrReturnError(ec != nullptr, CHIP_ERROR_INCORRECT_STATE, ChipLogError(Inet, "Exchange context cannot be NULL"));

System::PacketBufferHandle handle = Protocols::SecureChannel::StatusReport::MakeBusyStatusReportMessage(minimumWaitTime);
VerifyOrReturnError(!handle.IsNull(), CHIP_ERROR_NO_MEMORY, ChipLogError(SecureChannel, "Failed to build a busy status report"));
VerifyOrReturnError(!handle.IsNull(), CHIP_ERROR_NO_MEMORY,
ChipLogError(SecureChannel, "Failed to build a busy status report"));

ChipLogProgress(Inet, "Sending status report, exchange " ChipLogFormatExchange, ChipLogValueExchange(ec));
return ec->SendMessage(Protocols::SecureChannel::MsgType::StatusReport, std::move(handle));
Expand Down
6 changes: 4 additions & 2 deletions src/protocols/secure_channel/StatusReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ System::PacketBufferHandle StatusReport::MakeBusyStatusReportMessage(uint16_t mi
constexpr uint8_t kBusyStatusReportProtocolDataSize = sizeof(minimumWaitTime); // 16-bits

auto handle = System::PacketBufferHandle::New(kBusyStatusReportProtocolDataSize, 0);
VerifyOrReturnValue(!handle.IsNull(), handle, ChipLogError(SecureChannel, "Failed to allocate protocol data for busy status report"));
VerifyOrReturnValue(!handle.IsNull(), handle,
ChipLogError(SecureChannel, "Failed to allocate protocol data for busy status report"));

// Build the protocol data with minimum wait time
Encoding::LittleEndian::PacketBufferWriter protocolDataBufferWriter(std::move(handle));
protocolDataBufferWriter.Put16(minimumWaitTime);
handle = protocolDataBufferWriter.Finalize();
VerifyOrReturnValue(!handle.IsNull(), handle, ChipLogError(SecureChannel, "Failed to finalize protocol data for busy status report"));
VerifyOrReturnValue(!handle.IsNull(), handle,
ChipLogError(SecureChannel, "Failed to finalize protocol data for busy status report"));

// Build a busy status report
StatusReport statusReport(GeneralStatusCode::kBusy, Id, kProtocolCodeBusy, std::move(handle));
Expand Down

0 comments on commit 25a0f3e

Please sign in to comment.