Skip to content

Commit

Permalink
ICDHandler initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
thivya-amazon committed Nov 30, 2023
1 parent a0d4ac0 commit a08e6f6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/app/icd/ICDHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,12 @@ CHIP_ERROR CheckInMessageHandler::OnMessageReceived(Messaging::ExchangeContext *
System::PacketBufferHandle && payload)
{
// TODO : Pass the parsed payload to ICDClientManagement via callback
VerifyOrReturn(payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::ICD_CheckIn));
VerifyOrReturnError(payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::ICD_CheckIn), CHIP_ERROR_INVALID_ARGUMENT);

Crypto::Aes128KeyHandle key;
chip::Protocols::SecureChannel::CounterType counter;
MutableByteSpan appData;
ByteSpan payloadByteSpan{ payload->Start(), payload->DataLength() };
memcpy(&checkInPayload, payload->Start(), sizeof(checkInPayload));
chip::ByteSpan payloadByteSpan(checkInPayload);
chip::Protocols::SecureChannel::CheckinMessage::ParseCheckinMessagePayload(key, payloadByteSpan, counter, appData);

return CHIP_NO_ERROR;
Expand Down

0 comments on commit a08e6f6

Please sign in to comment.