From c9d105449a61be5adabab92b79fdb34429d9ff69 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 17 Sep 2026 21:24:41 -0700 Subject: [PATCH] [api] remove provisional P2P APIs, CLI commands, and configs (#13600) This commit removes the legacy/provisional Peer-to-Peer (P2P) feature and its associated public APIs, CLI commands, and configurations. Specifically: - Removes provisional public header `include/openthread/provisional/p2p.h` and `provisional/link.h`. - Removes `p2p_api.cpp` and `p2p.h` configuration header. - Removes CLI `p2p` command (`p2p link`, `p2p unlink`) and documentation. - Adds `#error` checks in `openthread-core-config-check.h` for removed P2P configuration defines. --- doc/ot_api_doc.h | 12 -- doc/ot_config_doc.h | 1 - etc/cmake/options.cmake | 2 +- include/openthread/BUILD.gn | 2 - include/openthread/instance.h | 2 +- include/openthread/provisional/link.h | 89 ---------- include/openthread/provisional/p2p.h | 155 ------------------ script/test | 2 - src/cli/README.md | 23 --- src/cli/cli.cpp | 80 --------- src/cli/cli.hpp | 11 -- src/core/BUILD.gn | 2 - src/core/CMakeLists.txt | 1 - src/core/api/p2p_api.cpp | 58 ------- .../config/openthread-core-config-check.h | 8 + src/core/config/p2p.h | 68 -------- src/core/mac/mac_types.hpp | 1 - src/core/openthread-core-config.h | 1 - 18 files changed, 10 insertions(+), 508 deletions(-) delete mode 100644 include/openthread/provisional/link.h delete mode 100644 include/openthread/provisional/p2p.h delete mode 100644 src/core/api/p2p_api.cpp delete mode 100644 src/core/config/p2p.h diff --git a/doc/ot_api_doc.h b/doc/ot_api_doc.h index 86a9768c2..d1e7231d0 100644 --- a/doc/ot_api_doc.h +++ b/doc/ot_api_doc.h @@ -175,18 +175,6 @@ * * @} * - * @defgroup api-provisional Provisional - * @brief - * This module includes the OpenThread provisional APIs. These APIs are not stable and users should use them with - * caution. - * - * @{ - * - * @defgroup api-provisional-link Link - * @defgroup api-provisional-p2p Peer-to-Peer - * - * @} - * * @} */ diff --git a/doc/ot_config_doc.h b/doc/ot_config_doc.h index 88432b31d..7b2fd98d4 100644 --- a/doc/ot_config_doc.h +++ b/doc/ot_config_doc.h @@ -73,7 +73,6 @@ * @defgroup config-nat64 NAT64 * @defgroup config-netdata-publisher Network Data Publisher * @defgroup config-network-diagnostic Network Diagnostics - * @defgroup config-p2p Peer-to-Peer * @defgroup config-parent-search Parent Search * @defgroup config-ping-sender Ping Sender * @defgroup config-platform Platform Specific Services diff --git a/etc/cmake/options.cmake b/etc/cmake/options.cmake index 3c806a5ab..528218576 100644 --- a/etc/cmake/options.cmake +++ b/etc/cmake/options.cmake @@ -242,7 +242,6 @@ ot_option(OT_NETDIAG_CLIENT OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE "Network ot_option(OT_NETDIAG_VENDOR_INFO OPENTHREAD_CONFIG_NET_DIAG_VENDOR_INFO_SET_API_ENABLE "Allow setting vendor info at runtime") ot_option(OT_OPERATIONAL_DATASET_AUTO_INIT OPENTHREAD_CONFIG_OPERATIONAL_DATASET_AUTO_INIT "operational dataset auto init") ot_option(OT_OTNS OPENTHREAD_CONFIG_OTNS_ENABLE "OTNS") -ot_option(OT_P2P OPENTHREAD_CONFIG_P2P_ENABLE "peer to peer") ot_option(OT_PING_SENDER OPENTHREAD_CONFIG_PING_SENDER_ENABLE "ping sender" ${OT_APP_CLI}) ot_option(OT_PLATFORM_BOOTLOADER_MODE OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE "platform bootloader mode") ot_option(OT_PLATFORM_DNSSD OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE "platform dnssd") @@ -402,3 +401,4 @@ ot_removed_option(OT_EXCLUDE_TCPLP_LIB "- Use OT_TCP instead, OT_EXCLUDE_TCPLP_L ot_removed_option(OT_POSIX_CONFIG_RCP_BUS "- Use OT_POSIX_RCP_HDLC_BUS, OT_POSIX_RCP_SPI_BUS or OT_POSIX_RCP_VENDOR_BUS instead, OT_POSIX_CONFIG_RCP_BUS is deprecated") ot_removed_option(OT_WAKEUP_COORDINATOR "- Use OT_WAKE_INITIATOR instead") ot_removed_option(OT_WAKEUP_END_DEVICE "- Use OT_WAKE_LISTENER instead") +ot_removed_option(OT_P2P "- OT_P2P was removed (legacy thread-in-mobile)") diff --git a/include/openthread/BUILD.gn b/include/openthread/BUILD.gn index 528ef5fa3..245ec74ae 100644 --- a/include/openthread/BUILD.gn +++ b/include/openthread/BUILD.gn @@ -117,8 +117,6 @@ source_set("openthread") { "platform/toolchain.h", "platform/trel.h", "platform/udp.h", - "provisional/link.h", - "provisional/p2p.h", "radio_stats.h", "random_crypto.h", "random_noncrypto.h", diff --git a/include/openthread/instance.h b/include/openthread/instance.h index edff8f034..604ed7484 100644 --- a/include/openthread/instance.h +++ b/include/openthread/instance.h @@ -52,7 +52,7 @@ extern "C" { * * @note This number versions both OpenThread platform and user APIs. */ -#define OPENTHREAD_API_VERSION (622) +#define OPENTHREAD_API_VERSION (623) /** * @addtogroup api-instance diff --git a/include/openthread/provisional/link.h b/include/openthread/provisional/link.h deleted file mode 100644 index a55dd726b..000000000 --- a/include/openthread/provisional/link.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2025, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * @brief - * This file defines the OpenThread provisional IEEE 802.15.4 Link Layer API. - */ -#ifndef OPENTHREAD_PROVISIONAL_LINK_H_ -#define OPENTHREAD_PROVISIONAL_LINK_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @addtogroup api-provisional-link - * - * @brief - * This module includes provisional functions that control link-layer configuration. - * - * @{ - */ - -/** - * Represents the wake-up identifier. - */ -typedef uint64_t otWakeupId; - -/** - * Represents the wake-up request type. - */ -typedef enum otWakeupType -{ - OT_WAKEUP_TYPE_EXT_ADDRESS = 0, ///< Wake up the peer by the extended address. - OT_WAKEUP_TYPE_IDENTIFIER = 1, ///< Wake up the peer by the wake-up identifier. - OT_WAKEUP_TYPE_GROUP_IDENTIFIER = 2, ///< Wake up peers by the group wake-up identifier. -} otWakeupType; - -/** - * Represents the request to wake up the peer. - */ -typedef struct otWakeupRequest -{ - union - { - otWakeupId mWakeupId; ///< Wake-up identifier of the Wake-up Listener. - otExtAddress mExtAddress; ///< IEEE 802.15.4 Extended Address of the Wake-up Listener. - } mShared; - - otWakeupType mType; ///< Indicates the wake-up request type (`OT_WAKEUP_TYPE_*` enumeration). -} otWakeupRequest; - -/** - * @} - */ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // OPENTHREAD_PROVISIONAL_LINK_H_ diff --git a/include/openthread/provisional/p2p.h b/include/openthread/provisional/p2p.h deleted file mode 100644 index 53a5bbc14..000000000 --- a/include/openthread/provisional/p2p.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2025, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * @brief - * This file defines the OpenThread provisional P2P (peer-to-peer) API. - */ - -#ifndef OPENTHREAD_PROVISIONAL_P2P_H_ -#define OPENTHREAD_PROVISIONAL_P2P_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @addtogroup api-provisional-p2p - * - * @brief - * This module includes provisional functions for the Thread P2P link. - * - * @note - * The functions in this module require `OPENTHREAD_CONFIG_P2P_ENABLE=1`. - * - * @{ - */ - -/** - * Represents a request for establishing P2P links. - */ -typedef struct otP2pRequest -{ - otWakeupRequest mWakeupRequest; ///< Wake-up request. -} otP2pRequest; - -/** - * Notifies the caller that the P2P link establishment process has ended. - * - * @param[in] aContext A pointer to the application-specific context. - */ -typedef void (*otP2pLinkDoneCallback)(void *aContext); - -/** - * Attempts to wake up peers and establish P2P links with peers. - * - * If the @p aP2pRequest indicates a group wake-up, this method establishes multiple P2P links with peers. - * Otherwise, it establishes at most one P2P link. - * - * @param[in] aInstance The OpenThread instance. - * @param[in] aP2pRequest A pointer to P2P request. - * @param[in] aCallback A pointer to the function that is called when the P2P link establishment process ends . - * @param[in] aContext A pointer to the callback application-specific context. - * - * @retval OT_ERROR_NONE Successfully started to establish P2P links. - * @retval OT_ERROR_BUSY Establishing a P2P link was in progress. - * @retval OT_ERROR_INVALID_STATE Device was disabled or not fully configured. - * @retval OT_ERROR_NO_BUFS Insufficient buffer space to establish a P2P link. - */ -otError otP2pWakeupAndLink(otInstance *aInstance, - const otP2pRequest *aP2pRequest, - otP2pLinkDoneCallback aCallback, - void *aContext); - -/** - * Notifies the caller that the P2P link tear down process has ended. - * - * @param[in] aContext A pointer to application-specific context. - */ -typedef void (*otP2pUnlinkDoneCallback)(void *aContext); - -/** - * Tears down the P2P link specified by the Extended Address. - * - * @param[in] aInstance The OpenThread instance. - * @param[in] aExtAddress A pointer to the P2P peer's Extended Address. - * @param[in] aCallback A pointer to function that is called when the P2P link tear down process has ended. - * @param[in] aContext A pointer to callback application-specific context. - * - * @retval OT_ERROR_NONE Successfully started to tear down the P2P link. - * @retval OT_ERROR_BUSY Tearing down or establishing a P2P link process is in progress. - * @retval OT_ERROR_NOT_FOUND The P2P link identified by the @p aExtAddress was not found. - */ -otError otP2pUnlink(otInstance *aInstance, - const otExtAddress *aExtAddress, - otP2pUnlinkDoneCallback aCallback, - void *aContext); - -/** - * Defines events of the P2P link. - */ -typedef enum otP2pEvent -{ - OT_P2P_EVENT_LINKED = 0, ///< The P2P link has been established. - OT_P2P_EVENT_UNLINKED = 1, ///< The P2P link has been torn down. -} otP2pEvent; - -/** - * Callback function pointer to signal events of the P2P link. - * - * @param[in] aEvent The P2P link event. - * @param[in] aExtAddress A pointer to the peer's Extended Address of the P2P link. - * @param[in] aContext A pointer to the application-specific context. - */ -typedef void (*otP2pEventCallback)(otP2pEvent aEvent, const otExtAddress *aExtAddress, void *aContext); - -/** - * Sets the callback function to notify event changes of P2P links. - * - * A subsequent call to this function will replace any previously set callback. - * - * @param[in] aInstance The OpenThread instance. - * @param[in] aCallback The callback function pointer. - * @param[in] aContext A pointer to the callback application-specific context. - */ -void otP2pSetEventCallback(otInstance *aInstance, otP2pEventCallback aCallback, void *aContext); - -/** - * @} - */ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // OPENTHREAD_PROVISIONAL_P2P_H_ diff --git a/script/test b/script/test index 3b153b1da..4289aea3e 100755 --- a/script/test +++ b/script/test @@ -137,7 +137,6 @@ build_simulation() options+=("-DOT_LINK_METRICS_INITIATOR=ON") options+=("-DOT_LINK_METRICS_SUBJECT=ON") options+=("-DOT_LINK_METRICS_MANAGER=ON") - options+=("-DOT_P2P=ON") options+=("-DOT_WAKE_INITIATOR=ON") options+=("-DOT_WAKE_LISTENER=ON") fi @@ -187,7 +186,6 @@ build_posix() options+=("-DOT_LINK_METRICS_INITIATOR=ON") options+=("-DOT_LINK_METRICS_SUBJECT=ON") options+=("-DOT_LINK_METRICS_MANAGER=ON") - options+=("-DOT_P2P=ON") options+=("-DOT_WAKE_INITIATOR=ON") options+=("-DOT_WAKE_LISTENER=ON") fi diff --git a/src/cli/README.md b/src/cli/README.md index a96cf2b6d..91d949172 100644 --- a/src/cli/README.md +++ b/src/cli/README.md @@ -89,7 +89,6 @@ Done - [networkname](#networkname) - [networktime](#networktime) - [nexthop](#nexthop) -- [p2p](#p2p-link-extaddr-extaddr) - [panid](#panid) - [parent](#parent) - [parentpriority](#parentpriority) @@ -3304,28 +3303,6 @@ nexthop 0x8001 Done ``` -### p2p link extaddr \ - -Wakes up the peer identified by the extended address and establishes a peer-to-peer link with the peer. - -`OPENTHREAD_CONFIG_P2P_ENABLE` and `OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` are required. - -```bash -> p2p link extaddr dead00beef00cafe -Done -``` - -### p2p unlink \ - -Tears down the P2P link identified by the extended address. - -`OPENTHREAD_CONFIG_P2P_ENABLE` is required. - -```bash -> p2p unlink dead00beef00cafe -Done -``` - ### panid Get the IEEE 802.15.4 PAN ID value. diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 771e643b1..6ed5a5991 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -8218,83 +8218,6 @@ exit: #endif // OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE -#if OPENTHREAD_CONFIG_P2P_ENABLE -template <> otError Interpreter::Process(Arg aArgs[]) -{ - otError error = OT_ERROR_NONE; - - if (aArgs[0] == "unlink") - { - otExtAddress extAddress; - - /** - * @cli p2p unlink - * @code - * p2p unlink dead00beef00cafe - * Done - * @endcode - * @cparam p2p unlink @ca{extended-address} - * @par - * `OPENTHREAD_CONFIG_P2P_ENABLE` is required. - * @par - * Tears down the P2P link identified by the extended address. - */ - SuccessOrExit(error = aArgs[1].ParseAsHexString(extAddress.m8)); - SuccessOrExit(error = otP2pUnlink(GetInstancePtr(), &extAddress, HandleP2pUnlinkDone, this)); - error = OT_ERROR_PENDING; - } -#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE - else if (aArgs[0] == "link") - { - otP2pRequest p2pRequest; - - /** - * @cli p2p link - * @code - * p2p link extaddr dead00beef00cafe - * Done - * @endcode - * @cparam p2p link extaddr @ca{extended-address} - * @par - * `OPENTHREAD_CONFIG_P2P_ENABLE` and `OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` are required. - * @par - * Wakes up the Wake-up Listener identified by the extended address and establishes a peer-to-peer link with the - * peer. - */ - if (aArgs[1] == "extaddr") - { - SuccessOrExit(error = aArgs[2].ParseAsHexString(p2pRequest.mWakeupRequest.mShared.mExtAddress.m8)); - p2pRequest.mWakeupRequest.mType = OT_WAKEUP_TYPE_EXT_ADDRESS; - } - else - { - ExitNow(error = OT_ERROR_INVALID_ARGS); - } - - SuccessOrExit(error = otP2pWakeupAndLink(GetInstancePtr(), &p2pRequest, HandleP2pLinkDone, this)); - error = OT_ERROR_PENDING; - } -#endif - else - { - error = OT_ERROR_INVALID_ARGS; - } - -exit: - return error; -} - -#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE -void Interpreter::HandleP2pLinkDone(void *aContext) { static_cast(aContext)->HandleP2pLinkDone(); } - -void Interpreter::HandleP2pLinkDone(void) { OutputResult(OT_ERROR_NONE); } -#endif - -void Interpreter::HandleP2pUnlinkDone(void *aContext) { static_cast(aContext)->HandleP2pUnlinkDone(); } - -void Interpreter::HandleP2pUnlinkDone(void) { OutputResult(OT_ERROR_NONE); } -#endif // OPENTHREAD_CONFIG_P2P_ENABLE - #if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE template <> otError Interpreter::Process(Arg aArgs[]) { @@ -8686,9 +8609,6 @@ otError Interpreter::ProcessCommand(Arg aArgs[]) #endif #if OPENTHREAD_FTD CmdEntry("nexthop"), -#endif -#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE - CmdEntry("p2p"), #endif CmdEntry("panid"), CmdEntry("parent"), diff --git a/src/cli/cli.hpp b/src/cli/cli.hpp index 9ebcb081c..2d7fcb27d 100644 --- a/src/cli/cli.hpp +++ b/src/cli/cli.hpp @@ -55,7 +55,6 @@ #include #include #include -#include #include "cli/cli_ba.hpp" #include "cli/cli_bbr.hpp" @@ -366,16 +365,6 @@ private: static void HandleIp6Receive(otMessage *aMessage, void *aContext); #endif -#if OPENTHREAD_CONFIG_P2P_ENABLE -#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE - static void HandleP2pLinkDone(void *aContext); - void HandleP2pLinkDone(void); -#endif - - static void HandleP2pUnlinkDone(void *aContext); - void HandleP2pUnlinkDone(void); -#endif - #if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE static void HandleWakeupResult(otError aError, void *aContext); void HandleWakeupResult(otError aError); diff --git a/src/core/BUILD.gn b/src/core/BUILD.gn index 2abf9e041..4d40cad76 100644 --- a/src/core/BUILD.gn +++ b/src/core/BUILD.gn @@ -362,7 +362,6 @@ openthread_core_files = [ "api/netdata_publisher_api.cpp", "api/netdiag_api.cpp", "api/network_time_api.cpp", - "api/p2p_api.cpp", "api/ping_sender_api.cpp", "api/radio_stats_api.cpp", "api/random_crypto_api.cpp", @@ -911,7 +910,6 @@ source_set("libopenthread_core_config") { "config/net_diag.h", "config/netdata_publisher.h", "config/openthread-core-config-check.h", - "config/p2p.h", "config/parent_search.h", "config/ping_sender.h", "config/platform.h", diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 3a7e6db30..de41ceb78 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -76,7 +76,6 @@ set(COMMON_SOURCES api/netdata_publisher_api.cpp api/netdiag_api.cpp api/network_time_api.cpp - api/p2p_api.cpp api/ping_sender_api.cpp api/radio_stats_api.cpp api/random_crypto_api.cpp diff --git a/src/core/api/p2p_api.cpp b/src/core/api/p2p_api.cpp deleted file mode 100644 index 77082a22e..000000000 --- a/src/core/api/p2p_api.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2025, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread Peer-to-Peer API. - */ - -#include "openthread-core-config.h" - -#if OPENTHREAD_CONFIG_P2P_ENABLE - -#include - -#include "instance/instance.hpp" - -using namespace ot; - -#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE -otError otP2pWakeupAndLink(otInstance *, const otP2pRequest *, otP2pLinkDoneCallback, void *) -{ - return kErrorNotImplemented; -} -#endif - -void otP2pSetEventCallback(otInstance *, otP2pEventCallback, void *) {} - -otError otP2pUnlink(otInstance *, const otExtAddress *, otP2pUnlinkDoneCallback, void *) -{ - return kErrorNotImplemented; -} - -#endif // OPENTHREAD_CONFIG_P2P_ENABLE diff --git a/src/core/config/openthread-core-config-check.h b/src/core/config/openthread-core-config-check.h index 85ae3622d..0e7077668 100644 --- a/src/core/config/openthread-core-config-check.h +++ b/src/core/config/openthread-core-config-check.h @@ -752,4 +752,12 @@ #error "OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE was removed (legacy thread-in-mobile)" #endif +#ifdef OPENTHREAD_CONFIG_P2P_ENABLE +#error "OPENTHREAD_CONFIG_P2P_ENABLE was removed (legacy thread-in-mobile)" +#endif + +#ifdef OPENTHREAD_CONFIG_P2P_MAX_PEERS +#error "OPENTHREAD_CONFIG_P2P_MAX_PEERS was removed (legacy thread-in-mobile)" +#endif + #endif // OT_CORE_CONFIG_OPENTHREAD_CORE_CONFIG_CHECK_H_ diff --git a/src/core/config/p2p.h b/src/core/config/p2p.h deleted file mode 100644 index d043417ba..000000000 --- a/src/core/config/p2p.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes compile-time configurations for the peer-to-peer (P2P). - */ - -#ifndef OT_CORE_CONFIG_P2P_H_ -#define OT_CORE_CONFIG_P2P_H_ - -/** - * @addtogroup config-p2p - * - * @brief - * This module includes configuration variables for the peer-to-peer (P2P). - * - * @{ - */ - -/** - * @def OPENTHREAD_CONFIG_P2P_ENABLE - * - * Define to 1 to enable the P2P feature. - */ -#ifndef OPENTHREAD_CONFIG_P2P_ENABLE -#define OPENTHREAD_CONFIG_P2P_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_P2P_MAX_PEERS - * - * The maximum number of P2P peers. - */ -#ifndef OPENTHREAD_CONFIG_P2P_MAX_PEERS -#define OPENTHREAD_CONFIG_P2P_MAX_PEERS 10 -#endif - -/** - * @} - */ - -#endif // OT_CORE_CONFIG_P2P_H_ diff --git a/src/core/mac/mac_types.hpp b/src/core/mac/mac_types.hpp index 99afd5b49..49af9c691 100644 --- a/src/core/mac/mac_types.hpp +++ b/src/core/mac/mac_types.hpp @@ -41,7 +41,6 @@ #include #include -#include #include "common/as_core_type.hpp" #include "common/clearable.hpp" diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h index 576bfe01b..ee8414e18 100644 --- a/src/core/openthread-core-config.h +++ b/src/core/openthread-core-config.h @@ -99,7 +99,6 @@ #include "config/nat64.h" #include "config/net_diag.h" #include "config/netdata_publisher.h" -#include "config/p2p.h" #include "config/parent_search.h" #include "config/ping_sender.h" #include "config/platform.h"