3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2020 Google LLC.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #if CHIP_DEVICE_CONFIG_ENABLE_SOFTWARE_UPDATE_MANAGER
24 #include <platform/internal/GenericSoftwareUpdateManagerImpl.h>
25 #include <platform/internal/GenericSoftwareUpdateManagerImpl_BDX.h>
28 namespace DeviceLayer {
31 * Concrete implementation of the SoftwareUpdateManager singleton object for the
34 class SoftwareUpdateManagerImpl final : public SoftwareUpdateManager,
35 public Internal::GenericSoftwareUpdateManagerImpl<SoftwareUpdateManagerImpl>,
36 public Internal::GenericSoftwareUpdateManagerImpl_BDX<SoftwareUpdateManagerImpl>
38 // Allow the SoftwareUpdateManager interface class to delegate method calls to
39 // the implementation methods provided by this class.
40 friend class SoftwareUpdateManager;
42 // Allow the GenericSoftwareUpdateManagerImpl base class to access helper methods
43 // and types defined on this class.
44 friend class Internal::GenericSoftwareUpdateManagerImpl<SoftwareUpdateManagerImpl>;
46 // Allow the GenericSoftwareUpdateManagerImpl_BDX base class to access helper methods
47 // and types defined on this class.
48 friend class Internal::GenericSoftwareUpdateManagerImpl_BDX<SoftwareUpdateManagerImpl>;
51 // ===== Members for internal use by the following friends.
53 friend ::chip::DeviceLayer::SoftwareUpdateManager & SoftwareUpdateMgr(void);
54 friend SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(void);
56 static SoftwareUpdateManagerImpl sInstance;
59 // ===== Members that implement the SoftwareUpdateManager abstract interface.
61 CHIP_ERROR _Init(void);
65 * Returns a reference to the public interface of the SoftwareUpdateManager singleton object.
67 * Internal components should use this to access features of the SoftwareUpdateManager object
68 * that are common to all platforms.
70 inline SoftwareUpdateManager & SoftwareUpdateMgr(void)
72 return SoftwareUpdateManagerImpl::sInstance;
76 * Returns the platform-specific implementation of the SoftwareUpdateManager singleton object.
78 * Internal components can use this to gain access to features of the SoftwareUpdateManager
79 * that are specific to the K32W platform.
81 inline SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(void)
83 return SoftwareUpdateManagerImpl::sInstance;
86 } // namespace DeviceLayer
89 #endif // CHIP_DEVICE_CONFIG_ENABLE_SOFTWARE_UPDATE_MANAGER