blob: 4e2eef9b558df1c90373f87e5eb69c4860e1c999 [file] [log] [blame]
Pankaj Garg73ca9a92020-03-11 16:52:50 -07001/*
2 *
Rob Walkere812e672020-03-31 17:51:57 -07003 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2018 Nest Labs, Inc.
Pankaj Garg73ca9a92020-03-11 16:52:50 -07005 *
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 Litvin1873e8c2020-10-12 10:52:26 -040019#pragma once
Pankaj Garg73ca9a92020-03-11 16:52:50 -070020
Pankaj Garge2ea77d2020-03-13 13:36:13 -070021#include <platform/CHIPDeviceConfig.h>
Martin Turon78026542020-03-17 17:24:59 -070022
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +080023#if !CHIP_DEVICE_LAYER_NONE
24
Zang MingJie53dd5832021-09-03 03:05:16 +080025#include <lib/core/CHIPCore.h>
Pankaj Garge2ea77d2020-03-13 13:36:13 -070026#include <platform/CHIPDeviceError.h>
Pankaj Garge2ea77d2020-03-13 13:36:13 -070027#include <platform/ConfigurationManager.h>
28#include <platform/ConnectivityManager.h>
Rob Walkerc5da1ef2020-05-13 23:31:16 -070029#include <platform/GeneralUtils.h>
Damian Królikd99edbf2021-09-15 08:05:19 +020030#include <platform/KeyValueStoreManager.h>
Rob Walkerc5da1ef2020-05-13 23:31:16 -070031#include <platform/PlatformManager.h>
Song Guofba2fdc2020-11-21 04:08:24 +080032#include <system/SystemClock.h>
Kevin Schoedel3a505012021-09-08 15:21:38 -040033#include <system/SystemLayerImpl.h>
Pankaj Garg73ca9a92020-03-11 16:52:50 -070034#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
Pankaj Garge2ea77d2020-03-13 13:36:13 -070035#include <platform/ThreadStackManager.h>
Pankaj Garg73ca9a92020-03-11 16:52:50 -070036#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD
Damian Królik5d00d1c2021-04-07 03:31:43 +020037#if CHIP_DEVICE_CONFIG_ENABLE_NFC
38#include <platform/NFCManager.h>
39#endif
Pankaj Garg73ca9a92020-03-11 16:52:50 -070040
41namespace chip {
42namespace DeviceLayer {
43
Zang MingJie979f7802021-11-03 05:22:21 +080044void SetSystemLayerForTesting(System::LayerImpl * layer);
Kevin Schoedel86eb0402021-09-10 08:37:38 -040045
Zang MingJie979f7802021-11-03 05:22:21 +080046// These functions are defined in src/platform/Globals.cpp
Zang MingJie979f7802021-11-03 05:22:21 +080047chip::System::Layer & SystemLayer();
Kevin Schoedel86eb0402021-09-10 08:37:38 -040048
49#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
Zang MingJie979f7802021-11-03 05:22:21 +080050chip::System::LayerSockets & SystemLayerSockets();
Kevin Schoedel86eb0402021-09-10 08:37:38 -040051#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS
52
Michael Spang65bea662022-06-21 17:33:51 -040053inline chip::Inet::EndPointManager<Inet::UDPEndPoint> * UDPEndPointManager()
54{
55 return &ConnectivityMgr().UDPEndPointManager();
56}
57
58#if INET_CONFIG_ENABLE_TCP_ENDPOINT
59inline chip::Inet::EndPointManager<Inet::TCPEndPoint> * TCPEndPointManager()
60{
61 return &ConnectivityMgr().TCPEndPointManager();
62}
63#endif
64
Pankaj Garg73ca9a92020-03-11 16:52:50 -070065} // namespace DeviceLayer
66} // namespace chip
Jiacheng Guoe4ac46a2020-11-11 00:04:34 +080067
68#endif // !CHIP_DEVICE_LAYER_NONE