Skip to content

Commit

Permalink
Addressing comments from bzbarsky-apple.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheunj3 authored and woody-apple committed Oct 19, 2023
1 parent 0455c92 commit bc98e70
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/app/server/Dnssd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions src/lib/dnssd/TxtFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions src/platform/android/DeviceInstanceInfoProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bc98e70

Please sign in to comment.