3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2020 Nest Labs, Inc.
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.
19 /* this file behaves like a config.h, comes first */
20 #include <platform/internal/CHIPDeviceLayerInternal.h>
22 #include <platform/ConnectivityManager.h>
23 #include <platform/internal/BLEManager.h>
24 #include <support/CodeUtils.h>
25 #include <support/logging/CHIPLogging.h>
28 #include <lwip/ip_addr.h>
30 #include <lwip/netif.h>
32 #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
33 #include <platform/internal/GenericConnectivityManagerImpl_BLE.cpp>
36 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
37 #include <platform/internal/GenericConnectivityManagerImpl_Thread.cpp>
40 using namespace ::chip;
41 using namespace ::chip::Inet;
42 using namespace ::chip::System;
43 using namespace ::chip::TLV;
44 using namespace ::chip::DeviceLayer::Internal;
47 namespace DeviceLayer {
49 ConnectivityManagerImpl ConnectivityManagerImpl::sInstance;
51 CHIP_ERROR ConnectivityManagerImpl::_Init()
53 CHIP_ERROR err = CHIP_NO_ERROR;
55 // Initialize the generic base classes that require it.
56 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
57 GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_Init();
66 void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
68 // Forward the event to the generic base classes as needed.
69 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
70 GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_OnPlatformEvent(event);
74 } // namespace DeviceLayer