Skip to content

Commit

Permalink
[chip-tool] Restart address update on failure
Browse files Browse the repository at this point in the history
For some devices, it may take more time to appear on the
network and become discoverable over DNS-SD, so don't give
up on the address resolution failure and restart the
address update.
  • Loading branch information
Damian-Nordic committed Nov 15, 2021
1 parent 5623978 commit cd268ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ CHIP_ERROR PairingCommand::UpdateNetworkAddress()
void PairingCommand::OnAddressUpdateComplete(NodeId nodeId, CHIP_ERROR err)
{
ChipLogProgress(chipTool, "OnAddressUpdateComplete: %" PRIx64 ": %s", nodeId, ErrorStr(err));
if (err != CHIP_NO_ERROR && nodeId == mNodeId)
if (err != CHIP_NO_ERROR)
{
// Set exit status only if the address update failed.
// Otherwise wait for OnCommissioningComplete() callback.
SetCommandExitStatus(err);
// For some devices, it may take more time to appear on the network and become discoverable
// over DNS-SD, so don't give up on failure and restart the address update.
UpdateNetworkAddress();
}
}

Expand Down

0 comments on commit cd268ff

Please sign in to comment.