Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / Darwin / 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
19 #include <platform/internal/CHIPDeviceLayerInternal.h>
20
21 #include <platform/ConnectivityManager.h>
22 #include <platform/internal/BLEManager.h>
23
24 #include <new>
25
26 #include <support/CodeUtils.h>
27 #include <support/logging/CHIPLogging.h>
28
29 #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
30 #include <platform/internal/GenericConnectivityManagerImpl_BLE.cpp>
31 #endif
32
33 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
34 #include <platform/internal/GenericConnectivityManagerImpl_Thread.cpp>
35 #endif
36
37 using namespace ::chip;
38 using namespace ::chip::TLV;
39 using namespace ::chip::DeviceLayer::Internal;
40
41 namespace chip {
42 namespace DeviceLayer {
43
44 ConnectivityManagerImpl ConnectivityManagerImpl::sInstance;
45
46 CHIP_ERROR ConnectivityManagerImpl::_Init()
47 {
48     CHIP_ERROR err = CHIP_NO_ERROR;
49
50     // Initialize the generic base classes that require it.
51 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
52     GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_Init();
53 #endif
54
55     SuccessOrExit(err);
56
57 exit:
58     return err;
59 }
60
61 void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
62 {
63     // Forward the event to the generic base classes as needed.
64 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
65     GenericConnectivityManagerImpl_Thread<ConnectivityManagerImpl>::_OnPlatformEvent(event);
66 #endif
67 }
68
69 } // namespace DeviceLayer
70 } // namespace chip