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.
18 /* this file behaves like a config.h, comes first */
19 #include <platform/internal/CHIPDeviceLayerInternal.h>
21 #include <platform/ConnectivityManager.h>
22 #include <platform/internal/BLEManager.h>
23 #include <support/CodeUtils.h>
24 #include <support/logging/CHIPLogging.h>
27 #include <lwip/ip_addr.h>
29 #include <lwip/netif.h>
31 #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
32 #include <platform/internal/GenericConnectivityManagerImpl_BLE.cpp>
35 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
36 #include <platform/internal/GenericConnectivityManagerImpl_Thread.cpp>
39 using namespace ::chip;
40 using namespace ::chip::Inet;
41 using namespace ::chip::System;
42 using namespace ::chip::TLV;
43 using namespace ::chip::DeviceLayer::Internal;
46 namespace DeviceLayer {
48 ConnectivityManagerImpl ConnectivityManagerImpl::sInstance;
50 CHIP_ERROR ConnectivityManagerImpl::_Init()
52 CHIP_ERROR err = CHIP_NO_ERROR;
54 // Initialize the generic base classes that require it.
55 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
56 GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_Init();
64 void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
66 // Forward the event to the generic base classes as needed.
67 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
68 GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_OnPlatformEvent(event);
72 } // namespace DeviceLayer