mirror of
https://github.com/espressif/openthread.git
synced 2026-08-31 22:39:54 +00:00
[config] rename legacy wake configs to use new Thread Direct terms (#13535)
This commit updates the legacy "Wakeup Coordinator" and "Wakeup End Device" configuration macros and CMake options to the new Thread Direct (TD) terminology: - `_WAKEUP_COORDINATOR_ENABLE` -> `_TD_WAKE_INITIATOR_ENABLE` (CMake: `OT_WAKEUP_COORDINATOR` -> `OT_WAKE_INITIATOR`) - `_WAKEUP_END_DEVICE_ENABLE` -> `_TD_WAKE_LISTENER_ENABLE` (CMake: `OT_WAKEUP_END_DEVICE` -> `OT_WAKE_LISTENER`) Specifically: - Renames `config/wakeup.h` to `config/thread_direct.h`. - Adds `#error` checks in `openthread-core-config-check.h` for removed and renamed legacy configuration macros. - Adds `ot_removed_option` checks in `options.cmake` to error if the renamed CMake options are used. - Updates all guards and documentation across core, CLI, NCP, and examples.
This commit is contained in:
+1
-1
@@ -83,10 +83,10 @@
|
||||
* @defgroup config-sntp-client SNTP Client
|
||||
* @defgroup config-srp-client SRP Client
|
||||
* @defgroup config-srp-server SRP Server
|
||||
* @defgroup config-thread-direct Thread Direct
|
||||
* @defgroup config-time-sync Time Sync Service
|
||||
* @defgroup config-tmf Thread Management Framework Service
|
||||
* @defgroup config-trel TREL
|
||||
* @defgroup config-wakeup Wake-up
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -272,8 +272,8 @@ ot_option(OT_TX_QUEUE_STATS OPENTHREAD_CONFIG_TX_QUEUE_STATISTICS_ENABLE "tx que
|
||||
ot_option(OT_UDP_FORWARD OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE "UDP forward")
|
||||
ot_option(OT_UPTIME OPENTHREAD_CONFIG_UPTIME_ENABLE "uptime")
|
||||
ot_option(OT_VERHOEFF_CHECKSUM OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE "verhoeff checksum")
|
||||
ot_option(OT_WAKEUP_COORDINATOR OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE "wake-up coordinator")
|
||||
ot_option(OT_WAKEUP_END_DEVICE OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE "wake-up end device")
|
||||
ot_option(OT_WAKE_INITIATOR OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE "Thread Direct wake initiator")
|
||||
ot_option(OT_WAKE_LISTENER OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE "Thread Direct wake listener")
|
||||
ot_option(OT_SPINEL_CP_RESET_FAIL_CALLBACK_ENABLE OPENTHREAD_SPINEL_CONFIG_COPROCESSOR_RESET_FAILURE_CALLBACK_ENABLE "CP reset failure callback")
|
||||
|
||||
option(OT_DOC "build OpenThread documentation")
|
||||
@@ -400,3 +400,5 @@ endmacro()
|
||||
ot_removed_option(OT_MTD_NETDIAG "- Use OT_NETDIAG_CLIENT instead - note that server function is always supported")
|
||||
ot_removed_option(OT_EXCLUDE_TCPLP_LIB "- Use OT_TCP instead, OT_EXCLUDE_TCPLP_LIB 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_END_DEVICE "- Use OT_WAKE_LISTENER instead")
|
||||
|
||||
@@ -305,7 +305,7 @@ otError otMacFrameProcessTransmitSecurity(otRadioFrame *aFrame, otRadioContext *
|
||||
bool processKeyId;
|
||||
|
||||
processKeyId =
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
otMacFrameIsKeyIdMode2(aFrame) ||
|
||||
#endif
|
||||
otMacFrameIsKeyIdMode1(aFrame);
|
||||
|
||||
@@ -52,7 +52,7 @@ extern "C" {
|
||||
*
|
||||
* @note This number versions both OpenThread platform and user APIs.
|
||||
*/
|
||||
#define OPENTHREAD_API_VERSION (618)
|
||||
#define OPENTHREAD_API_VERSION (619)
|
||||
|
||||
/**
|
||||
* @addtogroup api-instance
|
||||
|
||||
@@ -1127,7 +1127,7 @@ otError otLinkGetRegion(otInstance *aInstance, uint16_t *aRegionCode);
|
||||
/**
|
||||
* Gets the Wake-up channel.
|
||||
*
|
||||
* Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
* Requires `OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` or `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
@@ -1138,7 +1138,7 @@ uint8_t otLinkGetWakeupChannel(otInstance *aInstance);
|
||||
/**
|
||||
* Sets the Wake-up channel.
|
||||
*
|
||||
* Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
* Requires `OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` or `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aChannel The Wake-up sample channel. Channel value should be `0` (Set Wake-up Channel unspecified,
|
||||
@@ -1153,7 +1153,7 @@ otError otLinkSetWakeupChannel(otInstance *aInstance, uint8_t aChannel);
|
||||
/**
|
||||
* Enables or disables listening for wake-up frames.
|
||||
*
|
||||
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
* Requires `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aEnable true to enable listening for wake-up frames, or false otherwise.
|
||||
@@ -1167,7 +1167,7 @@ otError otLinkSetWakeUpListenEnabled(otInstance *aInstance, bool aEnable);
|
||||
/**
|
||||
* Returns whether listening for wake-up frames is enabled.
|
||||
*
|
||||
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
* Requires `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
@@ -1179,7 +1179,7 @@ bool otLinkIsWakeupListenEnabled(otInstance *aInstance);
|
||||
/**
|
||||
* Get the wake-up listen parameters.
|
||||
*
|
||||
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
* Requires `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[out] aInterval A pointer to return the wake-up listen interval in microseconds.
|
||||
@@ -1193,7 +1193,7 @@ void otLinkGetWakeupListenParameters(otInstance *aInstance, uint32_t *aInterval,
|
||||
* The listen interval must be greater than the listen duration.
|
||||
* The listen duration must be greater or equal than the minimum supported.
|
||||
*
|
||||
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
* Requires `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aInterval The wake-up listen interval in microseconds.
|
||||
|
||||
@@ -1103,7 +1103,7 @@ uint32_t otThreadGetStoreFrameCounterAhead(otInstance *aInstance);
|
||||
/**
|
||||
* Attempts to wake a Wake-up End Device.
|
||||
*
|
||||
* Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` to be enabled.
|
||||
* Requires `OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` to be enabled.
|
||||
*
|
||||
* The wake-up starts with transmitting a wake-up frame sequence to the Wake-up End Device.
|
||||
* During the wake-up sequence, and for a short time after the last wake-up frame is sent, the Wake-up Coordinator keeps
|
||||
|
||||
+4
-4
@@ -138,8 +138,8 @@ build_simulation()
|
||||
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
|
||||
options+=("-DOT_LINK_METRICS_MANAGER=ON")
|
||||
options+=("-DOT_P2P=ON")
|
||||
options+=("-DOT_WAKEUP_COORDINATOR=ON")
|
||||
options+=("-DOT_WAKEUP_END_DEVICE=ON")
|
||||
options+=("-DOT_WAKE_INITIATOR=ON")
|
||||
options+=("-DOT_WAKE_LISTENER=ON")
|
||||
fi
|
||||
|
||||
if [[ ${OT_NODE_TYPE} == cli* ]]; then
|
||||
@@ -188,8 +188,8 @@ build_posix()
|
||||
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
|
||||
options+=("-DOT_LINK_METRICS_MANAGER=ON")
|
||||
options+=("-DOT_P2P=ON")
|
||||
options+=("-DOT_WAKEUP_COORDINATOR=ON")
|
||||
options+=("-DOT_WAKEUP_END_DEVICE=ON")
|
||||
options+=("-DOT_WAKE_INITIATOR=ON")
|
||||
options+=("-DOT_WAKE_LISTENER=ON")
|
||||
fi
|
||||
|
||||
if [[ ${FULL_LOGS} == 1 ]]; then
|
||||
|
||||
+8
-8
@@ -3300,7 +3300,7 @@ Done
|
||||
|
||||
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_WAKEUP_COORDINATOR_ENABLE` are required.
|
||||
`OPENTHREAD_CONFIG_P2P_ENABLE` and `OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` are required.
|
||||
|
||||
```bash
|
||||
> p2p link extaddr dead00beef00cafe
|
||||
@@ -4844,7 +4844,7 @@ Factory Diagnostics module is enabled only when building OpenThread with `OPENTH
|
||||
|
||||
Get the wake-up channel.
|
||||
|
||||
Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
Requires `OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` or `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
|
||||
```bash
|
||||
> wakeup channel
|
||||
@@ -4856,7 +4856,7 @@ Done
|
||||
|
||||
Set the wake-up channel.
|
||||
|
||||
Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
Requires `OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` or `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
|
||||
```bash
|
||||
> wakeup channel 12
|
||||
@@ -4867,7 +4867,7 @@ Done
|
||||
|
||||
Get the wake-up listen interval and duration.
|
||||
|
||||
Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
Requires `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
|
||||
```bash
|
||||
> wakeup parameters
|
||||
@@ -4880,7 +4880,7 @@ Done
|
||||
|
||||
Set the wake-up listen interval and duration.
|
||||
|
||||
Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
|
||||
Requires `OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE`.
|
||||
|
||||
```bash
|
||||
> wakeup parameters 1000000 8000
|
||||
@@ -4891,7 +4891,7 @@ Done
|
||||
|
||||
Show the state of wake-up listening feature.
|
||||
|
||||
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
|
||||
`OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE` is required.
|
||||
|
||||
```bash
|
||||
> wakeup listen
|
||||
@@ -4903,7 +4903,7 @@ Done
|
||||
|
||||
Enable/disable listening for wake-up frames.
|
||||
|
||||
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
|
||||
`OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE` is required.
|
||||
|
||||
```bash
|
||||
> wakeup listen enable
|
||||
@@ -4914,7 +4914,7 @@ Done
|
||||
|
||||
Wakes a Wake-up End Device.
|
||||
|
||||
`OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` is required.
|
||||
`OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE` is required.
|
||||
|
||||
```bash
|
||||
> wakeup wake 1ece0a6c4653a7c1 7500 1090
|
||||
|
||||
+12
-12
@@ -8243,7 +8243,7 @@ template <> otError Interpreter::Process<Cmd("p2p")>(Arg aArgs[])
|
||||
SuccessOrExit(error = otP2pUnlink(GetInstancePtr(), &extAddress, HandleP2pUnlinkDone, this));
|
||||
error = OT_ERROR_PENDING;
|
||||
}
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
else if (aArgs[0] == "link")
|
||||
{
|
||||
otP2pRequest p2pRequest;
|
||||
@@ -8256,7 +8256,7 @@ template <> otError Interpreter::Process<Cmd("p2p")>(Arg aArgs[])
|
||||
* @endcode
|
||||
* @cparam p2p link extaddr @ca{extended-address}
|
||||
* @par
|
||||
* `OPENTHREAD_CONFIG_P2P_ENABLE` and `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` are required.
|
||||
* `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.
|
||||
@@ -8284,7 +8284,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#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); }
|
||||
@@ -8295,7 +8295,7 @@ void Interpreter::HandleP2pUnlinkDone(void *aContext) { static_cast<Interpreter
|
||||
void Interpreter::HandleP2pUnlinkDone(void) { OutputResult(OT_ERROR_NONE); }
|
||||
#endif // OPENTHREAD_CONFIG_P2P_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
@@ -8322,7 +8322,7 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
|
||||
{
|
||||
error = ProcessGetSet(aArgs + 1, otLinkGetWakeupChannel, otLinkSetWakeupChannel);
|
||||
}
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* @cli wakeup parameters (get,set)
|
||||
* @code
|
||||
@@ -8385,8 +8385,8 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
|
||||
{
|
||||
error = ProcessEnableDisable(aArgs + 1, otLinkIsWakeupListenEnabled, otLinkSetWakeUpListenEnabled);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
/**
|
||||
* @cli wakeup wake
|
||||
* @code
|
||||
@@ -8412,7 +8412,7 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
|
||||
HandleWakeupResult, this));
|
||||
error = OT_ERROR_PENDING;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
else
|
||||
{
|
||||
ExitNow(error = OT_ERROR_INVALID_ARGS);
|
||||
@@ -8421,9 +8421,9 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(Arg aArgs[])
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
void Interpreter::HandleWakeupResult(otError aError, void *aContext)
|
||||
{
|
||||
static_cast<Interpreter *>(aContext)->HandleWakeupResult(aError);
|
||||
@@ -8687,7 +8687,7 @@ otError Interpreter::ProcessCommand(Arg aArgs[])
|
||||
#if OPENTHREAD_FTD
|
||||
CmdEntry("nexthop"),
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
CmdEntry("p2p"),
|
||||
#endif
|
||||
CmdEntry("panid"),
|
||||
@@ -8790,7 +8790,7 @@ otError Interpreter::ProcessCommand(Arg aArgs[])
|
||||
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
CmdEntry("version"),
|
||||
#if OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
CmdEntry("wakeup"),
|
||||
#endif
|
||||
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
|
||||
+2
-2
@@ -366,7 +366,7 @@ private:
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
static void HandleP2pLinkDone(void *aContext);
|
||||
void HandleP2pLinkDone(void);
|
||||
#endif
|
||||
@@ -375,7 +375,7 @@ private:
|
||||
void HandleP2pUnlinkDone(void);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
static void HandleWakeupResult(otError aError, void *aContext);
|
||||
void HandleWakeupResult(otError aError);
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -930,10 +930,10 @@ source_set("libopenthread_core_config") {
|
||||
"config/sntp_client.h",
|
||||
"config/srp_client.h",
|
||||
"config/srp_server.h",
|
||||
"config/thread_direct.h",
|
||||
"config/time_sync.h",
|
||||
"config/tmf.h",
|
||||
"config/trel.h",
|
||||
"config/wakeup.h",
|
||||
"openthread-core-config.h",
|
||||
]
|
||||
public_configs = [
|
||||
|
||||
@@ -79,7 +79,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
uint8_t otLinkGetWakeupChannel(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::Mac>().GetWakeupChannel();
|
||||
@@ -100,7 +100,7 @@ otError otLinkSetWakeupChannel(otInstance *aInstance, uint8_t aChannel)
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
uint32_t otLinkGetSupportedChannelMask(otInstance *aInstance)
|
||||
{
|
||||
@@ -507,7 +507,7 @@ otError otLinkGetRegion(otInstance *aInstance, uint16_t *aRegionCode)
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
otError otLinkSetWakeUpListenEnabled(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::Mac>().SetWakeupListenEnabled(aEnable);
|
||||
@@ -527,4 +527,4 @@ otError otLinkSetWakeupListenParameters(otInstance *aInstance, uint32_t aInterva
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::Mac>().SetWakeupListenParameters(aInterval, aDuration);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
otError otP2pWakeupAndLink(otInstance *aInstance,
|
||||
const otP2pRequest *aP2pRequest,
|
||||
otP2pLinkDoneCallback aCallback,
|
||||
|
||||
@@ -483,7 +483,7 @@ uint32_t otThreadGetStoreFrameCounterAhead(otInstance *aInstance)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
otError otThreadWakeup(otInstance *aInstance,
|
||||
const otExtAddress *aWedAddress,
|
||||
uint16_t aWakeupIntervalUs,
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
*/
|
||||
|
||||
#include "config/time_sync.h"
|
||||
#include "config/wakeup.h"
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
|
||||
|
||||
@@ -712,4 +712,44 @@
|
||||
"Software support for RxOnWhenIdle in SubMac was never implemented."
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#error "OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE was replaced by OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE."
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#error "OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE was replaced by OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE."
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_INTERVAL
|
||||
#error "OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_INTERVAL was removed (legacy thread-in-mobile)"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_COUNT
|
||||
#error "OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_COUNT was removed (legacy thread-in-mobile)"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WAKEUP_TX_INTERVAL
|
||||
#error "OPENTHREAD_CONFIG_WAKEUP_TX_INTERVAL was removed (legacy thread-in-mobile)"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WAKEUP_MAX_DURATION
|
||||
#error "OPENTHREAD_CONFIG_WAKEUP_MAX_DURATION was removed (legacy thread-in-mobile)"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WED_LISTEN_INTERVAL
|
||||
#error "OPENTHREAD_CONFIG_WED_LISTEN_INTERVAL was removed (legacy thread-in-mobile)"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WED_LISTEN_DURATION
|
||||
#error "OPENTHREAD_CONFIG_WED_LISTEN_DURATION was removed (legacy thread-in-mobile)"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WED_RECEIVE_TIME_AFTER
|
||||
#error "OPENTHREAD_CONFIG_WED_RECEIVE_TIME_AFTER was removed (legacy thread-in-mobile)"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE
|
||||
#error "OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE was removed (legacy thread-in-mobile)"
|
||||
#endif
|
||||
|
||||
#endif // OT_CORE_CONFIG_OPENTHREAD_CORE_CONFIG_CHECK_H_
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2024-2026, 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 Thread Direct (TD).
|
||||
*/
|
||||
|
||||
#ifndef OT_CORE_CONFIG_THREAD_DIRECT_H_
|
||||
#define OT_CORE_CONFIG_THREAD_DIRECT_H_
|
||||
|
||||
/**
|
||||
* @addtogroup config-thread-direct
|
||||
*
|
||||
* @brief
|
||||
* This module includes configuration variables for Thread Direct (TD).
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
*
|
||||
* Define to 1 to enable Thread Direct Wake Initiator functionality.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
#define OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
*
|
||||
* Define to 1 to enable Thread Direct Wake Listener functionality.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
#define OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // OT_CORE_CONFIG_THREAD_DIRECT_H_
|
||||
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2024, 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 Wake-up Coordinator and Wake-up End Device roles.
|
||||
*/
|
||||
|
||||
#ifndef OT_CORE_CONFIG_WAKEUP_H_
|
||||
#define OT_CORE_CONFIG_WAKEUP_H_
|
||||
|
||||
/**
|
||||
* @addtogroup config-wakeup
|
||||
*
|
||||
* @brief
|
||||
* This module includes configuration variables for the Wake-up Coordinator and Wake-up End Device roles.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
*
|
||||
* Define to 1 to enable the Wake-up Coordinator role that is capable of establishing
|
||||
* a link with one or more Wake-up End Devices by sending a sequence of wake-up frames.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#define OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_INTERVAL
|
||||
*
|
||||
* The Connection Retry Interval is included in the Connection IE of each wake-up frame sent by the Wake-up Coordinator
|
||||
* to a Wake-up End Device.
|
||||
*
|
||||
* This value defines how frequently the Wake-up End Device should retry sending the initial MLE message to the Wake-up
|
||||
* Parent after receiving a wake-up frame, in the units of Wake-up Intervals (7.5ms by default).
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_INTERVAL
|
||||
#define OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_INTERVAL 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_COUNT
|
||||
*
|
||||
* The Connection Retry Count is included in the Connection IE of each wake-up frame sent by the Wake-up Coordinator to
|
||||
* a Wake-up End Device.
|
||||
*
|
||||
* This value defines how many times the Wake-up End Device should retry sending the initial MLE message to the Wake-up
|
||||
* Parent after receiving a wake-up frame.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_COUNT
|
||||
#define OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_COUNT 12
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
*
|
||||
* Define to 1 to enable the Wake-up End Device role that periodically listens for wake-up
|
||||
* frames to establish a link with a Wake-up Coordinator device.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#define OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WAKEUP_TX_INTERVAL
|
||||
*
|
||||
* The default time interval between (start of) wake-up frame transmissions in microseconds.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WAKEUP_TX_INTERVAL
|
||||
#define OPENTHREAD_CONFIG_WAKEUP_TX_INTERVAL 7500
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WAKEUP_MAX_DURATION
|
||||
*
|
||||
* The default duration of time that wake-up frames are periodically transmitted in milliseconds.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WAKEUP_MAX_DURATION
|
||||
#define OPENTHREAD_CONFIG_WAKEUP_MAX_DURATION 1090
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WED_LISTEN_INTERVAL
|
||||
*
|
||||
* The default wake-up listen interval in microseconds.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WED_LISTEN_INTERVAL
|
||||
#define OPENTHREAD_CONFIG_WED_LISTEN_INTERVAL 1000000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WED_LISTEN_DURATION
|
||||
*
|
||||
* The default wake-up listen duration in microseconds.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WED_LISTEN_DURATION
|
||||
#define OPENTHREAD_CONFIG_WED_LISTEN_DURATION 8000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WED_RECEIVE_TIME_AFTER
|
||||
*
|
||||
* Margin to be applied after the end of a wake-up listen duration to schedule the next listen interval, in units of
|
||||
* microseconds.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WED_RECEIVE_TIME_AFTER
|
||||
#define OPENTHREAD_CONFIG_WED_RECEIVE_TIME_AFTER 500
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE
|
||||
*
|
||||
* Define to 1 to perform CCA before transmitting wake-up frame.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE
|
||||
#define OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // OT_CORE_CONFIG_WAKEUP_H_
|
||||
@@ -974,7 +974,7 @@ template <> inline RouterTable &Instance::Get(void) { return mMle.mRouterTable;
|
||||
template <> inline PeerTable &Instance::Get(void) { return mMle.mP2p.mPeerTable; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
template <> inline WakeupTxScheduler &Instance::Get(void) { return mMle.mWakeupTxScheduler; }
|
||||
#endif
|
||||
|
||||
|
||||
+14
-14
@@ -66,7 +66,7 @@ Mac::Mac(Instance &aInstance)
|
||||
, mShouldDelaySleep(false)
|
||||
, mDelayingSleep(false)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
, mWakeupListenEnabled(false)
|
||||
#endif
|
||||
, mOperation(kOperationIdle)
|
||||
@@ -91,7 +91,7 @@ Mac::Mac(Instance &aInstance)
|
||||
, mCslPeriod(0)
|
||||
#endif
|
||||
, mWakeupChannel(OPENTHREAD_CONFIG_DEFAULT_WAKEUP_CHANNEL)
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
, mWakeupListenInterval(kDefaultWedListenInterval)
|
||||
, mWakeupListenDuration(kDefaultWedListenDuration)
|
||||
#endif
|
||||
@@ -229,7 +229,7 @@ bool Mac::IsInTransmitState(void) const
|
||||
#endif
|
||||
case kOperationTransmitBeacon:
|
||||
case kOperationTransmitPoll:
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
case kOperationTransmitWakeup:
|
||||
#endif
|
||||
retval = true;
|
||||
@@ -508,7 +508,7 @@ exit:
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
void Mac::RequestWakeupFrameTransmission(void)
|
||||
{
|
||||
VerifyOrExit(IsEnabled());
|
||||
@@ -613,7 +613,7 @@ void Mac::PerformNextOperation(void)
|
||||
// remains in receive mode after a data poll ACK indicating a
|
||||
// pending frame from the parent.
|
||||
kOperationWaitingForData,
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
kOperationTransmitWakeup,
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
@@ -690,7 +690,7 @@ void Mac::PerformNextOperation(void)
|
||||
case kOperationTransmitDataCsl:
|
||||
#endif
|
||||
case kOperationTransmitPoll:
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
case kOperationTransmitWakeup:
|
||||
#endif
|
||||
BeginTransmit();
|
||||
@@ -989,7 +989,7 @@ void Mac::BeginTransmit(void)
|
||||
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
case kOperationTransmitWakeup:
|
||||
frame = Get<WakeupTxScheduler>().PrepareWakeupFrame(txFrames);
|
||||
VerifyOrExit(frame != nullptr);
|
||||
@@ -1506,7 +1506,7 @@ void Mac::HandleTransmitDone(TxFrame &aFrame, RxFrame *aAckFrame, Error aError)
|
||||
break;
|
||||
#endif // OPENTHREAD_FTD
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
case kOperationTransmitWakeup:
|
||||
FinishOperation();
|
||||
PerformNextOperation();
|
||||
@@ -2317,7 +2317,7 @@ const char *Mac::OperationToString(Operation aOperation)
|
||||
#define CslTxOperationMapList(_)
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
#define WakeupOperationMapList(_) _(kOperationTransmitWakeup, "TransmitWakeup")
|
||||
#else
|
||||
#define WakeupOperationMapList(_)
|
||||
@@ -2447,7 +2447,7 @@ void Mac::SetCslPeriod(uint16_t aPeriod)
|
||||
|
||||
VerifyOrExit(mCslPeriod != aPeriod);
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
if (IsWakeupListenEnabled() && aPeriod != 0)
|
||||
{
|
||||
IgnoreError(SetWakeupListenEnabled(false));
|
||||
@@ -2599,7 +2599,7 @@ void Mac::SetRadioFilterEnabled(bool aFilterEnabled)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
Error Mac::SetWakeupChannel(uint8_t aChannel)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
@@ -2613,7 +2613,7 @@ Error Mac::SetWakeupChannel(uint8_t aChannel)
|
||||
VerifyOrExit(mSupportedChannelMask.ContainsChannel(aChannel), error = kErrorInvalidArgs);
|
||||
mWakeupChannel = aChannel;
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
UpdateWakeupListening();
|
||||
#endif
|
||||
|
||||
@@ -2622,7 +2622,7 @@ exit:
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
void Mac::GetWakeupListenParameters(uint32_t &aInterval, uint32_t &aDuration) const
|
||||
{
|
||||
aInterval = mWakeupListenInterval;
|
||||
@@ -2679,7 +2679,7 @@ void Mac::UpdateWakeupListening(void)
|
||||
mLinks.UpdateWakeupListening(mWakeupListenEnabled, mWakeupListenInterval, mWakeupListenDuration, channel);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
} // namespace Mac
|
||||
} // namespace ot
|
||||
|
||||
+10
-10
@@ -202,7 +202,7 @@ public:
|
||||
void RequestCslFrameTransmission(void);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
/**
|
||||
* Requests `Mac` to start a wake-up frame transmission.
|
||||
*/
|
||||
@@ -639,7 +639,7 @@ public:
|
||||
*/
|
||||
uint8_t GetWakeupChannel(void) const { return mWakeupChannel; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Sets the wake-up channel.
|
||||
*
|
||||
@@ -651,7 +651,7 @@ public:
|
||||
Error SetWakeupChannel(uint8_t aChannel);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Gets the wake-up listen parameters.
|
||||
*
|
||||
@@ -692,7 +692,7 @@ public:
|
||||
* @retval FALSE If listening for wake-up frames is not enabled.
|
||||
*/
|
||||
bool IsWakeupListenEnabled(void) const { return mWakeupListenEnabled; }
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
private:
|
||||
static constexpr uint16_t kMaxCcaSampleCount = OPENTHREAD_CONFIG_CCA_FAILURE_RATE_AVERAGING_WINDOW;
|
||||
@@ -710,8 +710,8 @@ private:
|
||||
|
||||
static constexpr uint16_t kMinCslIePeriod = OPENTHREAD_CONFIG_MAC_CSL_MIN_PERIOD;
|
||||
|
||||
static constexpr uint32_t kDefaultWedListenInterval = OPENTHREAD_CONFIG_WED_LISTEN_INTERVAL;
|
||||
static constexpr uint32_t kDefaultWedListenDuration = OPENTHREAD_CONFIG_WED_LISTEN_DURATION;
|
||||
static constexpr uint32_t kDefaultWedListenInterval = 1000000;
|
||||
static constexpr uint32_t kDefaultWedListenDuration = 8000;
|
||||
|
||||
enum Operation : uint8_t
|
||||
{
|
||||
@@ -728,7 +728,7 @@ private:
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
kOperationTransmitDataCsl,
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
kOperationTransmitWakeup,
|
||||
#endif
|
||||
};
|
||||
@@ -825,7 +825,7 @@ private:
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
void ProcessEnhAckProbing(const RxFrame &aFrame, const Neighbor &aNeighbor);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
void UpdateWakeupListening(void);
|
||||
#endif
|
||||
|
||||
@@ -846,7 +846,7 @@ private:
|
||||
bool mShouldDelaySleep : 1;
|
||||
bool mDelayingSleep : 1;
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
bool mWakeupListenEnabled : 1;
|
||||
#endif
|
||||
Operation mOperation;
|
||||
@@ -873,7 +873,7 @@ private:
|
||||
uint16_t mCslPeriod;
|
||||
#endif
|
||||
uint8_t mWakeupChannel;
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
uint32_t mWakeupListenInterval;
|
||||
uint32_t mWakeupListenDuration;
|
||||
#endif
|
||||
|
||||
@@ -919,7 +919,7 @@ public:
|
||||
*/
|
||||
Error GenerateEnhAck(const RxFrame &aRxFrame, bool aIsFramePending, const uint8_t *aIeData, uint8_t aIeLength);
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
/**
|
||||
* Generate IEE 802.15.4 Wake-up frame.
|
||||
*
|
||||
|
||||
@@ -79,7 +79,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
Error ConnectionIe::SetWakeupId(WakeupId aWakeupId)
|
||||
{
|
||||
@@ -114,7 +114,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
} // namespace Mac
|
||||
} // namespace ot
|
||||
|
||||
@@ -467,7 +467,7 @@ private:
|
||||
uint16_t mRendezvousTime;
|
||||
} OT_TOOL_PACKED_END;
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
/**
|
||||
* Implements Connection IE data structure.
|
||||
@@ -563,7 +563,7 @@ private:
|
||||
uint8_t mConnectionWindow;
|
||||
// Followed by variable length Wakeup ID
|
||||
} OT_TOOL_PACKED_END;
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -475,7 +475,7 @@ public:
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Configures wake-up listening parameters in all radios.
|
||||
*
|
||||
|
||||
@@ -429,7 +429,7 @@ uint8_t DeterminePrevKeyIndex(uint8_t aKeyIndex)
|
||||
return prevIndex;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
uint8_t GetWakeupIdLength(WakeupId aWakeupId)
|
||||
{
|
||||
uint8_t zeroBytesCount = 0;
|
||||
@@ -450,7 +450,7 @@ uint8_t GetWakeupIdLength(WakeupId aWakeupId)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
void WakeupRequest::SetExtAddress(const ExtAddress &aExtAddress)
|
||||
{
|
||||
SetType(kTypeExtAddress);
|
||||
|
||||
@@ -919,7 +919,7 @@ private:
|
||||
uint8_t mUncertainty;
|
||||
};
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Gets the length of the wake-up identifier.
|
||||
*
|
||||
@@ -932,7 +932,7 @@ private:
|
||||
uint8_t GetWakeupIdLength(WakeupId aWakeupId);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
/**
|
||||
* Represents a wake-up request.
|
||||
*/
|
||||
@@ -1029,9 +1029,9 @@ public:
|
||||
*/
|
||||
bool IsWakeupByGroupId(void) const;
|
||||
};
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Represents the information of the received wake-up frame.
|
||||
*/
|
||||
@@ -1053,7 +1053,7 @@ struct WakeupInfo
|
||||
DefineCoreType(otExtAddress, Mac::ExtAddress);
|
||||
DefineCoreType(otMacKey, Mac::Key);
|
||||
DefineCoreType(otMacKeyMaterial, Mac::KeyMaterial);
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
DefineCoreType(otWakeupRequest, Mac::WakeupRequest);
|
||||
DefineMapEnum(otWakeupType, Mac::WakeupRequest::Type);
|
||||
#endif
|
||||
|
||||
+11
-11
@@ -55,7 +55,7 @@ SubMac::SubMac(Instance &aInstance)
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
, mCslTimer(aInstance)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
, mWedTimer(aInstance)
|
||||
#endif
|
||||
{
|
||||
@@ -96,7 +96,7 @@ void SubMac::Init(void)
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
CslInit();
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
WedInit();
|
||||
#endif
|
||||
}
|
||||
@@ -200,7 +200,7 @@ Error SubMac::Disable(void)
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
mCslTimer.Stop();
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
mWedTimer.Stop();
|
||||
#endif
|
||||
|
||||
@@ -217,7 +217,7 @@ Error SubMac::Sleep(void)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
if (IsRadioSampleEnabled())
|
||||
{
|
||||
RadioSample();
|
||||
@@ -308,7 +308,7 @@ Error SubMac::Send(void)
|
||||
#endif
|
||||
case kStateSleep:
|
||||
case kStateReceive:
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
case kStateRadioSample:
|
||||
#endif
|
||||
break;
|
||||
@@ -716,7 +716,7 @@ Error SubMac::EnergyScan(uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
|
||||
case kStateReceive:
|
||||
case kStateSleep:
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
case kStateRadioSample:
|
||||
#endif
|
||||
break;
|
||||
@@ -957,7 +957,7 @@ void SubMac::StartTimerAt(Time aStartTime, uint32_t aDelayUs)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
void SubMac::RadioSample(void)
|
||||
{
|
||||
@@ -999,7 +999,7 @@ bool SubMac::IsRadioSampleEnabled(void) const
|
||||
ret = IsCslEnabled();
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
ret = ret || mIsWedEnabled;
|
||||
#endif
|
||||
|
||||
@@ -1047,7 +1047,7 @@ void SubMac::UpdateRadioSampleState(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
if (mIsWedSampling)
|
||||
{
|
||||
IgnoreError(Get<Radio::Radio>().Receive(mWakeupChannel));
|
||||
@@ -1066,7 +1066,7 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
// LCOV_EXCL_START
|
||||
|
||||
@@ -1093,7 +1093,7 @@ const char *SubMac::StateToString(State aState)
|
||||
#define TimedTxStateMapList(_)
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
#define RadioSampleMapList(_) _(kStateRadioSample, "RadioSample")
|
||||
#else
|
||||
#define RadioSampleMapList(_)
|
||||
|
||||
+10
-10
@@ -67,8 +67,8 @@ namespace Mac {
|
||||
#error "OT_CONFIG_MAC_TARGET_TIME_TX_ENABLE MUST NOT be defined directly. It is derived from other configs"
|
||||
#endif
|
||||
|
||||
#define OT_CONFIG_MAC_TARGET_TIME_TX_ENABLE \
|
||||
(OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || \
|
||||
#define OT_CONFIG_MAC_TARGET_TIME_TX_ENABLE \
|
||||
(OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || \
|
||||
((OPENTHREAD_RADIO || OPENTHREAD_CONFIG_LINK_RAW_ENABLE) && OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE))
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
@@ -479,7 +479,7 @@ public:
|
||||
bool IsRadioFilterEnabled(void) const { return mRadioFilterEnabled; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Configures wake-up listening parameters in all radios.
|
||||
*
|
||||
@@ -552,13 +552,13 @@ private:
|
||||
#if OT_CONFIG_MAC_TARGET_TIME_TX_ENABLE
|
||||
kStateTimedTransmit, // Timed TX (e.g., for CSL)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
kStateRadioSample, // Mac layer has requested the SubMac to enter sleep state, but the SubMac is in the periodic
|
||||
// sample state.
|
||||
#endif
|
||||
};
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
// Radio on times needed before and after MHR time for proper frame detection
|
||||
static constexpr uint32_t kMinReceiveOnAhead = OPENTHREAD_CONFIG_MIN_RECEIVE_ON_AHEAD;
|
||||
static constexpr uint32_t kMinReceiveOnAfter = OPENTHREAD_CONFIG_MIN_RECEIVE_ON_AFTER;
|
||||
@@ -568,10 +568,10 @@ private:
|
||||
static constexpr uint32_t kCslReceiveTimeAhead = OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD;
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
// Margin to be applied after the end of a wake-up listen duration to schedule the next listen interval.
|
||||
// The value is in usec.
|
||||
static constexpr uint32_t kWedReceiveTimeAfter = OPENTHREAD_CONFIG_WED_RECEIVE_TIME_AFTER;
|
||||
static constexpr uint32_t kWedReceiveTimeAfter = 500;
|
||||
#endif
|
||||
|
||||
#if OT_CONFIG_MAC_TARGET_TIME_TX_ENABLE
|
||||
@@ -608,7 +608,7 @@ private:
|
||||
void SetState(State aState);
|
||||
static const char *StateToString(State aState);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
bool IsRadioSampleEnabled(void) const;
|
||||
void UpdateRadioSampleState(void);
|
||||
void RadioSample(void);
|
||||
@@ -633,7 +633,7 @@ private:
|
||||
void LogCslWindow(uint32_t aWinStart, uint32_t aWinDuration);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
void WedInit(void);
|
||||
void HandleWedTimer(void);
|
||||
void HandleWedReceiveAt(void);
|
||||
@@ -687,7 +687,7 @@ private:
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
using WedTimer = TimerMicroIn<SubMac, &SubMac::HandleWedTimer>;
|
||||
|
||||
bool mIsWedSampling : 1; // Indicates that the current time is in WED's sample window
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "sub_mac.hpp"
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
#include "instance/instance.hpp"
|
||||
|
||||
@@ -121,4 +121,4 @@ void SubMac::HandleWedReceiveOrSleep(void)
|
||||
} // namespace Mac
|
||||
} // namespace ot
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "wakeup_tx_scheduler.hpp"
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/log.hpp"
|
||||
@@ -168,4 +168,4 @@ void WakeupTxScheduler::HandleRadioBusLatencyChanged(void)
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
|
||||
#include "common/locator.hpp"
|
||||
#include "common/non_copyable.hpp"
|
||||
@@ -102,10 +102,10 @@ public:
|
||||
const Mac::WakeupRequest &GetWakeupRequest(void) const { return mWakeupRequest; }
|
||||
|
||||
private:
|
||||
constexpr static uint8_t kConnectionRetryInterval = OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_INTERVAL;
|
||||
constexpr static uint8_t kConnectionRetryCount = OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_COUNT;
|
||||
constexpr static uint8_t kConnectionRetryInterval = 1;
|
||||
constexpr static uint8_t kConnectionRetryCount = 12;
|
||||
constexpr static uint32_t kWakeupFrameLength = 54; // Includes SHR
|
||||
constexpr static bool kWakeupFrameTxCca = OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE;
|
||||
constexpr static bool kWakeupFrameTxCca = true;
|
||||
constexpr static uint32_t kParentRequestLength = 78; // Includes SHR
|
||||
|
||||
// Called by the MAC layer when a wake-up frame transmission is about to be started.
|
||||
@@ -132,6 +132,6 @@ private:
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
|
||||
#endif // OT_CORE_MAC_WAKEUP_TX_SCHEDULER_HPP_
|
||||
|
||||
@@ -189,7 +189,7 @@ Error DatasetManager::ApplyConfiguration(const Dataset &aDataset) const
|
||||
|
||||
case Tlv::kWakeupChannel:
|
||||
{
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
uint8_t channel = static_cast<uint8_t>(cur->ReadValueAs<WakeupChannelTlv>().GetChannel());
|
||||
error = Get<Mac::Mac>().SetWakeupChannel(channel);
|
||||
|
||||
|
||||
@@ -109,10 +109,10 @@
|
||||
#include "config/sntp_client.h"
|
||||
#include "config/srp_client.h"
|
||||
#include "config/srp_server.h"
|
||||
#include "config/thread_direct.h"
|
||||
#include "config/time_sync.h"
|
||||
#include "config/tmf.h"
|
||||
#include "config/trel.h"
|
||||
#include "config/wakeup.h"
|
||||
// IWYU pragma: end_exports
|
||||
|
||||
#undef OPENTHREAD_CORE_CONFIG_H_IN
|
||||
|
||||
@@ -80,7 +80,7 @@ constexpr uint64_t kMinCslPeriod = OPENTHREAD_CONFIG_MAC_CSL_MIN_PERIOD * 1000
|
||||
constexpr uint64_t kMaxCslTimeout = OPENTHREAD_CONFIG_MAC_CSL_MAX_TIMEOUT;
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Minimum wake-up listen duration supported in microseconds.
|
||||
*/
|
||||
@@ -574,7 +574,7 @@ public:
|
||||
*/
|
||||
Error Receive(uint8_t aChannel);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Schedules a radio reception window at a specific time and duration.
|
||||
*
|
||||
@@ -990,7 +990,7 @@ inline Error Radio::Receive(uint8_t aChannel)
|
||||
return otPlatRadioReceive(GetInstancePtr(), aChannel);
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
inline Error Radio::ReceiveAt(uint8_t aChannel, Time32 aStart, uint32_t aDuration)
|
||||
{
|
||||
Error error = otPlatRadioReceiveAt(GetInstancePtr(), aChannel, aStart, aDuration);
|
||||
@@ -1104,7 +1104,7 @@ inline Error Radio::Sleep(void) { return kErrorNone; }
|
||||
|
||||
inline Error Radio::Receive(uint8_t) { return kErrorNone; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
inline Error Radio::ReceiveAt(uint8_t, uint32_t, uint32_t) { return kErrorNone; }
|
||||
#endif
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ void Callbacks::HandleBusLatencyChanged(void)
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE && (OPENTHREAD_FTD || OPENTHREAD_MTD)
|
||||
Get<CslTxScheduler>().HandleRadioBusLatencyChanged();
|
||||
#endif
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
Get<WakeupTxScheduler>().HandleRadioBusLatencyChanged();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Radio {
|
||||
|
||||
#define OT_CONFIG_RADIO_TIME_ENABLE \
|
||||
(OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE || \
|
||||
OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE || OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || \
|
||||
OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || \
|
||||
OPENTHREAD_CONFIG_TIME_SYNC_ENABLE || \
|
||||
((OPENTHREAD_RADIO || OPENTHREAD_CONFIG_LINK_RAW_ENABLE) && OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE))
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ Mle::Mle(Instance &aInstance)
|
||||
#if OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE
|
||||
, mParentSearch(aInstance)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
, mWakeupTxScheduler(aInstance)
|
||||
, mWedAttachState(kWedDetached)
|
||||
, mWedAttachTimer(aInstance)
|
||||
@@ -1810,7 +1810,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
case kCommandP2pLinkRequest:
|
||||
mP2p.HandleP2pLinkRequest(rxInfo);
|
||||
break;
|
||||
@@ -1820,7 +1820,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
case kCommandP2pLinkAcceptAndRequest:
|
||||
mP2p.HandleP2pLinkAcceptAndRequest(rxInfo);
|
||||
break;
|
||||
@@ -3056,7 +3056,7 @@ uint64_t Mle::CalcParentCslMetric(const Mac::CslAccuracy &aCslAccuracy) const
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
void Mle::HandleWedAttachTimer(void)
|
||||
{
|
||||
switch (mWedAttachState)
|
||||
@@ -3104,9 +3104,9 @@ Error Mle::Wakeup(const Mac::ExtAddress &aWedAddress,
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
void Mle::HandleWakeupFrame(const Mac::WakeupInfo &aWakeupInfo)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aWakeupInfo);
|
||||
|
||||
+14
-14
@@ -763,7 +763,7 @@ public:
|
||||
bool IsCslSupported(void) const;
|
||||
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
/**
|
||||
* Attempts to wake a Wake-up End Device.
|
||||
*
|
||||
@@ -782,7 +782,7 @@ public:
|
||||
uint16_t aDurationMs,
|
||||
WakeupCallback aCallback,
|
||||
void *aCallbackContext);
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
/**
|
||||
@@ -1229,7 +1229,7 @@ public:
|
||||
#endif // OPENTHREAD_FTD
|
||||
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
/**
|
||||
* Attempts to wake up peers and establish P2P links with peers.
|
||||
*
|
||||
@@ -1278,7 +1278,7 @@ public:
|
||||
void P2pSetEventCallback(P2pEventCallback aCallback, void *aContext) { mP2p.SetEventCallback(aCallback, aContext); }
|
||||
#endif // OPENTHREAD_CONFIG_P2P_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
/**
|
||||
* Notifies MLE that a wake-up frame was received successfully.
|
||||
*
|
||||
@@ -1570,7 +1570,7 @@ private:
|
||||
#endif
|
||||
};
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
enum WedAttachState : uint8_t
|
||||
{
|
||||
kWedDetached,
|
||||
@@ -2378,12 +2378,12 @@ private:
|
||||
public:
|
||||
P2p(Instance &aInstance);
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
Error WakeupAndLink(const P2pRequest &aP2pRequest, P2pLinkDoneCallback aCallback, void *aContext);
|
||||
void HandleP2pLinkRequest(RxInfo &aRxInfo);
|
||||
void HandleP2pLinkAccept(RxInfo &aRxInfo);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
void HandleP2pWakeup(const Mac::WakeupInfo &aWakeupInfo);
|
||||
void HandleP2pLinkAcceptAndRequest(RxInfo &aRxInfo);
|
||||
#endif
|
||||
@@ -2394,8 +2394,8 @@ private:
|
||||
void HandleLinkTimer(void);
|
||||
|
||||
private:
|
||||
static constexpr uint16_t kWakeupMaxDuration = OPENTHREAD_CONFIG_WAKEUP_MAX_DURATION;
|
||||
static constexpr uint16_t kWakeupTxInterval = OPENTHREAD_CONFIG_WAKEUP_TX_INTERVAL;
|
||||
static constexpr uint16_t kWakeupMaxDuration = 1090;
|
||||
static constexpr uint16_t kWakeupTxInterval = 7500;
|
||||
static constexpr uint32_t kEstablishP2pLinkTimeoutUs = 500000;
|
||||
|
||||
enum State : uint8_t
|
||||
@@ -2408,12 +2408,12 @@ private:
|
||||
kStateTearingDown,
|
||||
};
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
void SendP2pLinkRequest(Peer *aPeer);
|
||||
Error SendP2pLinkAccept(const LinkAcceptInfo &aInfo);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
Error SendP2pLinkAcceptAndRequest(const LinkAcceptInfo &aInfo);
|
||||
#endif
|
||||
|
||||
@@ -2527,7 +2527,7 @@ private:
|
||||
static void Log(MessageAction, MessageType, const Ip6::Address &, uint16_t) {}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
void HandleWedAttachTimer(void);
|
||||
#endif
|
||||
|
||||
@@ -2618,7 +2618,7 @@ private:
|
||||
// Variables
|
||||
|
||||
using MleSocket = Ip6::Udp::SocketIn<Mle, &Mle::HandleUdpReceive>;
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
using WedAttachTimer = TimerMicroIn<Mle, &Mle::HandleWedAttachTimer>;
|
||||
#endif
|
||||
|
||||
@@ -2661,7 +2661,7 @@ private:
|
||||
Ip6::Netif::MulticastAddress mLinkLocalAllThreadNodes;
|
||||
Ip6::Netif::MulticastAddress mRealmLocalAllThreadNodes;
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
WakeupTxScheduler mWakeupTxScheduler;
|
||||
WedAttachState mWedAttachState;
|
||||
WedAttachTimer mWedAttachTimer;
|
||||
|
||||
+10
-10
@@ -34,9 +34,9 @@
|
||||
#include "mle.hpp"
|
||||
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE
|
||||
#if !(OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE)
|
||||
#error "OPENTHREAD_CONFIG_P2P_ENABLE requires OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE or "\
|
||||
"OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE"
|
||||
#if !(OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE)
|
||||
#error "OPENTHREAD_CONFIG_P2P_ENABLE requires OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE or "\
|
||||
"OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE"
|
||||
#endif
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
@@ -60,7 +60,7 @@ Mle::P2p::P2p(Instance &aInstance)
|
||||
{
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
Error Mle::P2p::WakeupAndLink(const P2pRequest &aP2pRequest, P2pLinkDoneCallback aCallback, void *aContext)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
@@ -135,7 +135,7 @@ Error Mle::P2p::SendP2pLinkAcceptAndRequest(const LinkAcceptInfo &aInfo)
|
||||
void Mle::P2p::HandleP2pLinkAccept(RxInfo &aRxInfo) { HandleP2pLinkAcceptVariant(aRxInfo, kTypeP2pLinkAccept); }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
void Mle::P2p::HandleP2pWakeup(const Mac::WakeupInfo &aWakeupInfo)
|
||||
{
|
||||
Peer *peer = nullptr;
|
||||
@@ -212,7 +212,7 @@ Error Mle::P2p::SendP2pLinkAccept(const LinkAcceptInfo &aInfo)
|
||||
{
|
||||
return SendP2pLinkAcceptVariant(aInfo, false /* aIsLinkAcceptAndRequest*/);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
|
||||
Error Mle::P2p::SendP2pLinkAcceptVariant(const LinkAcceptInfo &aInfo, bool aIsLinkAcceptAndRequest)
|
||||
{
|
||||
@@ -319,7 +319,7 @@ void Mle::P2p::HandleP2pLinkAcceptVariant(RxInfo &aRxInfo, MessageType aMessageT
|
||||
info.mExtAddress = aRxInfo.mNeighbor->GetExtAddress();
|
||||
info.mLinkMargin = Get<Mac::Mac>().ComputeLinkMargin(aRxInfo.mMessage.GetAverageRss());
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
SuccessOrExit(error = SendP2pLinkAccept(info));
|
||||
#endif
|
||||
}
|
||||
@@ -451,7 +451,7 @@ void Mle::P2p::HandleLinkTimer(void)
|
||||
{
|
||||
switch (mState)
|
||||
{
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
case kStateWakingUp:
|
||||
case kStateWaitingLinkAccept:
|
||||
{
|
||||
@@ -467,7 +467,7 @@ void Mle::P2p::HandleLinkTimer(void)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
case kStateAttachDelay:
|
||||
SendP2pLinkRequest(mPeer);
|
||||
break;
|
||||
@@ -488,7 +488,7 @@ void Mle::P2p::HandleLinkTimer(void)
|
||||
|
||||
void Mle::P2p::SetWakeupListenerEnabled(void)
|
||||
{
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
// The wake-up listener is disabled after a wake-up frame is received, here enables the wake-up listener again.
|
||||
IgnoreError(Get<Mac::Mac>().SetWakeupListenEnabled(true));
|
||||
#endif
|
||||
|
||||
@@ -1002,7 +1002,7 @@ inline bool IsChildRloc16(uint16_t aRloc16) { return ChildIdFromRloc16(aRloc16)
|
||||
*/
|
||||
const char *RoleToString(DeviceRole aRole);
|
||||
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
/**
|
||||
* Represents a P2P request.
|
||||
*/
|
||||
@@ -1016,7 +1016,7 @@ public:
|
||||
*/
|
||||
const Mac::WakeupRequest &GetWakeupRequest(void) const { return AsCoreType(&mWakeupRequest); }
|
||||
};
|
||||
#endif // OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -1030,7 +1030,7 @@ DefineMapEnum(otDeviceRole, Mle::DeviceRole);
|
||||
DefineCoreType(otDeviceProperties, Mle::DeviceProperties);
|
||||
DefineMapEnum(otPowerSupply, Mle::DeviceProperties::PowerSupply);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#if OPENTHREAD_CONFIG_P2P_ENABLE && OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
DefineCoreType(otP2pRequest, Mle::P2pRequest);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey)
|
||||
OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_THREAD_ACTIVE_DATASET_TLVS),
|
||||
OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_THREAD_PENDING_DATASET_TLVS),
|
||||
OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET_TLVS),
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_THREAD_WAKEUP_CHANNEL),
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
|
||||
@@ -661,7 +661,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey)
|
||||
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_ACTIVE_DATASET_TLVS),
|
||||
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_PENDING_DATASET_TLVS),
|
||||
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET_TLVS),
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_WAKEUP_CHANNEL),
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
|
||||
|
||||
@@ -4828,7 +4828,7 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE
|
||||
template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_WAKEUP_CHANNEL>(void)
|
||||
{
|
||||
uint8_t wakeupChannel;
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE
|
||||
#endif
|
||||
|
||||
#ifndef OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US
|
||||
|
||||
@@ -33,7 +33,7 @@ $ git clone [email protected]:openthread/ot-nrf528xx.git
|
||||
$ cd ot-nrf528xx/
|
||||
$ git submodule update --init
|
||||
$ ./script/bootstrap
|
||||
$ ./script/build nrf52840 UART_trans -DOT_DIAGNOSTIC=ON -DOT_CSL_RECEIVER=ON -DOT_LINK_METRICS_INITIATOR=ON -DOT_LINK_METRICS_SUBJECT=ON -DOT_WAKEUP_COORDINATOR=ON
|
||||
$ ./script/build nrf52840 UART_trans -DOT_DIAGNOSTIC=ON -DOT_CSL_RECEIVER=ON -DOT_LINK_METRICS_INITIATOR=ON -DOT_LINK_METRICS_SUBJECT=ON -DOT_WAKE_INITIATOR=ON
|
||||
$ arm-none-eabi-objcopy -O ihex build/bin/ot-cli-ftd ot-cli-ftd.hex
|
||||
$ nrfutil device program --firmware ot-cli-ftd.hex --options chip_erase_mode=ERASE_ALL
|
||||
$ nrfutil device reset --reset-kind=RESET_PIN
|
||||
|
||||
Reference in New Issue
Block a user