Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Jul 21, 2022
1 parent 2988a60 commit 3684a3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/lib/dnssd/Discovery_ImplPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,15 @@ static void HandleNodeResolve(void * context, DnssdService * result, const Span<

nodeData.resolutionData.port = result->mPort;

ChipLogDetail(Discovery, "Node with instance name %s discovered. TXT:", nodeData.commissionData.instanceName);
for (size_t i = 0; i < result->mTextEntrySize; ++i)
{
ChipLogDetail(Discovery, " %s: %.*s", result->mTextEntries[i].mKey, static_cast<int>(result->mTextEntries[i].mDataSize),
result->mTextEntries[i].mData);
ByteSpan key(reinterpret_cast<const uint8_t *>(result->mTextEntries[i].mKey), strlen(result->mTextEntries[i].mKey));
ByteSpan val(result->mTextEntries[i].mData, result->mTextEntries[i].mDataSize);
FillNodeDataFromTxt(key, val, nodeData.resolutionData);
FillNodeDataFromTxt(key, val, nodeData.commissionData);
}

nodeData.LogDetail();
proxy->OnNodeDiscovered(nodeData);
proxy->Release();
}
Expand Down Expand Up @@ -137,11 +135,8 @@ static void HandleNodeIdResolve(void * context, DnssdService * result, const Spa
}
nodeData.resolutionData.numIPs = addressesFound;

ChipLogDetail(Discovery, "Node with operational ID %s resolved. TXT:", result->mName);
for (size_t i = 0; i < result->mTextEntrySize; ++i)
{
ChipLogDetail(Discovery, " %s: %.*s", result->mTextEntries[i].mKey, static_cast<int>(result->mTextEntries[i].mDataSize),
result->mTextEntries[i].mData);
ByteSpan key(reinterpret_cast<const uint8_t *>(result->mTextEntries[i].mKey), strlen(result->mTextEntries[i].mKey));
ByteSpan val(result->mTextEntries[i].mData, result->mTextEntries[i].mDataSize);
FillNodeDataFromTxt(key, val, nodeData.resolutionData);
Expand Down
2 changes: 2 additions & 0 deletions src/lib/dnssd/Resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ struct CommonResolutionData
{
ChipLogDetail(Discovery, "\tMrp Interval active: not present");
}
ChipLogDetail(Discovery, "\tTCP Supported: %d", supportsTcp);
}
};

Expand Down Expand Up @@ -243,6 +244,7 @@ struct DiscoveredNodeData

void LogDetail() const
{
ChipLogDetail(Discovery, "Discovered node:");
resolutionData.LogDetail();
commissionData.LogDetail();
}
Expand Down

0 comments on commit 3684a3f

Please sign in to comment.