From d1d576a09b65fca52501ff477d374c7b443492ab Mon Sep 17 00:00:00 2001 From: Carol Yang Date: Mon, 3 Jan 2022 21:02:40 -0800 Subject: [PATCH] [OTA] Make requestor use endpoint from AnnounceOTAProvider command --- src/app/clusters/ota-requestor/OTARequestor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/clusters/ota-requestor/OTARequestor.cpp b/src/app/clusters/ota-requestor/OTARequestor.cpp index b4e3604035ed02..9e6fc4c92dde51 100644 --- a/src/app/clusters/ota-requestor/OTARequestor.cpp +++ b/src/app/clusters/ota-requestor/OTARequestor.cpp @@ -190,6 +190,7 @@ EmberAfStatus OTARequestor::HandleAnnounceOTAProvider(app::CommandHandler * comm { auto & providerNodeId = commandData.providerNodeId; auto & announcementReason = commandData.announcementReason; + auto & providerEndpoint = commandData.endpoint; if (commandObj == nullptr || commandObj->GetExchangeContext() == nullptr) { @@ -199,6 +200,7 @@ EmberAfStatus OTARequestor::HandleAnnounceOTAProvider(app::CommandHandler * comm mProviderNodeId = providerNodeId; mProviderFabricIndex = commandObj->GetExchangeContext()->GetSessionHandle().GetFabricIndex(); + mProviderEndpointId = providerEndpoint; ChipLogProgress(SoftwareUpdate, "OTA Requestor received AnnounceOTAProvider"); ChipLogDetail(SoftwareUpdate, " FabricIndex: %" PRIu8, mProviderFabricIndex); @@ -209,6 +211,7 @@ EmberAfStatus OTARequestor::HandleAnnounceOTAProvider(app::CommandHandler * comm { ChipLogDetail(SoftwareUpdate, " MetadataForNode: %zu", commandData.metadataForNode.Value().size()); } + ChipLogDetail(SoftwareUpdate, " Endpoint: %" PRIu16, commandData.endpoint); // If reason is URGENT_UPDATE_AVAILABLE, we start OTA immediately. Otherwise, respect the timer value set in mOtaStartDelayMs. // This is done to exemplify what a real-world OTA Requestor might do while also being configurable enough to use as a test app.