diff --git a/src/app/server/Dnssd.cpp b/src/app/server/Dnssd.cpp index 41ae02ccae3473..0bfab04af1e761 100644 --- a/src/app/server/Dnssd.cpp +++ b/src/app/server/Dnssd.cpp @@ -44,6 +44,10 @@ namespace chip { namespace app { namespace { +static_assert(ConfigurationManager::kMaxDeviceNameLen == Dnssd::kKeyDeviceNameMaxLength, + "Max device name length constants are not matching: ConfigurationManager::kMaxDeviceNameLen and " + "Dnssd::kKeyDeviceNameMaxLength"); + void OnPlatformEvent(const DeviceLayer::ChipDeviceEvent * event) { switch (event->Type) diff --git a/src/lib/dnssd/TxtFields.h b/src/lib/dnssd/TxtFields.h index e308457f49c378..fdd616d1d2b1dc 100644 --- a/src/lib/dnssd/TxtFields.h +++ b/src/lib/dnssd/TxtFields.h @@ -47,10 +47,6 @@ static constexpr size_t kKeyRotatingDeviceIdMaxLength = 100; static constexpr size_t kKeyPairingInstructionMaxLength = 128; static constexpr size_t kKeyPairingHintMaxLength = 10; -static_assert(kMaxDeviceNameLen == kKeyDeviceNameMaxLength, - "Max device name length constants are not matching: ConfigurationManager::kMaxDeviceNameLen and " - "Dnssd::kKeyDeviceNameMaxLength"); - enum class TxtKeyUse : uint8_t { kNone, diff --git a/src/platform/android/DeviceInstanceInfoProviderImpl.cpp b/src/platform/android/DeviceInstanceInfoProviderImpl.cpp index 492bde80c40067..cb0d6c6482df48 100644 --- a/src/platform/android/DeviceInstanceInfoProviderImpl.cpp +++ b/src/platform/android/DeviceInstanceInfoProviderImpl.cpp @@ -87,12 +87,13 @@ CHIP_ERROR DeviceInstanceInfoProviderImpl::GetDeviceName(MutableCharSpan & devic ReturnErrorCodeIf(deviceNameSpan.size() < deviceNameSize, CHIP_ERROR_BUFFER_TOO_SMALL); memcpy(deviceNameSpan.data(), androidDeviceName, deviceNameSize); deviceNameSpan.reduce_size(deviceNameSize); + return CHIP_NO_ERROR; } - else if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) + if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) { return CopyCharSpanToMutableCharSpan(CharSpan::fromCharString(CHIP_DEVICE_CONFIG_DEVICE_NAME), deviceNameSpan); } - return CHIP_NO_ERROR; + return err; } CHIP_ERROR DeviceInstanceInfoProviderImpl::GetProductName(char * buf, size_t bufSize)