From 96c336b489bccf111cc38be994190700119da8cb Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Tue, 3 Oct 2023 14:30:23 -0400 Subject: [PATCH] logs --- src/messaging/ExchangeContext.cpp | 9 +++++++++ src/messaging/ExchangeContext.h | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index 1b7c9a1f32c30a..4d2a3a65d26f3b 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -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); @@ -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; } diff --git a/src/messaging/ExchangeContext.h b/src/messaging/ExchangeContext.h index 5a48bbe5c4b3dd..4e230582ae4528 100644 --- a/src/messaging/ExchangeContext.h +++ b/src/messaging/ExchangeContext.h @@ -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. @@ -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; }