3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2019 Nest Labs, Inc.
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.
19 #include <platform/internal/CHIPDeviceLayerInternal.h>
21 #include <platform/ConnectivityManager.h>
22 #include <platform/internal/BLEManager.h>
26 #include <support/CodeUtils.h>
27 #include <support/logging/CHIPLogging.h>
29 #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
30 #include <platform/internal/GenericConnectivityManagerImpl_BLE.cpp>
33 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
34 #include <platform/internal/GenericConnectivityManagerImpl_Thread.cpp>
37 using namespace ::chip;
38 using namespace ::chip::TLV;
39 using namespace ::chip::DeviceLayer::Internal;
42 namespace DeviceLayer {
44 ConnectivityManagerImpl ConnectivityManagerImpl::sInstance;
46 CHIP_ERROR ConnectivityManagerImpl::_Init()
48 CHIP_ERROR err = CHIP_NO_ERROR;
50 // Initialize the generic base classes that require it.
51 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
52 GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_Init();
61 void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
63 // Forward the event to the generic base classes as needed.
64 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
65 GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_OnPlatformEvent(event);
69 } // namespace DeviceLayer