Skip to content

Commit

Permalink
fix few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hnnajh committed Dec 1, 2023
1 parent 79d5733 commit 06a1879
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/chip-tool/commands/discover/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class Resolve : public DiscoverCommand, public chip::AddressResolve::NodeListene
result.mrpRemoteConfig.mIdleRetransTimeout.count());
ChipLogProgress(chipTool, " MRP retry interval (active): %" PRIu32 "ms",
result.mrpRemoteConfig.mActiveRetransTimeout.count());
ChipLogProgress(chipTool, " Supports Client TCP: %s", result.supportsTcpClient ? "yes" : "no");
ChipLogProgress(chipTool, " Supports Server TCP: %s", result.supportsTcpServer ? "yes" : "no");
ChipLogProgress(chipTool, " Supports TCP Client: %s", result.supportsTcpClient ? "yes" : "no");
ChipLogProgress(chipTool, " Supports TCP Server: %s", result.supportsTcpServer ? "yes" : "no");
ChipLogProgress(chipTool, " ICD is operating as: %s", result.isICDOperatingAsLIT ? "LIT" : "SIT");
SetCommandExitStatus(CHIP_NO_ERROR);
}
Expand Down
7 changes: 5 additions & 2 deletions src/lib/dnssd/TxtFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ namespace Dnssd {

namespace Internal {

constexpr uint8_t kTCPClient = 1;
constexpr uint8_t kTCPServer = 2;

namespace {

char SafeToLower(uint8_t ch)
Expand Down Expand Up @@ -265,8 +268,8 @@ void FillNodeDataFromTxt(const ByteSpan & key, const ByteSpan & value, CommonRes
break;
case TxtFieldKey::kTcpSupported: {
uint8_t support = Internal::MakeU8FromAsciiDecimal(value);
nodeData.supportsTcpClient = (support >> 1 & 0x01) == 0x01;
nodeData.supportsTcpServer = (support >> 2 & 0x01) == 0x01;
nodeData.supportsTcpClient = (support & (1 << Internal::kTCPClient)) != 0;
nodeData.supportsTcpServer = (support & (1 << Internal::kTCPServer)) != 0;
break;
}
case TxtFieldKey::kLongIdleTimeICD:
Expand Down

0 comments on commit 06a1879

Please sign in to comment.