Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Oct 3, 2023
1 parent bcb60db commit 96c336b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/messaging/ExchangeContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload
// If we received a message from the Peer and we are still expecting a response, we know the peer is active
// If we receive a message from the Peer but if we are not expecting a response, we don't know if the peer is still active
mIsPeerActive = IsResponseExpected();
if(mIsPeerActive)
{
ChipLogError(ExchangeManager, "!!!!!!!!!!!!!!!!!!!!!!!!!!! Peer is active !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
else
{
ChipLogError(ExchangeManager, "!!!!!!!!!!!!!!!!!!!!!!!!!!! We don't know if the peer is active. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}

bool isStandaloneAck = payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::StandaloneAck);
bool isDuplicate = msgFlags.Has(MessageFlagValues::kDuplicateMessage);
Expand Down Expand Up @@ -633,6 +641,7 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload
SetResponseExpected(false);

// If we received the expected response, we don't if the peer is still active after having sent the response
ChipLogError(ExchangeManager, "!!!!!!!!!!!!!!!!!!!!!!!!!!! We don't know if the peer is active. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
mIsPeerActive = false;
}

Expand Down
15 changes: 14 additions & 1 deletion src/messaging/ExchangeContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,16 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext,
{
mFlags.Set(Flags::kFlagWillSendMessage);
mIsPeerActive = isPeerActive;

if(mIsPeerActive)
{
ChipLogError(ExchangeManager, "!!!!!!!!!!!!!!!!!!!!!!!!!!! Peer is active !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
else
{
ChipLogError(ExchangeManager, "!!!!!!!!!!!!!!!!!!!!!!!!!!! We don't know if the peer is active. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
}

/**
* Handle a received CHIP message on this exchange.
Expand Down Expand Up @@ -232,7 +241,11 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext,
*/
bool IsPeerActive();

void SetPeerActive() { mIsPeerActive = true; }
void SetPeerActive()
{
ChipLogError(ExchangeManager, "!!!!!!!!!!!!!!!!!!!!!!!!!!! Peer is active !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
mIsPeerActive = true;
}

#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
SessionHolder & GetSessionHolder() { return mSession; }
Expand Down

0 comments on commit 96c336b

Please sign in to comment.