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

Log errors if AdvertiseOperational fails #33773

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/platform/linux/CommissionerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ CHIP_ERROR InitCommissioner(uint16_t commissionerPort, uint16_t udcListenPort, F
gCommissionerDiscoveryController.SetCommissionerCallback(&gCommissionerCallback);

// advertise operational since we are an admin
app::DnssdServer::Instance().AdvertiseOperational();
ReturnLogErrorOnFailure(app::DnssdServer::Instance().AdvertiseOperational());

ChipLogProgress(Support,
"InitCommissioner nodeId=0x" ChipLogFormatX64 " fabric.fabricId=0x" ChipLogFormatX64 " fabricIndex=0x%x",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,11 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co
needRevert = false;

// We might have a new operational identity, so we should start advertising it right away.
app::DnssdServer::Instance().AdvertiseOperational();
err = app::DnssdServer::Instance().AdvertiseOperational();
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "Operational advertising failed: %" CHIP_ERROR_FORMAT, err.Format());
}

// Notify the attributes containing fabric metadata can be read with new data
MatterReportingAttributeChangeCallback(commandPath.mEndpointId, OperationalCredentials::Id,
Expand Down
11 changes: 9 additions & 2 deletions src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,15 @@ void CommissioningWindowManager::OnPlatformEvent(const DeviceLayer::ChipDeviceEv
}
else if (event->Type == DeviceLayer::DeviceEventType::kOperationalNetworkEnabled)
{
app::DnssdServer::Instance().AdvertiseOperational();
ChipLogProgress(AppServer, "Operational advertising enabled");
CHIP_ERROR err = app::DnssdServer::Instance().AdvertiseOperational();
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "Operational advertising failed: %" CHIP_ERROR_FORMAT, err.Format());
}
else
{
ChipLogProgress(AppServer, "Operational advertising enabled");
}
}
#if CONFIG_NETWORK_LAYER_BLE
else if (event->Type == DeviceLayer::DeviceEventType::kCloseAllBleConnections)
Expand Down
Loading