Skip to content

Commit a4ba8ae

Browse files
committed
[thread-direct] remove legacy peer-to-peer (P2P) implementation
The P2P feature was a provisional mechanism for peer-to-peer link establishment via MLE. It is superseded by Thread Direct, which implements the same use case through a MAC-layer handshake defined in the Thread specification. This commit removes all P2P code and configuration. - `include/openthread/provisional/link.h` is retained; it defines the shared wakeup types (`otWakeupId`, `otWakeupType`, `otWakeupRequest`) used by the MAC layer independently of P2P. This will be cleaned up further later. - `otThreadWakeup` returns `OT_ERROR_NOT_IMPLEMENTED` in this intermediate state pending the scheduler moving off Mle.
1 parent 252918b commit a4ba8ae

30 files changed

Lines changed: 39 additions & 2057 deletions

doc/ot_api_doc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@
183183
* @{
184184
*
185185
* @defgroup api-provisional-link Link
186-
* @defgroup api-provisional-p2p Peer-to-Peer
187186
*
188187
* @}
189188
*

doc/ot_config_doc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
* @defgroup config-nat64 NAT64
7474
* @defgroup config-netdata-publisher Network Data Publisher
7575
* @defgroup config-network-diagnostic Network Diagnostics
76-
* @defgroup config-p2p Peer-to-Peer
7776
* @defgroup config-parent-search Parent Search
7877
* @defgroup config-ping-sender Ping Sender
7978
* @defgroup config-platform Platform Specific Services

