Skip to content

Commit 331df6f

Browse files
committed
[thread-direct] rename WAKEUP_COORDINATOR/END_DEVICE for Thread Direct
The WAKEUP_COORDINATOR and WAKEUP_END_DEVICE feature flags and their associated symbols are renamed to THREAD_DIRECT_WAKE_INITIATOR and THREAD_DIRECT_WAKE_LISTENER to align with the Thread Direct specification terminology. `src/core/config/wakeup.h` is replaced by `src/core/config/thread_direct.h`, which consolidates all Thread Direct configuration under a single header. Only the configuration flags needed by code landing in this PR are included. Removes `include/openthread/provisional/link.h` and its associated doc-group entry, which contained provisional WED-era types (`otWakeupId`, `otWakeupType`, `otWakeupRequest`) that are superseded by the Thread Direct public API.
1 parent 3567648 commit 331df6f

58 files changed

Lines changed: 884 additions & 1234 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/ot_api_doc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@
182182
*
183183
* @{
184184
*
185-
* @defgroup api-provisional-link Link
186-
*
187185
* @}
188186
*
189187
* @}

etc/cmake/options.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,14 @@ ot_option(OT_TCP OPENTHREAD_CONFIG_TCP_ENABLE "TCP")
267267
ot_option(OT_TIME_SYNC OPENTHREAD_CONFIG_TIME_SYNC_ENABLE "time synchronization service")
268268
ot_option(OT_TREL OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE "TREL radio link for Thread over Infrastructure feature")
269269
ot_option(OT_TREL_MANAGE_DNSSD OPENTHREAD_CONFIG_TREL_MANAGE_DNSSD_ENABLE "TREL to manage DNSSD and peer discovery")
270+
ot_option(OT_THREAD_DIRECT_WAKE_INITIATOR OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_INITIATOR_ENABLE "Thread Direct wake initiator")
271+
ot_option(OT_THREAD_DIRECT_WAKE_LISTENER OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE "Thread Direct wake listener")
270272
ot_option(OT_TX_BEACON_PAYLOAD OPENTHREAD_CONFIG_MAC_OUTGOING_BEACON_PAYLOAD_ENABLE "tx beacon payload")
271273
ot_option(OT_TX_QUEUE_STATS OPENTHREAD_CONFIG_TX_QUEUE_STATISTICS_ENABLE "tx queue statistics")
272274
ot_option(OT_UDP_FORWARD OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE "UDP forward")
273275
ot_option(OT_UPTIME OPENTHREAD_CONFIG_UPTIME_ENABLE "uptime")
274276
ot_option(OT_VERHOEFF_CHECKSUM OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE "verhoeff checksum")
275-
ot_option(OT_WAKEUP_COORDINATOR OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE "wake-up coordinator")
276-
ot_option(OT_WAKEUP_END_DEVICE OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE "wake-up end device")
277+
277278
ot_option(OT_SPINEL_CP_RESET_FAIL_CALLBACK_ENABLE OPENTHREAD_SPINEL_CONFIG_COPROCESSOR_RESET_FAILURE_CALLBACK_ENABLE "CP reset failure callback")
278279

279280
option(OT_DOC "build OpenThread documentation")

