Pankaj Garg | 73ca9a9 | 2020-03-11 16:52:50 -0700 | [diff] [blame] | 1 | /* |
| 2 | * |
Rob Walker | e812e67 | 2020-03-31 17:51:57 -0700 | [diff] [blame] | 3 | * Copyright (c) 2020 Project CHIP Authors |
| 4 | * Copyright (c) 2018 Nest Labs, Inc. |
Pankaj Garg | 73ca9a9 | 2020-03-11 16:52:50 -0700 | [diff] [blame] | 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 | |
Andrei Litvin | 1873e8c | 2020-10-12 10:52:26 -0400 | [diff] [blame] | 19 | #pragma once |
Pankaj Garg | 73ca9a9 | 2020-03-11 16:52:50 -0700 | [diff] [blame] | 20 | |
Pankaj Garg | e2ea77d | 2020-03-13 13:36:13 -0700 | [diff] [blame] | 21 | #include <platform/CHIPDeviceConfig.h> |
Martin Turon | 7802654 | 2020-03-17 17:24:59 -0700 | [diff] [blame] | 22 | |
Jiacheng Guo | e4ac46a | 2020-11-11 00:04:34 +0800 | [diff] [blame] | 23 | #if !CHIP_DEVICE_LAYER_NONE |
| 24 | |
Zang MingJie | 53dd583 | 2021-09-03 03:05:16 +0800 | [diff] [blame] | 25 | #include <lib/core/CHIPCore.h> |
Pankaj Garg | e2ea77d | 2020-03-13 13:36:13 -0700 | [diff] [blame] | 26 | #include <platform/CHIPDeviceError.h> |
Pankaj Garg | e2ea77d | 2020-03-13 13:36:13 -0700 | [diff] [blame] | 27 | #include <platform/ConfigurationManager.h> |
| 28 | #include <platform/ConnectivityManager.h> |
Rob Walker | c5da1ef | 2020-05-13 23:31:16 -0700 | [diff] [blame] | 29 | #include <platform/GeneralUtils.h> |
Damian Królik | d99edbf | 2021-09-15 08:05:19 +0200 | [diff] [blame] | 30 | #include <platform/KeyValueStoreManager.h> |
Rob Walker | c5da1ef | 2020-05-13 23:31:16 -0700 | [diff] [blame] | 31 | #include <platform/PlatformManager.h> |
Song Guo | fba2fdc | 2020-11-21 04:08:24 +0800 | [diff] [blame] | 32 | #include <system/SystemClock.h> |
Kevin Schoedel | 3a50501 | 2021-09-08 15:21:38 -0400 | [diff] [blame] | 33 | #include <system/SystemLayerImpl.h> |
Pankaj Garg | 73ca9a9 | 2020-03-11 16:52:50 -0700 | [diff] [blame] | 34 | #if CHIP_DEVICE_CONFIG_ENABLE_THREAD |
Pankaj Garg | e2ea77d | 2020-03-13 13:36:13 -0700 | [diff] [blame] | 35 | #include <platform/ThreadStackManager.h> |
Pankaj Garg | 73ca9a9 | 2020-03-11 16:52:50 -0700 | [diff] [blame] | 36 | #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD |
Damian Królik | 5d00d1c | 2021-04-07 03:31:43 +0200 | [diff] [blame] | 37 | #if CHIP_DEVICE_CONFIG_ENABLE_NFC |
| 38 | #include <platform/NFCManager.h> |
| 39 | #endif |
Pankaj Garg | 73ca9a9 | 2020-03-11 16:52:50 -0700 | [diff] [blame] | 40 | |
| 41 | namespace chip { |
| 42 | namespace DeviceLayer { |
| 43 | |
Zang MingJie | 979f780 | 2021-11-03 05:22:21 +0800 | [diff] [blame] | 44 | void SetSystemLayerForTesting(System::LayerImpl * layer); |
Kevin Schoedel | 86eb040 | 2021-09-10 08:37:38 -0400 | [diff] [blame] | 45 | |
Zang MingJie | 979f780 | 2021-11-03 05:22:21 +0800 | [diff] [blame] | 46 | // These functions are defined in src/platform/Globals.cpp |
Zang MingJie | 979f780 | 2021-11-03 05:22:21 +0800 | [diff] [blame] | 47 | chip::System::Layer & SystemLayer(); |
Kevin Schoedel | 86eb040 | 2021-09-10 08:37:38 -0400 | [diff] [blame] | 48 | |
| 49 | #if CHIP_SYSTEM_CONFIG_USE_SOCKETS |
Zang MingJie | 979f780 | 2021-11-03 05:22:21 +0800 | [diff] [blame] | 50 | chip::System::LayerSockets & SystemLayerSockets(); |
Kevin Schoedel | 86eb040 | 2021-09-10 08:37:38 -0400 | [diff] [blame] | 51 | #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS |
| 52 | |
Michael Spang | 65bea66 | 2022-06-21 17:33:51 -0400 | [diff] [blame] | 53 | inline chip::Inet::EndPointManager<Inet::UDPEndPoint> * UDPEndPointManager() |
| 54 | { |
| 55 | return &ConnectivityMgr().UDPEndPointManager(); |
| 56 | } |
| 57 | |
| 58 | #if INET_CONFIG_ENABLE_TCP_ENDPOINT |
| 59 | inline chip::Inet::EndPointManager<Inet::TCPEndPoint> * TCPEndPointManager() |
| 60 | { |
| 61 | return &ConnectivityMgr().TCPEndPointManager(); |
| 62 | } |
| 63 | #endif |
| 64 | |
Pankaj Garg | 73ca9a9 | 2020-03-11 16:52:50 -0700 | [diff] [blame] | 65 | } // namespace DeviceLayer |
| 66 | } // namespace chip |
Jiacheng Guo | e4ac46a | 2020-11-11 00:04:34 +0800 | [diff] [blame] | 67 | |
| 68 | #endif // !CHIP_DEVICE_LAYER_NONE |