3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2019 Google LLC.
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 #if CHIP_DEVICE_CONFIG_ENABLE_SOFTWARE_UPDATE_MANAGER
23 #include <platform/internal/GenericSoftwareUpdateManagerImpl.h>
24 #include <platform/internal/GenericSoftwareUpdateManagerImpl_BDX.h>
27 namespace DeviceLayer {
30 * Concrete implementation of the SoftwareUpdateManager singleton object for the
31 * Silicon Labs EFR32 platforms.
33 class SoftwareUpdateManagerImpl final : public SoftwareUpdateManager,
34 public Internal::GenericSoftwareUpdateManagerImpl<SoftwareUpdateManagerImpl>,
35 public Internal::GenericSoftwareUpdateManagerImpl_BDX<SoftwareUpdateManagerImpl>
37 // Allow the SoftwareUpdateManager interface class to delegate method calls to
38 // the implementation methods provided by this class.
39 friend class SoftwareUpdateManager;
41 // Allow the GenericSoftwareUpdateManagerImpl base class to access helper methods
42 // and types defined on this class.
43 friend class Internal::GenericSoftwareUpdateManagerImpl<SoftwareUpdateManagerImpl>;
45 // Allow the GenericSoftwareUpdateManagerImpl_BDX base class to access helper methods
46 // and types defined on this class.
47 friend class Internal::GenericSoftwareUpdateManagerImpl_BDX<SoftwareUpdateManagerImpl>;
50 // ===== Members for internal use by the following friends.
52 friend ::chip::DeviceLayer::SoftwareUpdateManager & SoftwareUpdateMgr(void);
53 friend SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(void);
55 static SoftwareUpdateManagerImpl sInstance;
58 // ===== Members that implement the SoftwareUpdateManager abstract interface.
60 CHIP_ERROR _Init(void);
64 * Returns a reference to the public interface of the SoftwareUpdateManager singleton object.
66 * Internal components should use this to access features of the SoftwareUpdateManager object
67 * that are common to all platforms.
69 inline SoftwareUpdateManager & SoftwareUpdateMgr(void)
71 return SoftwareUpdateManagerImpl::sInstance;
75 * Returns the platform-specific implementation of the SoftwareUpdateManager singleton object.
77 * Internal components can use this to gain access to features of the SoftwareUpdateManager
78 * that are specific to the EFR32 platform.
80 inline SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(void)
82 return SoftwareUpdateManagerImpl::sInstance;
85 } // namespace DeviceLayer
88 #endif // CHIP_DEVICE_CONFIG_ENABLE_SOFTWARE_UPDATE_MANAGER