diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index f287c990840637..e723bbb1dcaa11 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -97,16 +97,24 @@ CHIP_ERROR GeneralCommissioningAttrAccess::Read(const ConcreteReadAttributePath return ReadSupportsConcurrentConnection(aEncoder); } case TCAcceptedVersion::Id: { - return ReadIfSupported(&ConfigurationManager::GetTCAcceptedVersion, aEncoder); + uint16_t tcAcceptedVersion; + CHIP_ERROR err = TermsAndConditionsManager::GetInstance().GetTCAcceptedVersion(tcAcceptedVersion); + return (CHIP_NO_ERROR != err) ? err : aEncoder.Encode(tcAcceptedVersion); } case TCMinRequiredVersion::Id: { - return ReadIfSupported(&ConfigurationManager::GetTCMinRequiredVersion, aEncoder); + uint16_t tcMinRequiredVersion; + CHIP_ERROR err = TermsAndConditionsManager::GetInstance().GetTCMinRequiredVersion(tcMinRequiredVersion); + return (CHIP_NO_ERROR != err) ? err : aEncoder.Encode(tcMinRequiredVersion); } case TCAcknowledgements::Id: { - return ReadIfSupported(&ConfigurationManager::GetTCAcknowledgements, aEncoder); + uint16_t tcAcknowledgements; + CHIP_ERROR err = TermsAndConditionsManager::GetInstance().GetTCAcknowledgements(tcAcknowledgements); + return (CHIP_NO_ERROR != err) ? err : aEncoder.Encode(tcAcknowledgements); } case TCAcknowledgementsRequired::Id: { - return ReadIfSupported(&ConfigurationManager::GetTCAcknowledgementsRequired, aEncoder); + uint16_t tcAcknowledgementsRequired; + CHIP_ERROR err = TermsAndConditionsManager::GetInstance().GetTCAcknowledgementsRequired(tcAcknowledgementsRequired); + return (CHIP_NO_ERROR != err) ? err : aEncoder.Encode(tcAcknowledgementsRequired); } default: break; diff --git a/src/app/server/BUILD.gn b/src/app/server/BUILD.gn index 268201b12b1725..bab340fb3fbc61 100644 --- a/src/app/server/BUILD.gn +++ b/src/app/server/BUILD.gn @@ -40,12 +40,16 @@ static_library("server") { "Dnssd.h", "EchoHandler.cpp", "EchoHandler.h", + "EnhancedSetupFlowProvider.cpp", + "EnhancedSetupFlowProvider.h", "OnboardingCodesUtil.cpp", "OnboardingCodesUtil.h", "Server.cpp", "Server.h", "TermsAndConditionsManager.cpp", "TermsAndConditionsManager.h", + "TermsAndConditionsProvider.cpp", + "TermsAndConditionsProvider.h", ] public_configs = [ ":server_config" ] diff --git a/src/app/server/EnhancedSetupFlowProvider.cpp b/src/app/server/EnhancedSetupFlowProvider.cpp new file mode 100644 index 00000000000000..4a2ece71f74ef9 --- /dev/null +++ b/src/app/server/EnhancedSetupFlowProvider.cpp @@ -0,0 +1,19 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EnhancedSetupFlowProvider.h" diff --git a/src/app/server/EnhancedSetupFlowProvider.h b/src/app/server/EnhancedSetupFlowProvider.h new file mode 100644 index 00000000000000..477ad003b0b34a --- /dev/null +++ b/src/app/server/EnhancedSetupFlowProvider.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +namespace chip { +namespace app { + +class EnhancedSetupFlowProvider +{ +public: + CHIP_ERROR GetTCAcceptedVersion(uint16_t & value); + CHIP_ERROR GetTCMinRequiredVersion(uint16_t & value); + CHIP_ERROR GetTCAcknowledgements(uint16_t & value); + CHIP_ERROR GetTCAcknowledgementsRequired(uint16_t & value); + CHIP_ERROR StoreTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse); +}; + +}; // namespace app +}; // namespace chip diff --git a/src/app/server/TermsAndConditionsManager.cpp b/src/app/server/TermsAndConditionsManager.cpp index 30597fe64ad418..da36c2f403a843 100644 --- a/src/app/server/TermsAndConditionsManager.cpp +++ b/src/app/server/TermsAndConditionsManager.cpp @@ -20,11 +20,13 @@ #include +chip::app::TermsAndConditionsManager chip::app::TermsAndConditionsManager::sTermsAndConditionsManagerInstance; + CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCAcceptedVersion(uint16_t & value) { CHIP_ERROR err = CHIP_NO_ERROR; - err = DeviceLayer::ConfigurationMgr().GetTCAcceptedVersion(value); + err = mTermsAndConditionsProvider.GetTCAcceptedVersion(value); SuccessOrExit(err); exit: @@ -39,7 +41,7 @@ CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCMinRequiredVersion(uint16_ { CHIP_ERROR err = CHIP_NO_ERROR; - err = DeviceLayer::ConfigurationMgr().GetTCMinRequiredVersion(value); + err = mTermsAndConditionsProvider.GetTCMinRequiredVersion(value); SuccessOrExit(err); exit: @@ -54,7 +56,7 @@ CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCAcknowledgements(uint16_t { CHIP_ERROR err = CHIP_NO_ERROR; - err = DeviceLayer::ConfigurationMgr().GetTCAcknowledgements(value); + err = mTermsAndConditionsProvider.GetTCAcknowledgements(value); SuccessOrExit(err); exit: @@ -69,7 +71,7 @@ CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCAcknowledgementsRequired(u { CHIP_ERROR err = CHIP_NO_ERROR; - err = DeviceLayer::ConfigurationMgr().GetTCAcknowledgementsRequired(value); + err = mTermsAndConditionsProvider.GetTCAcknowledgementsRequired(value); SuccessOrExit(err); exit: @@ -84,7 +86,7 @@ CHIP_ERROR chip::app::TermsAndConditionsManager::SetTCAcknowledgements(uint16_t { CHIP_ERROR err = CHIP_NO_ERROR; - err = DeviceLayer::ConfigurationMgr().StoreTCAcknowledgements(tcVersion, tcUserResponse); + err = mTermsAndConditionsProvider.SetTCAcknowledgements(tcVersion, tcUserResponse); SuccessOrExit(err); exit: diff --git a/src/app/server/TermsAndConditionsManager.h b/src/app/server/TermsAndConditionsManager.h index 6cf09e5752a928..b050ffb26a25b7 100644 --- a/src/app/server/TermsAndConditionsManager.h +++ b/src/app/server/TermsAndConditionsManager.h @@ -18,6 +18,8 @@ #pragma once +#include "EnhancedSetupFlowProvider.h" +#include "TermsAndConditionsProvider.h" #include #include @@ -25,13 +27,20 @@ namespace chip { namespace app { -class TermsAndConditionsManager { +class TermsAndConditionsManager +{ public: - CHIP_ERROR GetTCAcceptedVersion(uint16_t &value); - CHIP_ERROR GetTCMinRequiredVersion(uint16_t &value); - CHIP_ERROR GetTCAcknowledgements(uint16_t &value); - CHIP_ERROR GetTCAcknowledgementsRequired(uint16_t &value); + static TermsAndConditionsManager& GetInstance() { return sTermsAndConditionsManagerInstance; } + + CHIP_ERROR GetTCAcceptedVersion(uint16_t & value); + CHIP_ERROR GetTCMinRequiredVersion(uint16_t & value); + CHIP_ERROR GetTCAcknowledgements(uint16_t & value); + CHIP_ERROR GetTCAcknowledgementsRequired(uint16_t & value); CHIP_ERROR SetTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse); +private: + static TermsAndConditionsManager sTermsAndConditionsManagerInstance; + TermsAndConditionsProvider mTermsAndConditionsProvider; + EnhancedSetupFlowProvider mEnhancedSetupFlowProvider; }; }; // namespace app diff --git a/src/app/server/TermsAndConditionsProvider.cpp b/src/app/server/TermsAndConditionsProvider.cpp new file mode 100644 index 00000000000000..dfea75e43f6ed4 --- /dev/null +++ b/src/app/server/TermsAndConditionsProvider.cpp @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TermsAndConditionsProvider.h" + +#include "core/CHIPBuildConfig.h" + +chip::app::TermsAndConditionsProvider::TermsAndConditionsProvider() : + mTermsAndConditionsAcceptedVersion(0), mTermsAndConditionsAcknowledgements(0) +{} + +CHIP_ERROR chip::app::TermsAndConditionsProvider::GetTCAcceptedVersion(uint16_t & value) +{ + value = mTermsAndConditionsAcceptedVersion; + return CHIP_NO_ERROR; +} + +CHIP_ERROR chip::app::TermsAndConditionsProvider::GetTCMinRequiredVersion(uint16_t & value) +{ + value = CHIP_CONFIG_TC_REQUIRED_VERSION; + return CHIP_NO_ERROR; +} + +CHIP_ERROR chip::app::TermsAndConditionsProvider::GetTCAcknowledgements(uint16_t & value) +{ + value = mTermsAndConditionsAcknowledgements; + return CHIP_NO_ERROR; +} + +CHIP_ERROR chip::app::TermsAndConditionsProvider::GetTCAcknowledgementsRequired(uint16_t & value) +{ + value = CHIP_CONFIG_TC_REQUIRED_ACKNOWLEDGEMENTS; + return CHIP_NO_ERROR; +} + +CHIP_ERROR chip::app::TermsAndConditionsProvider::SetTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse) +{ + mTermsAndConditionsAcceptedVersion = tcVersion; + mTermsAndConditionsAcknowledgements = tcUserResponse; + return CHIP_NO_ERROR; +} diff --git a/src/app/server/TermsAndConditionsProvider.h b/src/app/server/TermsAndConditionsProvider.h new file mode 100644 index 00000000000000..60a93b99645c66 --- /dev/null +++ b/src/app/server/TermsAndConditionsProvider.h @@ -0,0 +1,44 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +namespace chip { +namespace app { + +class TermsAndConditionsProvider +{ +public: + TermsAndConditionsProvider(); + CHIP_ERROR GetTCAcceptedVersion(uint16_t & value); + CHIP_ERROR GetTCMinRequiredVersion(uint16_t & value); + CHIP_ERROR GetTCAcknowledgements(uint16_t & value); + CHIP_ERROR GetTCAcknowledgementsRequired(uint16_t & value); + CHIP_ERROR SetTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse); + +private: + uint16_t mTermsAndConditionsAcceptedVersion; + uint16_t mTermsAndConditionsAcknowledgements; +}; + +}; // namespace app +}; // namespace chip diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index 94fd5acf77794f..b0d95b1eb88f4f 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -104,10 +104,7 @@ class ConfigurationManager virtual CHIP_ERROR GetSoftwareVersionString(char * buf, size_t bufSize) = 0; virtual CHIP_ERROR GetSoftwareVersion(uint32_t & softwareVer) = 0; virtual CHIP_ERROR GetFirmwareBuildChipEpochTime(System::Clock::Seconds32 & buildTime) = 0; - virtual CHIP_ERROR SetFirmwareBuildChipEpochTime(System::Clock::Seconds32 buildTime) - { - return CHIP_ERROR_NOT_IMPLEMENTED; - } + virtual CHIP_ERROR SetFirmwareBuildChipEpochTime(System::Clock::Seconds32 buildTime) { return CHIP_ERROR_NOT_IMPLEMENTED; } #if CHIP_ENABLE_ROTATING_DEVICE_ID && defined(CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID) // Lifetime counter is monotonic counter that is incremented upon each commencement of advertising virtual CHIP_ERROR GetLifetimeCounter(uint16_t & lifetimeCounter) = 0; @@ -135,12 +132,6 @@ class ConfigurationManager virtual CHIP_ERROR GetFailSafeArmed(bool & val) = 0; virtual CHIP_ERROR SetFailSafeArmed(bool val) = 0; - virtual CHIP_ERROR GetTCAcceptedVersion(uint16_t & value) = 0; - virtual CHIP_ERROR GetTCMinRequiredVersion(uint16_t & value) = 0; - virtual CHIP_ERROR GetTCAcknowledgements(uint16_t & value) = 0; - virtual CHIP_ERROR GetTCAcknowledgementsRequired(uint16_t & value) = 0; - virtual CHIP_ERROR StoreTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse) = 0; - virtual CHIP_ERROR GetBLEDeviceIdentificationInfo(Ble::ChipBLEDeviceIdentificationInfo & deviceIdInfo) = 0; #if CHIP_CONFIG_TEST diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.h b/src/include/platform/internal/GenericConfigurationManagerImpl.h index a8b82356884b5d..fc23b7c01341b0 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.h +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.h @@ -81,7 +81,6 @@ class GenericConfigurationManagerImpl : public ConfigurationManager #endif CHIP_ERROR GetFailSafeArmed(bool & val) override; CHIP_ERROR SetFailSafeArmed(bool val) override; - CHIP_ERROR GetBLEDeviceIdentificationInfo(Ble::ChipBLEDeviceIdentificationInfo & deviceIdInfo) override; bool IsCommissionableDeviceTypeEnabled() override; CHIP_ERROR GetDeviceTypeId(uint32_t & deviceType) override; @@ -95,11 +94,6 @@ class GenericConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR StoreRegulatoryLocation(uint8_t location) override; CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) override; CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) override; - CHIP_ERROR GetTCAcceptedVersion(uint16_t &value) override; - CHIP_ERROR GetTCMinRequiredVersion(uint16_t &value) override; - CHIP_ERROR GetTCAcknowledgements(uint16_t &value) override; - CHIP_ERROR GetTCAcknowledgementsRequired(uint16_t &value) override; - CHIP_ERROR StoreTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse) override; CHIP_ERROR GetRebootCount(uint32_t & rebootCount) override; CHIP_ERROR StoreRebootCount(uint32_t rebootCount) override; CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) override; @@ -142,8 +136,8 @@ class GenericConfigurationManagerImpl : public ConfigurationManager // Methods to read and write configuration values, as well as run the configuration unit test. typedef typename ConfigClass::Key Key; virtual CHIP_ERROR ReadConfigValue(Key key, bool & val) = 0; - virtual CHIP_ERROR ReadConfigValue(Key key, uint16_t & val) = 0; virtual CHIP_ERROR ReadConfigValue(Key key, uint32_t & val) = 0; + virtual CHIP_ERROR ReadConfigValue(Key key, uint16_t & val) = 0; virtual CHIP_ERROR ReadConfigValue(Key key, uint64_t & val) = 0; virtual CHIP_ERROR ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) = 0; virtual CHIP_ERROR ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) = 0; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp index 0a720b5d57d542..955b782a3238ed 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2020-2024 Project CHIP Authors + * Copyright (c) 2020-2022 Project CHIP Authors * Copyright (c) 2019-2020 Google LLC. * Copyright (c) 2018 Nest Labs, Inc. * @@ -582,48 +582,6 @@ CHIP_ERROR GenericConfigurationManagerImpl::SetFailSafeArmed(bool v return WriteConfigValue(ConfigClass::kConfigKey_FailSafeArmed, val); } -template -CHIP_ERROR GenericConfigurationManagerImpl::GetTCAcceptedVersion(uint16_t & value) -{ - return ReadConfigValue(ConfigClass::kConfigKey_TCAcceptedVersion, value); -} - -template -CHIP_ERROR GenericConfigurationManagerImpl::GetTCMinRequiredVersion(uint16_t & value) -{ - return ReadConfigValue(ConfigClass::kConfigKey_TCMinRequiredVersion, value); -} - -template -CHIP_ERROR GenericConfigurationManagerImpl::GetTCAcknowledgements(uint16_t & value) -{ - return ReadConfigValue(ConfigClass::kConfigKey_TCAcknowledgements, value); -} - -template -CHIP_ERROR GenericConfigurationManagerImpl::GetTCAcknowledgementsRequired(uint16_t & value) -{ - return ReadConfigValue(ConfigClass::kConfigKey_TCAcknowledgementsRequired, value); -} - -template -CHIP_ERROR GenericConfigurationManagerImpl::StoreTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse) -{ - CHIP_ERROR err; - - err = WriteConfigValue(ConfigClass::kConfigKey_TCAcceptedVersion, 0U); - SuccessOrExit(err); - - err = WriteConfigValue(ConfigClass::kConfigKey_TCAcknowledgements, tcUserResponse); - SuccessOrExit(err); - - err = WriteConfigValue(ConfigClass::kConfigKey_TCAcceptedVersion, tcVersion); - SuccessOrExit(err); - -exit: - return err; -} - template CHIP_ERROR GenericConfigurationManagerImpl::GetBLEDeviceIdentificationInfo(Ble::ChipBLEDeviceIdentificationInfo & deviceIdInfo) diff --git a/src/platform/Linux/ConfigurationManagerImpl.cpp b/src/platform/Linux/ConfigurationManagerImpl.cpp index deeff0cfcc7da5..92e2c1e290b7bc 100644 --- a/src/platform/Linux/ConfigurationManagerImpl.cpp +++ b/src/platform/Linux/ConfigurationManagerImpl.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2020-2024 Project CHIP Authors + * Copyright (c) 2020 Project CHIP Authors * Copyright (c) 2018 Nest Labs, Inc. * All rights reserved. * @@ -118,34 +118,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() SuccessOrExit(err); } - if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_TCAcceptedVersion)) - { - uint16_t tcAcceptedVersion = CHIP_CONFIG_TC_ACCEPTED_VERSION; - err = WriteConfigValue(PosixConfig::kConfigKey_TCAcceptedVersion, tcAcceptedVersion); - SuccessOrExit(err); - } - - if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_TCMinRequiredVersion)) - { - uint16_t tcMinRequiredVersion = CHIP_CONFIG_TC_REQUIRED_VERSION; - err = WriteConfigValue(PosixConfig::kConfigKey_TCMinRequiredVersion, tcMinRequiredVersion); - SuccessOrExit(err); - } - - if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_TCAcknowledgements)) - { - uint16_t tcAcknowledgements = CHIP_CONFIG_TC_ACCEPTED_ACKNOWLEDGEMENTS; - err = WriteConfigValue(PosixConfig::kConfigKey_TCAcknowledgements, tcAcknowledgements); - SuccessOrExit(err); - } - - if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_TCAcknowledgementsRequired)) - { - uint16_t tcAcknowledgementsRequired = CHIP_CONFIG_TC_REQUIRED_ACKNOWLEDGEMENTS; - err = WriteConfigValue(PosixConfig::kConfigKey_TCAcknowledgementsRequired, tcAcknowledgementsRequired); - SuccessOrExit(err); - } - err = CHIP_NO_ERROR; exit: diff --git a/src/platform/Linux/PosixConfig.cpp b/src/platform/Linux/PosixConfig.cpp index cb74ec8ae72f99..61a1fbd4dda6ed 100644 --- a/src/platform/Linux/PosixConfig.cpp +++ b/src/platform/Linux/PosixConfig.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2020-2024 Project CHIP Authors + * Copyright (c) 2020-2022 Project CHIP Authors * Copyright (c) 2019-2020 Google LLC. * Copyright (c) 2018 Nest Labs, Inc. * All rights reserved. @@ -62,22 +62,17 @@ const PosixConfig::Key PosixConfig::kConfigKey_Spake2pSalt = { kConfig const PosixConfig::Key PosixConfig::kConfigKey_Spake2pVerifier = { kConfigNamespace_ChipFactory, "verifier" }; const PosixConfig::Key PosixConfig::kConfigKey_VendorId = { kConfigNamespace_ChipFactory, "vendor-id" }; const PosixConfig::Key PosixConfig::kConfigKey_ProductId = { kConfigNamespace_ChipFactory, "product-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipFactory, "unique-id" }; - // Keys stored in the Chip-config namespace -const PosixConfig::Key PosixConfig::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; -const PosixConfig::Key PosixConfig::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; -const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; -const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; -const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; -const PosixConfig::Key PosixConfig::kConfigKey_LocationCapability = { kConfigNamespace_ChipConfig, "location-capability" }; -const PosixConfig::Key PosixConfig::kConfigKey_TCAcceptedVersion = { kConfigNamespace_ChipConfig, "tc-accepted-version" }; -const PosixConfig::Key PosixConfig::kConfigKey_TCMinRequiredVersion = { kConfigNamespace_ChipConfig, "tc-min-required-version" }; -const PosixConfig::Key PosixConfig::kConfigKey_TCAcknowledgements = { kConfigNamespace_ChipConfig, "tc-acknowledgements" }; -const PosixConfig::Key PosixConfig::kConfigKey_TCAcknowledgementsRequired = { kConfigNamespace_ChipConfig, "tc-acknowledgements-required" }; +const PosixConfig::Key PosixConfig::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; +const PosixConfig::Key PosixConfig::kConfigKey_PairedAccountId = { kConfigNamespace_ChipConfig, "account-id" }; +const PosixConfig::Key PosixConfig::kConfigKey_ServiceId = { kConfigNamespace_ChipConfig, "service-id" }; +const PosixConfig::Key PosixConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" }; +const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed = { kConfigNamespace_ChipConfig, "fail-safe-armed" }; +const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; +const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; +const PosixConfig::Key PosixConfig::kConfigKey_LocationCapability = { kConfigNamespace_ChipConfig, "location-capability" }; +const PosixConfig::Key PosixConfig::kConfigKey_UniqueId = { kConfigNamespace_ChipFactory, "unique-id" }; // Keys stored in the Chip-counters namespace const PosixConfig::Key PosixConfig::kCounterKey_RebootCount = { kConfigNamespace_ChipCounters, "reboot-count" }; diff --git a/src/platform/Linux/PosixConfig.h b/src/platform/Linux/PosixConfig.h index eebb5b5b7a1960..c04d4a9be1093f 100644 --- a/src/platform/Linux/PosixConfig.h +++ b/src/platform/Linux/PosixConfig.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2020-2024 Project CHIP Authors + * Copyright (c) 2020-2022 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,10 +77,6 @@ class PosixConfig static const Key kConfigKey_Spake2pVerifier; static const Key kConfigKey_VendorId; static const Key kConfigKey_ProductId; - static const Key kConfigKey_TCAcceptedVersion; - static const Key kConfigKey_TCMinRequiredVersion; - static const Key kConfigKey_TCAcknowledgements; - static const Key kConfigKey_TCAcknowledgementsRequired; static const Key kCounterKey_RebootCount; static const Key kCounterKey_UpTime; diff --git a/src/platform/fake/ConfigurationManagerImpl.h b/src/platform/fake/ConfigurationManagerImpl.h index fb8bb3e1e08369..510b2fc0dacc83 100644 --- a/src/platform/fake/ConfigurationManagerImpl.h +++ b/src/platform/fake/ConfigurationManagerImpl.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021-2024 Project CHIP Authors + * Copyright (c) 2021-2022 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -76,11 +76,6 @@ class ConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR StoreRegulatoryLocation(uint8_t location) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetTCAcceptedVersion(uint16_t & value) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetTCMinRequiredVersion(uint16_t & value) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetTCAcknowledgements(uint16_t & value) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetTCAcknowledgementsRequired(uint16_t & value) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR StoreTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetRebootCount(uint32_t & rebootCount) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreRebootCount(uint32_t rebootCount) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) override { return CHIP_ERROR_NOT_IMPLEMENTED; }