Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / EFR32 / ConnectivityManagerImpl.cpp
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2019 Nest Labs, Inc.
5  *
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
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  */
18 /* this file behaves like a config.h, comes first */
19 #include <platform/internal/CHIPDeviceLayerInternal.h>
20
21 #include <platform/ConnectivityManager.h>
22 #include <platform/internal/BLEManager.h>
23 #include <support/CodeUtils.h>
24 #include <support/logging/CHIPLogging.h>
25
26 #include <lwip/dns.h>
27 #include <lwip/ip_addr.h>
28 #include <lwip/nd6.h>
29 #include <lwip/netif.h>
30
31 #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
32 #include <platform/internal/GenericConnectivityManagerImpl_BLE.cpp>
33 #endif
34
35 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
36 #include <platform/internal/GenericConnectivityManagerImpl_Thread.cpp>
37 #endif
38
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;
44
45 namespace chip {
46 namespace DeviceLayer {
47
48 ConnectivityManagerImpl ConnectivityManagerImpl::sInstance;
49
50 CHIP_ERROR ConnectivityManagerImpl::_Init()
51 {
52     CHIP_ERROR err = CHIP_NO_ERROR;
53
54     // Initialize the generic base classes that require it.
55 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
56     GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_Init();
57 #endif
58     SuccessOrExit(err);
59
60 exit:
61     return err;
62 }
63
64 void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
65 {
66     // Forward the event to the generic base classes as needed.
67 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
68     GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_OnPlatformEvent(event);
69 #endif
70 }
71
72 } // namespace DeviceLayer
73 } // namespace chip