mirror of
https://github.com/espressif/openthread.git
synced 2026-09-27 11:27:36 +00:00
[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.
This commit is contained in:
@@ -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
|
|
||||||
*
|
|
||||||
* @}
|
|
||||||
*
|
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,6 @@
|
|||||||
* @defgroup config-nat64 NAT64
|
* @defgroup config-nat64 NAT64
|
||||||
* @defgroup config-netdata-publisher Network Data Publisher
|
* @defgroup config-netdata-publisher Network Data Publisher
|
||||||
* @defgroup config-network-diagnostic Network Diagnostics
|
* @defgroup config-network-diagnostic Network Diagnostics
|
||||||
* @defgroup config-p2p Peer-to-Peer
|
|
||||||
* @defgroup config-parent-search Parent Search
|
* @defgroup config-parent-search Parent Search
|
||||||
* @defgroup config-ping-sender Ping Sender
|
* @defgroup config-ping-sender Ping Sender
|
||||||
* @defgroup config-platform Platform Specific Services
|
* @defgroup config-platform Platform Specific Services
|
||||||
|
|||||||
@@ -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_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_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_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_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_BOOTLOADER_MODE OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE "platform bootloader mode")
|
||||||
ot_option(OT_PLATFORM_DNSSD OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE "platform dnssd")
|
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_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_COORDINATOR "- Use OT_WAKE_INITIATOR instead")
|
||||||
ot_removed_option(OT_WAKEUP_END_DEVICE "- Use OT_WAKE_LISTENER 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)")
|
||||||
|
|||||||
@@ -117,8 +117,6 @@ source_set("openthread") {
|
|||||||
"platform/toolchain.h",
|
"platform/toolchain.h",
|
||||||
"platform/trel.h",
|
"platform/trel.h",
|
||||||
"platform/udp.h",
|
"platform/udp.h",
|
||||||
"provisional/link.h",
|
|
||||||
"provisional/p2p.h",
|
|
||||||
"radio_stats.h",
|
"radio_stats.h",
|
||||||
"random_crypto.h",
|
"random_crypto.h",
|
||||||
"random_noncrypto.h",
|
"random_noncrypto.h",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* @note This number versions both OpenThread platform and user APIs.
|
* @note This number versions both OpenThread platform and user APIs.
|
||||||
*/
|
*/
|
||||||
#define OPENTHREAD_API_VERSION (622)
|
#define OPENTHREAD_API_VERSION (623)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup api-instance
|
* @addtogroup api-instance
|
||||||
|
|||||||
@@ -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 <openthread/link.h>
|
|
||||||
#include <openthread/platform/radio.h>
|
|
||||||
|
|
||||||
#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_
|
|
||||||
@@ -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 <openthread/error.h>
|
|
||||||
#include <openthread/instance.h>
|
|
||||||
#include <openthread/platform/radio.h>
|
|
||||||
#include <openthread/provisional/link.h>
|
|
||||||
|
|
||||||
#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_
|
|
||||||
@@ -137,7 +137,6 @@ build_simulation()
|
|||||||
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
|
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
|
||||||
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
|
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
|
||||||
options+=("-DOT_LINK_METRICS_MANAGER=ON")
|
options+=("-DOT_LINK_METRICS_MANAGER=ON")
|
||||||
options+=("-DOT_P2P=ON")
|
|
||||||
options+=("-DOT_WAKE_INITIATOR=ON")
|
options+=("-DOT_WAKE_INITIATOR=ON")
|
||||||
options+=("-DOT_WAKE_LISTENER=ON")
|
options+=("-DOT_WAKE_LISTENER=ON")
|
||||||
fi
|
fi
|
||||||
@@ -187,7 +186,6 @@ build_posix()
|
|||||||
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
|
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
|
||||||
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
|
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
|
||||||
options+=("-DOT_LINK_METRICS_MANAGER=ON")
|
options+=("-DOT_LINK_METRICS_MANAGER=ON")
|
||||||
options+=("-DOT_P2P=ON")
|
|
||||||
options+=("-DOT_WAKE_INITIATOR=ON")
|
options+=("-DOT_WAKE_INITIATOR=ON")
|
||||||
options+=("-DOT_WAKE_LISTENER=ON")
|
options+=("-DOT_WAKE_LISTENER=ON")
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ Done
|
|||||||
- [networkname](#networkname)
|
- [networkname](#networkname)
|
||||||
- [networktime](#networktime)
|
- [networktime](#networktime)
|
||||||
- [nexthop](#nexthop)
|
- [nexthop](#nexthop)
|
||||||
- [p2p](#p2p-link-extaddr-extaddr)
|
|
||||||
- [panid](#panid)
|
- [panid](#panid)
|
||||||
- [parent](#parent)
|
- [parent](#parent)
|
||||||
- [parentpriority](#parentpriority)
|
- [parentpriority](#parentpriority)
|
||||||
@@ -3304,28 +3303,6 @@ nexthop 0x8001
|
|||||||
Done
|
Done
|
||||||
```
|
```
|
||||||
|
|
||||||
### p2p link extaddr \<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 \<extaddress\>
|
|
||||||
|
|
||||||
Tears down the P2P link identified by the extended address.
|
|
||||||
|
|
||||||
`OPENTHREAD_CONFIG_P2P_ENABLE` is required.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
> p2p unlink dead00beef00cafe
|
|
||||||
Done
|
|
||||||
```
|
|
||||||
|
|
||||||
### panid
|
### panid
|
||||||
|
|
||||||
Get the IEEE 802.15.4 PAN ID value.
|
Get the IEEE 802.15.4 PAN ID value.
|
||||||
|
|||||||
@@ -8218,83 +8218,6 @@ exit:
|
|||||||
|
|
||||||
#endif // OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE
|
#endif // OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE
|
||||||
|
|
||||||
#if OPENTHREAD_CONFIG_P2P_ENABLE
|
|
||||||
template <> otError Interpreter::Process<Cmd("p2p")>(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<Interpreter *>(aContext)->HandleP2pLinkDone(); }
|
|
||||||
|
|
||||||
void Interpreter::HandleP2pLinkDone(void) { OutputResult(OT_ERROR_NONE); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void Interpreter::HandleP2pUnlinkDone(void *aContext) { static_cast<Interpreter *>(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
|
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||||
template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
|
template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
|
||||||
{
|
{
|
||||||
@@ -8686,9 +8609,6 @@ otError Interpreter::ProcessCommand(Arg aArgs[])
|
|||||||
#endif
|
#endif
|
||||||
#if OPENTHREAD_FTD
|
#if OPENTHREAD_FTD
|
||||||
CmdEntry("nexthop"),
|
CmdEntry("nexthop"),
|
||||||
#endif
|
|
||||||
#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
|
||||||
CmdEntry("p2p"),
|
|
||||||
#endif
|
#endif
|
||||||
CmdEntry("panid"),
|
CmdEntry("panid"),
|
||||||
CmdEntry("parent"),
|
CmdEntry("parent"),
|
||||||
|
|||||||
@@ -55,7 +55,6 @@
|
|||||||
#include <openthread/thread.h>
|
#include <openthread/thread.h>
|
||||||
#include <openthread/thread_ftd.h>
|
#include <openthread/thread_ftd.h>
|
||||||
#include <openthread/udp.h>
|
#include <openthread/udp.h>
|
||||||
#include <openthread/provisional/p2p.h>
|
|
||||||
|
|
||||||
#include "cli/cli_ba.hpp"
|
#include "cli/cli_ba.hpp"
|
||||||
#include "cli/cli_bbr.hpp"
|
#include "cli/cli_bbr.hpp"
|
||||||
@@ -366,16 +365,6 @@ private:
|
|||||||
static void HandleIp6Receive(otMessage *aMessage, void *aContext);
|
static void HandleIp6Receive(otMessage *aMessage, void *aContext);
|
||||||
#endif
|
#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
|
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||||
static void HandleWakeupResult(otError aError, void *aContext);
|
static void HandleWakeupResult(otError aError, void *aContext);
|
||||||
void HandleWakeupResult(otError aError);
|
void HandleWakeupResult(otError aError);
|
||||||
|
|||||||
@@ -362,7 +362,6 @@ openthread_core_files = [
|
|||||||
"api/netdata_publisher_api.cpp",
|
"api/netdata_publisher_api.cpp",
|
||||||
"api/netdiag_api.cpp",
|
"api/netdiag_api.cpp",
|
||||||
"api/network_time_api.cpp",
|
"api/network_time_api.cpp",
|
||||||
"api/p2p_api.cpp",
|
|
||||||
"api/ping_sender_api.cpp",
|
"api/ping_sender_api.cpp",
|
||||||
"api/radio_stats_api.cpp",
|
"api/radio_stats_api.cpp",
|
||||||
"api/random_crypto_api.cpp",
|
"api/random_crypto_api.cpp",
|
||||||
@@ -911,7 +910,6 @@ source_set("libopenthread_core_config") {
|
|||||||
"config/net_diag.h",
|
"config/net_diag.h",
|
||||||
"config/netdata_publisher.h",
|
"config/netdata_publisher.h",
|
||||||
"config/openthread-core-config-check.h",
|
"config/openthread-core-config-check.h",
|
||||||
"config/p2p.h",
|
|
||||||
"config/parent_search.h",
|
"config/parent_search.h",
|
||||||
"config/ping_sender.h",
|
"config/ping_sender.h",
|
||||||
"config/platform.h",
|
"config/platform.h",
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ set(COMMON_SOURCES
|
|||||||
api/netdata_publisher_api.cpp
|
api/netdata_publisher_api.cpp
|
||||||
api/netdiag_api.cpp
|
api/netdiag_api.cpp
|
||||||
api/network_time_api.cpp
|
api/network_time_api.cpp
|
||||||
api/p2p_api.cpp
|
|
||||||
api/ping_sender_api.cpp
|
api/ping_sender_api.cpp
|
||||||
api/radio_stats_api.cpp
|
api/radio_stats_api.cpp
|
||||||
api/random_crypto_api.cpp
|
api/random_crypto_api.cpp
|
||||||
|
|||||||
@@ -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 <openthread/provisional/p2p.h>
|
|
||||||
|
|
||||||
#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
|
|
||||||
@@ -752,4 +752,12 @@
|
|||||||
#error "OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE was removed (legacy thread-in-mobile)"
|
#error "OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE was removed (legacy thread-in-mobile)"
|
||||||
#endif
|
#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_
|
#endif // OT_CORE_CONFIG_OPENTHREAD_CORE_CONFIG_CHECK_H_
|
||||||
|
|||||||
@@ -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_
|
|
||||||
@@ -41,7 +41,6 @@
|
|||||||
|
|
||||||
#include <openthread/link.h>
|
#include <openthread/link.h>
|
||||||
#include <openthread/thread.h>
|
#include <openthread/thread.h>
|
||||||
#include <openthread/provisional/link.h>
|
|
||||||
|
|
||||||
#include "common/as_core_type.hpp"
|
#include "common/as_core_type.hpp"
|
||||||
#include "common/clearable.hpp"
|
#include "common/clearable.hpp"
|
||||||
|
|||||||
@@ -99,7 +99,6 @@
|
|||||||
#include "config/nat64.h"
|
#include "config/nat64.h"
|
||||||
#include "config/net_diag.h"
|
#include "config/net_diag.h"
|
||||||
#include "config/netdata_publisher.h"
|
#include "config/netdata_publisher.h"
|
||||||
#include "config/p2p.h"
|
|
||||||
#include "config/parent_search.h"
|
#include "config/parent_search.h"
|
||||||
#include "config/ping_sender.h"
|
#include "config/ping_sender.h"
|
||||||
#include "config/platform.h"
|
#include "config/platform.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user