Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and wgtdkp committed May 12, 2021
1 parent e63dd00 commit a0216da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/lib/mdns/platform/Mdns.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
namespace chip {
namespace Mdns {

static constexpr uint8_t kMdnsNameMaxSize = 33; // [Node]-[Fabric] ID in hex - 16+1+16
static constexpr uint8_t kMdnsProtocolTextMaxSize = 4; // "_tcp" or "_udp"
static constexpr uint8_t kMdnsTypeMaxSize = 6; // "_chip", "_chipc" or "_chipd"
static constexpr uint8_t kMdnsNameMaxSize = 33; // [Node]-[Fabric] ID in hex - 16+1+16
static constexpr uint8_t kMdnsProtocolTextMaxSize = 4; // "_tcp" or "_udp"
static constexpr uint8_t kMdnsTypeMaxSize = 6; // "_chip", "_chipc" or "_chipd"
static constexpr uint8_t kMdnsTypeAndProtocolMaxSize = kMdnsTypeMaxSize + kMdnsProtocolTextMaxSize + 1; // <type>.<protocol>
static constexpr uint8_t kMdnsTextKeyMaxSize = 9;
static constexpr uint16_t kMdnsTextMaxSize = 64;
static constexpr uint16_t kMdnsTextMaxSize = 64;

enum class MdnsServiceProtocol : uint8_t
{
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/MdnsImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ CHIP_ERROR MakeAvahiStringListFromTextEntries(TextEntry * entries, size_t size,

for (size_t i = 0; i < size; i++)
{
uint8_t buf[kMdnsTextKeyMaxSize + 1 + 1];
uint8_t buf[chip::Mdns::kMdnsTextMaxSize];
size_t offset = static_cast<size_t>(snprintf(reinterpret_cast<char *>(buf), sizeof(buf), "%s=", entries[i].mKey));

if (offset + entries[i].mDataSize > sizeof(buf))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class GenericThreadStackManagerImpl_OpenThread
{
static constexpr uint8_t kMaxServicesNumber = CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES;
static constexpr uint8_t kMaxInstanceNameSize = chip::Mdns::kMdnsNameMaxSize;
static constexpr uint8_t kMaxNameSize = chip::Mdns::kMdnsTypeAndProtocolMaxSize + 1;
static constexpr uint8_t kMaxNameSize = chip::Mdns::kMdnsTypeAndProtocolMaxSize;
static constexpr uint8_t kMaxHostNameSize = 16;
// Thread only supports operational discovery
static constexpr uint8_t kMaxTxtEntriesNumber = chip::Mdns::OperationalAdvertisingParameters::kNumAdvertisingTxtEntries;
Expand Down

0 comments on commit a0216da

Please sign in to comment.