3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2020 Texas Instruments Incorporated
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 * Provides an implementation of the ConfigurationManager object
22 * for the Texas Instruments CC1352 platform.
27 #include <platform/cc13x2_26x2/CC13X2_26X2Config.h>
28 #include <platform/internal/GenericConfigurationManagerImpl.h>
31 namespace DeviceLayer {
34 * Concrete implementation of the ConfigurationManager singleton object for the CC13X2_26X2 platform.
36 class ConfigurationManagerImpl final : public ConfigurationManager,
37 public Internal::GenericConfigurationManagerImpl<ConfigurationManagerImpl>,
38 private Internal::CC13X2_26X2Config
40 // Allow the ConfigurationManager interface class to delegate method calls to
41 // the implementation methods provided by this class.
42 friend class ConfigurationManager;
44 // Allow the GenericConfigurationManagerImpl base class to access helper methods and types
45 // defined on this class.
46 friend class Internal::GenericConfigurationManagerImpl<ConfigurationManagerImpl>;
49 // ===== Members that implement the ConfigurationManager public interface.
51 CHIP_ERROR _Init(void);
52 CHIP_ERROR _GetPrimaryWiFiMACAddress(uint8_t * buf);
53 bool _CanFactoryReset(void);
54 void _InitiateFactoryReset(void);
55 CHIP_ERROR _ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t & value);
56 CHIP_ERROR _WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t value);
58 // NOTE: Other public interface methods are implemented by GenericConfigurationManagerImpl<>.
60 // ===== Members for internal use by the following friends.
62 friend ConfigurationManager & ConfigurationMgr(void);
63 friend ConfigurationManagerImpl & ConfigurationMgrImpl(void);
65 static ConfigurationManagerImpl sInstance;
67 // ===== Private members reserved for use by this class only.
69 static void DoFactoryReset(intptr_t arg);
73 * Returns the public interface of the ConfigurationManager singleton object.
75 * chip applications should use this to access features of the ConfigurationManager object
76 * that are common to all platforms.
78 inline ConfigurationManager & ConfigurationMgr(void)
80 return ConfigurationManagerImpl::sInstance;
84 * Returns the platform-specific implementation of the ConfigurationManager singleton object.
86 * chip applications can use this to gain access to features of the ConfigurationManager
87 * that are specific to the CC1352 SoC
89 inline ConfigurationManagerImpl & ConfigurationMgrImpl(void)
91 return ConfigurationManagerImpl::sInstance;
94 inline CHIP_ERROR ConfigurationManagerImpl::_GetPrimaryWiFiMACAddress(uint8_t * buf)
96 return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
99 } // namespace DeviceLayer