etc/cmake/options.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ ot_option(OT_NETDIAG_CLIENT OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE "Network
242242
ot_option(OT_NETDIAG_VENDOR_INFO OPENTHREAD_CONFIG_NET_DIAG_VENDOR_INFO_SET_API_ENABLE "Allow setting vendor info at runtime")
243243
ot_option(OT_OPERATIONAL_DATASET_AUTO_INIT OPENTHREAD_CONFIG_OPERATIONAL_DATASET_AUTO_INIT "operational dataset auto init")
244244
ot_option(OT_OTNS OPENTHREAD_CONFIG_OTNS_ENABLE "OTNS")
245-
ot_option(OT_P2P OPENTHREAD_CONFIG_P2P_ENABLE "peer to peer")
245+
246246
ot_option(OT_PING_SENDER OPENTHREAD_CONFIG_PING_SENDER_ENABLE "ping sender" ${OT_APP_CLI})
247247
ot_option(OT_PLATFORM_BOOTLOADER_MODE OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE "platform bootloader mode")
248248
ot_option(OT_PLATFORM_DNSSD OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE "platform dnssd")

include/openthread/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ source_set("openthread") {
118118
"platform/trel.h",
119119
"platform/udp.h",
120120
"provisional/link.h",
121-
"provisional/p2p.h",
122121
"radio_stats.h",
123122
"random_crypto.h",
124123
"random_noncrypto.h",

include/openthread/instance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern "C" {
5252
*
5353
* @note This number versions both OpenThread platform and user APIs.
5454
*/
55-
#define OPENTHREAD_API_VERSION (605)
55+
#define OPENTHREAD_API_VERSION (606)
5656

5757
/**
5858
* @addtogroup api-instance

include/openthread/provisional/p2p.h

Lines changed: 0 additions & 155 deletions
This file was deleted.

script/test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ build_simulation()
137137
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
138138
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
139139
options+=("-DOT_LINK_METRICS_MANAGER=ON")
140-
options+=("-DOT_P2P=ON")
141140
options+=("-DOT_WAKEUP_COORDINATOR=ON")
142141
options+=("-DOT_WAKEUP_END_DEVICE=ON")
143142
fi
@@ -187,7 +186,6 @@ build_posix()
187186
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
188187
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
189188
options+=("-DOT_LINK_METRICS_MANAGER=ON")
190-
options+=("-DOT_P2P=ON")
191189
options+=("-DOT_WAKEUP_COORDINATOR=ON")
192190
options+=("-DOT_WAKEUP_END_DEVICE=ON")
193191
fi

src/cli/README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ Done
8989
- [networkname](#networkname)
9090
- [networktime](#networktime)
9191
- [nexthop](#nexthop)
92-
- [p2p](#p2p-link-extaddr-extaddr)
9392
- [panid](#panid)
9493
- [parent](#parent)
9594
- [parentpriority](#parentpriority)
@@ -3296,28 +3295,6 @@ nexthop 0x8001
32963295
Done
32973296
```
32983297

3299-
### p2p link extaddr \<extaddr\>
3300-
3301-
Wakes up the peer identified by the extended address and establishes a peer-to-peer link with the peer.
3302-
3303-
`OPENTHREAD_CONFIG_P2P_ENABLE` and `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` are required.
3304-
3305-
```bash
3306-
> p2p link extaddr dead00beef00cafe
3307-
Done
3308-
```
3309-
3310-
### p2p unlink \<extaddress\>
3311-
3312-
Tears down the P2P link identified by the extended address.
3313-
3314-
`OPENTHREAD_CONFIG_P2P_ENABLE` is required.
3315-
3316-
```bash
3317-
> p2p unlink dead00beef00cafe
3318-
Done
3319-
```
3320-
33213298
### panid
33223299

33233300
Get the IEEE 802.15.4 PAN ID value.

src/cli/cli.cpp

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -8213,83 +8213,6 @@ template <> otError Interpreter::Process<Cmd("verhoeff")>(Arg aArgs[])
82138213

82148214
#endif // OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE
82158215

8216-
#if OPENTHREAD_CONFIG_P2P_ENABLE
8217-
template <> otError Interpreter::Process<Cmd("p2p")>(Arg aArgs[])
8218-
{
8219-
otError error = OT_ERROR_NONE;
8220-
8221-
if (aArgs[0] == "unlink")
8222-
{
8223-
otExtAddress extAddress;
8224-
8225-
/**
8226-
* @cli p2p unlink
8227-
* @code
8228-
* p2p unlink dead00beef00cafe
8229-
* Done
8230-
* @endcode
8231-
* @cparam p2p unlink @ca{extended-address}
8232-
* @par
8233-
* `OPENTHREAD_CONFIG_P2P_ENABLE` is required.
8234-
* @par
8235-
* Tears down the P2P link identified by the extended address.
8236-
*/
8237-
SuccessOrExit(error = aArgs[1].ParseAsHexString(extAddress.m8));
8238-
SuccessOrExit(error = otP2pUnlink(GetInstancePtr(), &extAddress, HandleP2pUnlinkDone, this));
8239-
error = OT_ERROR_PENDING;
8240-
}
8241-
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
8242-
else if (aArgs[0] == "link")
8243-
{
8244-
otP2pRequest p2pRequest;
8245-
8246-
/**
8247-
* @cli p2p link
8248-
* @code
8249-
* p2p link extaddr dead00beef00cafe
8250-
* Done
8251-
* @endcode
8252-
* @cparam p2p link extaddr @ca{extended-address}
8253-
* @par
8254-
* `OPENTHREAD_CONFIG_P2P_ENABLE` and `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` are required.
8255-
* @par
8256-
* Wakes up the Wake-up Listener identified by the extended address and establishes a peer-to-peer link with the
8257-
* peer.
8258-
*/
8259-
if (aArgs[1] == "extaddr")
8260-
{
8261-
SuccessOrExit(error = aArgs[2].ParseAsHexString(p2pRequest.mWakeupRequest.mShared.mExtAddress.m8));
8262-
p2pRequest.mWakeupRequest.mType = OT_WAKEUP_TYPE_EXT_ADDRESS;
8263-
}
8264-
else
8265-
{
8266-
ExitNow(error = OT_ERROR_INVALID_ARGS);
8267-
}
8268-
8269-
SuccessOrExit(error = otP2pWakeupAndLink(GetInstancePtr(), &p2pRequest, HandleP2pLinkDone, this));
8270-
error = OT_ERROR_PENDING;
8271-
}
8272-
#endif
8273-
else
8274-
{
8275-
error = OT_ERROR_INVALID_ARGS;
8276-
}
8277-
8278-
exit:
8279-
return error;
8280-
}
8281-
8282-
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
8283-
void Interpreter::HandleP2pLinkDone(void *aContext) { static_cast<Interpreter *>(aContext)->HandleP2pLinkDone(); }
8284-
8285-
void Interpreter::HandleP2pLinkDone(void) { OutputResult(OT_ERROR_NONE); }
8286-
#endif
8287-
8288-
void Interpreter::HandleP2pUnlinkDone(void *aContext) { static_cast<Interpreter *>(aContext)->HandleP2pUnlinkDone(); }
8289-
8290-
void Interpreter::HandleP2pUnlinkDone(void) { OutputResult(OT_ERROR_NONE); }
8291-
#endif // OPENTHREAD_CONFIG_P2P_ENABLE
8292-
82938216
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
82948217
template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
82958218
{
@@ -8681,9 +8604,6 @@ otError Interpreter::ProcessCommand(Arg aArgs[])
86818604
#endif
86828605
#if OPENTHREAD_FTD
86838606
CmdEntry("nexthop"),
8684-
#endif
8685-
#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
8686-
CmdEntry("p2p"),
86878607
#endif
86888608
CmdEntry("panid"),
86898609
CmdEntry("parent"),

src/cli/cli.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -364,16 +364,6 @@ class Interpreter : public otCliInterpreter, public OutputImplementer, public Ut
364364
static void HandleIp6Receive(otMessage *aMessage, void *aContext);
365365
#endif
366366

367-
#if OPENTHREAD_CONFIG_P2P_ENABLE
368-
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
369-
static void HandleP2pLinkDone(void *aContext);
370-
void HandleP2pLinkDone(void);
371-
#endif
372-
373-
static void HandleP2pUnlinkDone(void *aContext);
374-
void HandleP2pUnlinkDone(void);
375-
#endif
376-
377367
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
378368
static void HandleWakeupResult(otError aError, void *aContext);
379369
void HandleWakeupResult(otError aError);

0 commit comments

Comments
 (0)