From 95f5ffb0f205ae9e5afb0d93ba7b5c79c7b6210f Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Thu, 27 Jul 2023 17:30:46 +0200 Subject: [PATCH 1/2] [dnssd] remove constants for _A subtype and AP TXT field The _A subtype and AP TXT field were removed from the spec long time ago but the constants describing the maximum lengths are still present in the SDK. --- src/lib/dnssd/Constants.h | 6 ++---- src/lib/dnssd/TxtFields.h | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/lib/dnssd/Constants.h b/src/lib/dnssd/Constants.h index 992ab9cba4bb63..2c570892376d05 100644 --- a/src/lib/dnssd/Constants.h +++ b/src/lib/dnssd/Constants.h @@ -39,8 +39,7 @@ constexpr size_t kSubTypeShortDiscriminatorMaxLength = 4; // _S
constexpr size_t kSubTypeLongDiscriminatorMaxLength = 6; // _L constexpr size_t kSubTypeVendorIdMaxLength = 7; // _V constexpr size_t kSubTypeDeviceTypeMaxLength = 12; // _T -constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _C -constexpr size_t kSubTypeAdditionalCommissioningMaxLength = 3; // _A +constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _CM constexpr size_t kSubTypeCompressedFabricIdMaxLength = 18; // _I<16-hex-digits> /* @@ -68,8 +67,7 @@ namespace Commission { #define SUBTYPES \ (std::initializer_list{ kSubTypeShortDiscriminatorMaxLength, kSubTypeLongDiscriminatorMaxLength, \ - kSubTypeVendorIdMaxLength, kSubTypeDeviceTypeMaxLength, kSubTypeCommissioningModeMaxLength, \ - kSubTypeAdditionalCommissioningMaxLength }) + kSubTypeVendorIdMaxLength, kSubTypeDeviceTypeMaxLength, kSubTypeCommissioningModeMaxLength }) constexpr size_t kInstanceNameMaxLength = 16; // 64-bit random number in hex constexpr size_t kSubTypeMaxNumber = SUBTYPES.size(); diff --git a/src/lib/dnssd/TxtFields.h b/src/lib/dnssd/TxtFields.h index b39f8617d8ddd1..e30805b733e618 100644 --- a/src/lib/dnssd/TxtFields.h +++ b/src/lib/dnssd/TxtFields.h @@ -40,7 +40,6 @@ static constexpr size_t kKeyTcpSupportedMaxLength = 1; // Commissionable/commissioner node TXT entries static constexpr size_t kKeyLongDiscriminatorMaxLength = 5; static constexpr size_t kKeyVendorProductMaxLength = 11; -static constexpr size_t kKeyAdditionalCommissioningMaxLength = 1; static constexpr size_t kKeyCommissioningModeMaxLength = 1; static constexpr size_t kKeyDeviceTypeMaxLength = 10; static constexpr size_t kKeyDeviceNameMaxLength = 32; @@ -60,7 +59,6 @@ enum class TxtFieldKey : uint8_t kUnknown, kLongDiscriminator, kVendorProduct, - kAdditionalPairing, kCommissioningMode, kDeviceType, kDeviceName, @@ -87,7 +85,6 @@ constexpr const TxtFieldInfo txtFieldInfo[static_cast(TxtFieldKey::kCoun { TxtFieldKey::kUnknown, 0, "", TxtKeyUse::kNone }, { TxtFieldKey::kLongDiscriminator, kKeyLongDiscriminatorMaxLength, "D", TxtKeyUse::kCommission }, { TxtFieldKey::kVendorProduct, kKeyVendorProductMaxLength, "VP", TxtKeyUse::kCommission }, - { TxtFieldKey::kAdditionalPairing, kKeyAdditionalCommissioningMaxLength, "AP", TxtKeyUse::kCommission }, { TxtFieldKey::kCommissioningMode, kKeyCommissioningModeMaxLength, "CM", TxtKeyUse::kCommission }, { TxtFieldKey::kDeviceType, kKeyDeviceTypeMaxLength, "DT", TxtKeyUse::kCommission }, { TxtFieldKey::kDeviceName, kKeyDeviceNameMaxLength, "DN", TxtKeyUse::kCommission }, From f2ff02570df9af1c87611dbffcdbb35cdc169844 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 27 Jul 2023 15:35:07 +0000 Subject: [PATCH 2/2] Restyled by clang-format --- src/lib/dnssd/Constants.h | 12 ++++++------ src/lib/dnssd/TxtFields.h | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib/dnssd/Constants.h b/src/lib/dnssd/Constants.h index 2c570892376d05..d1805058b1e8ba 100644 --- a/src/lib/dnssd/Constants.h +++ b/src/lib/dnssd/Constants.h @@ -35,12 +35,12 @@ constexpr size_t kHostNameMaxLength = 16; // MAC or 802.15.4 Extended Address in * Matter DNS service subtypes */ -constexpr size_t kSubTypeShortDiscriminatorMaxLength = 4; // _S
-constexpr size_t kSubTypeLongDiscriminatorMaxLength = 6; // _L -constexpr size_t kSubTypeVendorIdMaxLength = 7; // _V -constexpr size_t kSubTypeDeviceTypeMaxLength = 12; // _T -constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _CM -constexpr size_t kSubTypeCompressedFabricIdMaxLength = 18; // _I<16-hex-digits> +constexpr size_t kSubTypeShortDiscriminatorMaxLength = 4; // _S
+constexpr size_t kSubTypeLongDiscriminatorMaxLength = 6; // _L +constexpr size_t kSubTypeVendorIdMaxLength = 7; // _V +constexpr size_t kSubTypeDeviceTypeMaxLength = 12; // _T +constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _CM +constexpr size_t kSubTypeCompressedFabricIdMaxLength = 18; // _I<16-hex-digits> /* * Matter operational node service settings diff --git a/src/lib/dnssd/TxtFields.h b/src/lib/dnssd/TxtFields.h index e30805b733e618..fdd616d1d2b1dc 100644 --- a/src/lib/dnssd/TxtFields.h +++ b/src/lib/dnssd/TxtFields.h @@ -38,14 +38,14 @@ static constexpr System::Clock::Milliseconds32 kMaxRetryInterval = 3600000_ms32; static constexpr size_t kKeyTcpSupportedMaxLength = 1; // Commissionable/commissioner node TXT entries -static constexpr size_t kKeyLongDiscriminatorMaxLength = 5; -static constexpr size_t kKeyVendorProductMaxLength = 11; -static constexpr size_t kKeyCommissioningModeMaxLength = 1; -static constexpr size_t kKeyDeviceTypeMaxLength = 10; -static constexpr size_t kKeyDeviceNameMaxLength = 32; -static constexpr size_t kKeyRotatingDeviceIdMaxLength = 100; -static constexpr size_t kKeyPairingInstructionMaxLength = 128; -static constexpr size_t kKeyPairingHintMaxLength = 10; +static constexpr size_t kKeyLongDiscriminatorMaxLength = 5; +static constexpr size_t kKeyVendorProductMaxLength = 11; +static constexpr size_t kKeyCommissioningModeMaxLength = 1; +static constexpr size_t kKeyDeviceTypeMaxLength = 10; +static constexpr size_t kKeyDeviceNameMaxLength = 32; +static constexpr size_t kKeyRotatingDeviceIdMaxLength = 100; +static constexpr size_t kKeyPairingInstructionMaxLength = 128; +static constexpr size_t kKeyPairingHintMaxLength = 10; enum class TxtKeyUse : uint8_t {