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>
26 namespace DeviceLayer {
29 * Concrete implementation of the SoftwareUpdateManager singleton object for the
32 class SoftwareUpdateManagerImpl final : public SoftwareUpdateManager,
33 public Internal::GenericSoftwareUpdateManagerImpl<SoftwareUpdateManagerImpl>
35 // Allow the SoftwareUpdateManager interface class to delegate method calls to
36 // the implementation methods provided by this class.
37 friend class SoftwareUpdateManager;
39 // Allow the GenericSoftwareUpdateManagerImpl base class to access helper methods
40 // and types defined on this class.
41 friend class Internal::GenericSoftwareUpdateManagerImpl<SoftwareUpdateManagerImpl>;
44 // ===== Members for internal use by the following friends.
46 friend ::chip::DeviceLayer::SoftwareUpdateManager & SoftwareUpdateMgr();
47 friend SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl();
49 static SoftwareUpdateManagerImpl sInstance;
52 // ===== Members that implement the SoftwareUpdateManager abstract interface.
58 * Returns a reference to the public interface of the SoftwareUpdateManager singleton object.
60 * Internal components should use this to access features of the SoftwareUpdateManager object
61 * that are common to all platforms.
63 inline SoftwareUpdateManager & SoftwareUpdateMgr()
65 return SoftwareUpdateManagerImpl::sInstance;
69 * Returns the platform-specific implementation of the SoftwareUpdateManager singleton object.
71 * Internal components can use this to gain access to features of the SoftwareUpdateManager
72 * that are specific to the nRF5 platform.
74 inline SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl()
76 return SoftwareUpdateManagerImpl::sInstance;
79 } // namespace DeviceLayer
82 #endif // CHIP_DEVICE_CONFIG_ENABLE_SOFTWARE_UPDATE_MANAGER