examples/platforms/utils/mac_frame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ otError otMacFrameProcessTransmitSecurity(otRadioFrame *aFrame, otRadioContext *
319319
bool processKeyId;
320320

321321
processKeyId =
322-
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
322+
#if OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_INITIATOR_ENABLE
323323
otMacFrameIsKeyIdMode2(aFrame) ||
324324
#endif
325325
otMacFrameIsKeyIdMode1(aFrame);

include/openthread/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ source_set("openthread") {
117117
"platform/toolchain.h",
118118
"platform/trel.h",
119119
"platform/udp.h",
120-
"provisional/link.h",
121120
"radio_stats.h",
122121
"random_crypto.h",
123122
"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 (606)
55+
#define OPENTHREAD_API_VERSION (607)
5656

5757
/**
5858
* @addtogroup api-instance

include/openthread/link.h

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,35 +1115,38 @@ otError otLinkSetRegion(otInstance *aInstance, uint16_t aRegionCode);
11151115
otError otLinkGetRegion(otInstance *aInstance, uint16_t *aRegionCode);
11161116

11171117
/**
1118-
* Gets the Wake-up channel.
1118+
* Gets the Thread Direct Wake Channel.
11191119
*
1120-
* Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
1120+
* Requires `OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_INITIATOR_ENABLE` or
1121+
* `OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE`.
11211122
*
11221123
* @param[in] aInstance A pointer to an OpenThread instance.
11231124
*
1124-
* @returns The Wake-up channel.
1125+
* @returns The Wake Channel (always 20).
11251126
*/
11261127
uint8_t otLinkGetWakeupChannel(otInstance *aInstance);
11271128

11281129
/**
1129-
* Sets the Wake-up channel.
1130+
* Sets the Thread Direct Wake Channel.
11301131
*
1131-
* Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
1132+
* Requires `OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_INITIATOR_ENABLE` or
1133+
* `OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE`.
1134+
*
1135+
* The Thread Direct feature mandates channel 20 (`OPENTHREAD_CONFIG_THREAD_DIRECT_DEFAULT_WAKE_CHANNEL`)
1136+
* as the sole Wake Channel. Any other value returns `OT_ERROR_INVALID_ARGS`.
11321137
*
11331138
* @param[in] aInstance A pointer to an OpenThread instance.
1134-
* @param[in] aChannel The Wake-up sample channel. Channel value should be `0` (Set Wake-up Channel unspecified,
1135-
* which means the device will use the PAN channel) or within the range [1, 10] (if 915-MHz
1136-
* supported) and [11, 26] (if 2.4 GHz supported).
1139+
* @param[in] aChannel The Wake Channel. Must equal 20.
11371140
*
1138-
* @retval OT_ERROR_NONE Successfully set the Wake-up channel.
1139-
* @retval OT_ERROR_INVALID_ARGS Invalid @p aChannel.
1141+
* @retval OT_ERROR_NONE Successfully set the Wake Channel.
1142+
* @retval OT_ERROR_INVALID_ARGS @p aChannel is not 20.
11401143
*/
11411144
otError otLinkSetWakeupChannel(otInstance *aInstance, uint8_t aChannel);
11421145

11431146
/**
11441147
* Enables or disables listening for wake-up frames.
11451148
*
1146-
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
1149+
* Requires `OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE`.
11471150
*
11481151
* @param[in] aInstance A pointer to an OpenThread instance.
11491152
* @param[in] aEnable true to enable listening for wake-up frames, or false otherwise.
@@ -1157,7 +1160,7 @@ otError otLinkSetWakeUpListenEnabled(otInstance *aInstance, bool aEnable);
11571160
/**
11581161
* Returns whether listening for wake-up frames is enabled.
11591162
*
1160-
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
1163+
* Requires `OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE`.
11611164
*
11621165
* @param[in] aInstance A pointer to an OpenThread instance.
11631166
*
@@ -1169,7 +1172,7 @@ bool otLinkIsWakeupListenEnabled(otInstance *aInstance);
11691172
/**
11701173
* Get the wake-up listen parameters.
11711174
*
1172-
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
1175+
* Requires `OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE`.
11731176
*
11741177
* @param[in] aInstance A pointer to an OpenThread instance.
11751178
* @param[out] aInterval A pointer to return the wake-up listen interval in microseconds.
@@ -1183,7 +1186,7 @@ void otLinkGetWakeupListenParameters(otInstance *aInstance, uint32_t *aInterval,
11831186
* The listen interval must be greater than the listen duration.
11841187
* The listen duration must be greater or equal than the minimum supported.
11851188
*
1186-
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
1189+
* Requires `OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE`.
11871190
*
11881191
* @param[in] aInstance A pointer to an OpenThread instance.
11891192
* @param[in] aInterval The wake-up listen interval in microseconds.

include/openthread/thread.h

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,6 @@ typedef struct otThreadParentResponseInfo
223223
*/
224224
typedef void (*otDetachGracefullyCallback)(void *aContext);
225225

226-
/**
227-
* Informs the application about the result of waking a Wake-up End Device.
228-
*
229-
* @param[in] aError OT_ERROR_NONE Indicates that the Wake-up End Device has been added as a neighbor.
230-
* OT_ERROR_FAILED Indicates that the Wake-up End Device has not received a wake-up frame, or it
231-
* has failed the MLE procedure.
232-
* @param[in] aContext A pointer to application-specific context.
233-
*/
234-
typedef void (*otWakeupCallback)(otError aError, void *aContext);
235-
236226
/**
237227
* Starts Thread protocol operation.
238228
*
@@ -1100,36 +1090,6 @@ void otThreadSetStoreFrameCounterAhead(otInstance *aInstance, uint32_t aStoreFra
11001090
*/
11011091
uint32_t otThreadGetStoreFrameCounterAhead(otInstance *aInstance);
11021092

1103-
/**
1104-
* Attempts to wake a Wake-up End Device.
1105-
*
1106-
* Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` to be enabled.
1107-
*
1108-
* The wake-up starts with transmitting a wake-up frame sequence to the Wake-up End Device.
1109-
* During the wake-up sequence, and for a short time after the last wake-up frame is sent, the Wake-up Coordinator keeps
1110-
* its receiver on to be able to receive an initial mesh link establishment message from the WED.
1111-
*
1112-
* @warning The functionality implemented by this function is still in the design phase.
1113-
* Consequently, the prototype and semantics of this function are subject to change.
1114-
*
1115-
* @param[in] aInstance A pointer to an OpenThread instance.
1116-
* @param[in] aWedAddress The extended address of the Wake-up End Device.
1117-
* @param[in] aWakeupIntervalUs An interval between consecutive wake-up frames (in microseconds).
1118-
* @param[in] aWakeupDurationMs Duration of the wake-up sequence (in milliseconds).
1119-
* @param[in] aCallback A pointer to function that is called when the wake-up succeeds or fails.
1120-
* @param[in] aCallbackContext A pointer to callback application-specific context.
1121-
*
1122-
* @retval OT_ERROR_NONE Successfully started the wake-up.
1123-
* @retval OT_ERROR_INVALID_STATE Another attachment request is still in progress.
1124-
* @retval OT_ERROR_INVALID_ARGS The wake-up interval or duration are invalid.
1125-
*/
1126-
otError otThreadWakeup(otInstance *aInstance,
1127-
const otExtAddress *aWedAddress,
1128-
uint16_t aWakeupIntervalUs,
1129-
uint16_t aWakeupDurationMs,
1130-
otWakeupCallback aCallback,
1131-
void *aCallbackContext);
1132-
11331093
/**
11341094
* @}
11351095
*/

script/test

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ 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_WAKEUP_COORDINATOR=ON")
141-
options+=("-DOT_WAKEUP_END_DEVICE=ON")
140+
if [[ ${OT_NODE_TYPE} != rcp* ]]; then
141+
options+=("-DOT_THREAD_DIRECT_WAKE_INITIATOR=ON")
142+
options+=("-DOT_THREAD_DIRECT_WAKE_LISTENER=ON")
143+
fi
142144
fi
143145

144146
if [[ ${OT_NODE_TYPE} == cli* ]]; then
@@ -186,8 +188,8 @@ build_posix()
186188
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
187189
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
188190
options+=("-DOT_LINK_METRICS_MANAGER=ON")
189-
options+=("-DOT_WAKEUP_COORDINATOR=ON")
190-
options+=("-DOT_WAKEUP_END_DEVICE=ON")
191+
options+=("-DOT_THREAD_DIRECT_WAKE_INITIATOR=ON")
192+
options+=("-DOT_THREAD_DIRECT_WAKE_LISTENER=ON")
191193
fi
192194

193195
if [[ ${FULL_LOGS} == 1 ]]; then

src/cli/cli.cpp

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

82148214
#endif // OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE
82158215

8216-
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
8216+
#if OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE
82178217
template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
82188218
{
82198219
otError error = OT_ERROR_NONE;
@@ -8240,7 +8240,7 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
82408240
{
82418241
error = ProcessGetSet(aArgs + 1, otLinkGetWakeupChannel, otLinkSetWakeupChannel);
82428242
}
8243-
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
8243+
#if OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE
82448244
/**
82458245
* @cli wakeup parameters (get,set)
82468246
* @code
@@ -8303,34 +8303,7 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
83038303
{
83048304
error = ProcessEnableDisable(aArgs + 1, otLinkIsWakeupListenEnabled, otLinkSetWakeUpListenEnabled);
83058305
}
8306-
#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
8307-
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
8308-
/**
8309-
* @cli wakeup wake
8310-
* @code
8311-
* wakeup wake 1ece0a6c4653a7c1 7500 1090
8312-
* Done
8313-
* @endcode
8314-
* @cparam wakeup wake @ca{extaddr} @ca{wakeup-interval} @ca{wakeup-duration}
8315-
* @par
8316-
* Wakes a Wake-up End Device identified by its MAC extended address, using the provided wake-up interval (in the
8317-
* units of microseconds), and wake-up duration (in the units of milliseconds).
8318-
*/
8319-
else if (aArgs[0] == "wake")
8320-
{
8321-
otExtAddress extAddress;
8322-
uint16_t wakeupIntervalUs;
8323-
uint16_t wakeupDurationMs;
8324-
8325-
SuccessOrExit(error = aArgs[1].ParseAsHexString(extAddress.m8));
8326-
SuccessOrExit(error = aArgs[2].ParseAsUint16(wakeupIntervalUs));
8327-
SuccessOrExit(error = aArgs[3].ParseAsUint16(wakeupDurationMs));
8328-
8329-
SuccessOrExit(error = otThreadWakeup(GetInstancePtr(), &extAddress, wakeupIntervalUs, wakeupDurationMs,
8330-
HandleWakeupResult, this));
8331-
error = OT_ERROR_PENDING;
8332-
}
8333-
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
8306+
#endif // OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE
83348307
else
83358308
{
83368309
ExitNow(error = OT_ERROR_INVALID_ARGS);
@@ -8339,16 +8312,7 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
83398312
exit:
83408313
return error;
83418314
}
8342-
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
8343-
8344-
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
8345-
void Interpreter::HandleWakeupResult(otError aError, void *aContext)
8346-
{
8347-
static_cast<Interpreter *>(aContext)->HandleWakeupResult(aError);
8348-
}
8349-
8350-
void Interpreter::HandleWakeupResult(otError aError) { OutputResult(aError); }
8351-
#endif
8315+
#endif // OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE
83528316

83538317
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
83548318

@@ -8702,7 +8666,7 @@ otError Interpreter::ProcessCommand(Arg aArgs[])
87028666
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
87038667
CmdEntry("version"),
87048668
#if OPENTHREAD_FTD || OPENTHREAD_MTD
8705-
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
8669+
#if OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_THREAD_DIRECT_WAKE_LISTENER_ENABLE
87068670
CmdEntry("wakeup"),
87078671
#endif
87088672
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD

src/cli/cli.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +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_WAKEUP_COORDINATOR_ENABLE
368-
static void HandleWakeupResult(otError aError, void *aContext);
369-
void HandleWakeupResult(otError aError);
370-
#endif
371-
372367
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
373368

374369
#if OPENTHREAD_CONFIG_DIAG_ENABLE

0 commit comments

Comments
 (0)