From 37231446c464272b3753c9dea9c3d58edcd0c6d0 Mon Sep 17 00:00:00 2001
From: Vivien Nicolas <vnicolas@apple.com>
Date: Wed, 1 Dec 2021 16:50:08 +0100
Subject: [PATCH] [chip-tool] Use DiscoveredNodeData::LogDetail in
 DiscoverCommissionablesCommand.cpp (#12402)

---
 .../DiscoverCommissionablesCommand.cpp        | 24 +------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/examples/chip-tool/commands/discover/DiscoverCommissionablesCommand.cpp b/examples/chip-tool/commands/discover/DiscoverCommissionablesCommand.cpp
index 88f41cc2b8125f..fd116833696027 100644
--- a/examples/chip-tool/commands/discover/DiscoverCommissionablesCommand.cpp
+++ b/examples/chip-tool/commands/discover/DiscoverCommissionablesCommand.cpp
@@ -30,27 +30,5 @@ CHIP_ERROR DiscoverCommissionablesCommand::RunCommand()
 
 void DiscoverCommissionablesCommand::OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & nodeData)
 {
-    char rotatingId[chip::Dnssd::kMaxRotatingIdLen * 2 + 1] = "";
-    Encoding::BytesToUppercaseHexString(nodeData.rotatingId, nodeData.rotatingIdLen, rotatingId, sizeof(rotatingId));
-
-    ChipLogProgress(Discovery, "Discovered Node: ");
-    ChipLogProgress(Discovery, "\tInstance name:\t\t%s", nodeData.instanceName);
-    ChipLogProgress(Discovery, "\tHost name:\t\t%s", nodeData.hostName);
-    ChipLogProgress(Discovery, "\tPort:\t\t\t%u", nodeData.port);
-    ChipLogProgress(Discovery, "\tLong discriminator:\t%u", nodeData.longDiscriminator);
-    ChipLogProgress(Discovery, "\tVendor ID:\t\t%u", nodeData.vendorId);
-    ChipLogProgress(Discovery, "\tProduct ID:\t\t%u", nodeData.productId);
-    ChipLogProgress(Discovery, "\tCommissioning Mode:\t%u", nodeData.commissioningMode);
-    ChipLogProgress(Discovery, "\tDevice Type:\t\t%u", nodeData.deviceType);
-    ChipLogProgress(Discovery, "\tDevice Name:\t\t%s", nodeData.deviceName);
-    ChipLogProgress(Discovery, "\tRotating Id:\t\t%s", rotatingId);
-    ChipLogProgress(Discovery, "\tPairing Instruction:\t%s", nodeData.pairingInstruction);
-    ChipLogProgress(Discovery, "\tPairing Hint:\t\t%u", nodeData.pairingHint);
-    for (int i = 0; i < nodeData.numIPs; i++)
-    {
-        char buf[chip::Inet::IPAddress::kMaxStringLength];
-        nodeData.ipAddress[i].ToString(buf);
-
-        ChipLogProgress(Discovery, "\tAddress %d:\t\t%s", i, buf);
-    }
+    nodeData.LogDetail();
 }