Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OTA] Make requestor use endpoint from AnnounceOTAProvider command #13305

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/app/clusters/ota-requestor/OTARequestor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
Expand All @@ -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.
Expand Down