From 1700338fd06257dbc900da90c1e0174cf131ef06 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:59:43 -0400 Subject: [PATCH] [ICD]Post the MsgSentEvent on retransmits also (#27968) * Post the MsgSentEvent on retransmits also * Add a comment explaining why we set ExpectedResponse to false --- src/messaging/ReliableMessageMgr.cpp | 13 +++++++++++++ .../GenericThreadStackManagerImpl_OpenThread.hpp | 4 ---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index a556aaa18be778..b2aaacf633b9af 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -323,6 +323,19 @@ CHIP_ERROR ReliableMessageMgr::SendFromRetransTable(RetransTableEntry * entry) if (err == CHIP_NO_ERROR) { +#if CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER + DeviceLayer::ChipDeviceEvent event; + // Here always set ExpectResponse to false. + // The Initial message sent from the Exchange Context will have set ExpectResponse to the correct value. + // If we are expecting a Response, the ICD will already be in a state waiting for the response (or timeout). + event.Type = DeviceLayer::DeviceEventType::kChipMsgSentEvent; + event.MessageSent.ExpectResponse = false; + CHIP_ERROR status = DeviceLayer::PlatformMgr().PostEvent(&event); + if (status != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Failed to post retransmit message sent event %" CHIP_ERROR_FORMAT, status.Format()); + } +#endif // CONFIG_DEVICE_LAYER #if CHIP_CONFIG_RESOLVE_PEER_ON_FIRST_TRANSMIT_FAILURE const ExchangeManager * exchangeMgr = entry->ec->GetExchangeMgr(); // TODO: investigate why in ReliableMessageMgr::CheckResendApplicationMessageWithPeerExchange unit test released exchange diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index 05ad6d1a3b7550..3e4dfaf456c02e 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -2000,10 +2000,6 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetPollingInter ChipLogError(DeviceLayer, "Failed to set SED interval to %" PRId32 "ms. Defaulting to %" PRId32 "ms", pollingInterval.count(), curIntervalMS); } - else - { - ChipLogProgress(DeviceLayer, "OpenThread SED interval is %" PRId32 "ms", curIntervalMS); - } return err; }