Line data Source code
1 : /*
2 : *
3 : * Copyright (c) 2020 Project CHIP Authors
4 : * Copyright (c) 2018 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 : #pragma once
20 :
21 : #include <platform/CHIPDeviceConfig.h>
22 :
23 : #if !CHIP_DEVICE_LAYER_NONE
24 :
25 : #include <lib/core/CHIPCore.h>
26 : #include <platform/CHIPDeviceError.h>
27 : #include <platform/ConfigurationManager.h>
28 : #include <platform/ConnectivityManager.h>
29 : #include <platform/GeneralUtils.h>
30 : #include <platform/KeyValueStoreManager.h>
31 : #include <platform/PlatformManager.h>
32 : #include <system/SystemClock.h>
33 : #include <system/SystemLayerImpl.h>
34 : #if CHIP_DEVICE_CONFIG_ENABLE_THREAD
35 : #include <platform/ThreadStackManager.h>
36 : #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD
37 : #if CHIP_DEVICE_CONFIG_ENABLE_NFC
38 : #include <platform/NFCManager.h>
39 : #endif
40 :
41 : namespace chip {
42 : namespace DeviceLayer {
43 :
44 : void SetSystemLayerForTesting(System::Layer * layer);
45 :
46 : // These functions are defined in src/platform/Globals.cpp
47 : chip::System::Layer & SystemLayer();
48 :
49 : #if CHIP_SYSTEM_CONFIG_USE_SOCKETS
50 : chip::System::LayerSockets & SystemLayerSockets();
51 : #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
52 :
53 21 : inline chip::Inet::EndPointManager<Inet::UDPEndPoint> * UDPEndPointManager()
54 : {
55 21 : return &ConnectivityMgr().UDPEndPointManager();
56 : }
57 :
58 : #if INET_CONFIG_ENABLE_TCP_ENDPOINT
59 3 : inline chip::Inet::EndPointManager<Inet::TCPEndPoint> * TCPEndPointManager()
60 : {
61 3 : return &ConnectivityMgr().TCPEndPointManager();
62 : }
63 : #endif
64 :
65 : } // namespace DeviceLayer
66 : } // namespace chip
67 :
68 : #endif // !CHIP_DEVICE_LAYER_NONE
|