Skip to content

Commit

Permalink
Update default config values to use build constants
Browse files Browse the repository at this point in the history
Replaced hardcoded default values in ConfigurationManagerImpl with
constants defined in CHIPBuildConfig to ensure uniformity and ease of
future modifications.
  • Loading branch information
swan-amazon committed May 7, 2024
1 parent c01394d commit 1ec4b82
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/platform/Linux/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

#include <app-common/zap-generated/cluster-objects.h>
#include <core/CHIPBuildConfig.h>
#include <ifaddrs.h>
#include <lib/core/CHIPVendorIdentifiers.hpp>
#include <lib/support/CodeUtils.h>
Expand Down Expand Up @@ -120,29 +121,29 @@ CHIP_ERROR ConfigurationManagerImpl::Init()

if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_TCAcceptedVersion))
{
uint16_t tcAcceptedVersion = 0U;
uint16_t tcAcceptedVersion = CHIP_CONFIG_TNC_ACCEPTED_VERSION;
err = WriteConfigValue(PosixConfig::kConfigKey_TCAcceptedVersion, tcAcceptedVersion);
SuccessOrExit(err);
}

if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_TCMinRequiredVersion))
{
uint16_t tcMinRequiredVersion = 0U;
uint16_t tcMinRequiredVersion = CHIP_CONFIG_TNC_REQUIRED_VERSION;
err = WriteConfigValue(PosixConfig::kConfigKey_TCMinRequiredVersion, tcMinRequiredVersion);
SuccessOrExit(err);
}

if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_TCAcknowledgements))
{
uint16_t tcAcknowledgements = 0U;
uint16_t tcAcknowledgements = CHIP_CONFIG_TNC_ACCEPTED_ACKNOWLEDGEMENTS;
err = WriteConfigValue(PosixConfig::kConfigKey_TCAcknowledgements, tcAcknowledgements);
SuccessOrExit(err);
}

if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_TCAcknowledgementsRequired))
{
uint16_t tcAcknowledgementsRequired = 0U;
err = WriteConfigValue(PosixConfig::kConfigKey_TCAcknowledgementsRequired, tcAcknowledgementsRequired);
uint16_t tcAcknowledgementsRequired = CHIP_CONFIG_TNC_REQUIRED_ACKNOWLEDGEMENTS;
err = WriteConfigValue(PosixConfig::kConfigKey_TCAcknowledgementsRequired, tcAcknowledgementsRequired);
SuccessOrExit(err);
}

Expand Down

0 comments on commit 1ec4b82

Please sign in to comment.