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