Skip to content

Commit

Permalink
[mac] multipurpose wake-up frame support (#10728)
Browse files Browse the repository at this point in the history
1. Add OT_WAKEUP_COORDINATOR and OT_WAKEUP_END_DEVICE build
   options.
2. Add support for parsing and constructing 802.15.4
   Multipurpose frames.
3. Add support for parsing and constructing wake-up
   frames.
  • Loading branch information
Damian-Nordic authored Sep 23, 2024
1 parent b605bb9 commit bc50521
Show file tree
Hide file tree
Showing 11 changed files with 886 additions and 147 deletions.
1 change: 1 addition & 0 deletions doc/ot_config_doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
* @defgroup config-time-sync Time Sync Service
* @defgroup config-tmf Thread Management Framework Service
* @defgroup config-trel TREL
* @defgroup config-wakeup Wake-up
*
* @}
*
Expand Down
2 changes: 2 additions & 0 deletions etc/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,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")

option(OT_DOC "build OpenThread documentation")
message(STATUS "- - - - - - - - - - - - - - - - ")
Expand Down
2 changes: 2 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ build_simulation()
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
options+=("-DOT_LINK_METRICS_MANAGER=ON")
options+=("-DOT_WAKEUP_COORDINATOR=ON")
options+=("-DOT_WAKEUP_END_DEVICE=ON")
fi

if [[ ${OT_NODE_TYPE} == cli* ]]; then
Expand Down
1 change: 1 addition & 0 deletions src/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ source_set("libopenthread_core_config") {
"config/time_sync.h",
"config/tmf.h",
"config/trel.h",
"config/wakeup.h",
"openthread-core-config.h",
]
public_configs = [
Expand Down
12 changes: 12 additions & 0 deletions src/core/config/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
*/

#include "config/time_sync.h"
#include "config/wakeup.h"

/**
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
Expand Down Expand Up @@ -435,6 +436,17 @@
#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 0
#endif

/**
* @def OPENTHREAD_CONFIG_MAC_MULTIPURPOSE_FRAME
*
* Define to 1 to enable support for IEEE 802.15.4 MAC Multipurpose frame format.
*
*/
#ifndef OPENTHREAD_CONFIG_MAC_MULTIPURPOSE_FRAME
#define OPENTHREAD_CONFIG_MAC_MULTIPURPOSE_FRAME \
(OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE)
#endif

/**
* @def OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE
*
Expand Down
75 changes: 75 additions & 0 deletions src/core/config/wakeup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* 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 CONFIG_WAKEUP_H_
#define 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_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

/**
* @}
*
*/

#endif // CONFIG_WAKEUP_H_
Loading

0 comments on commit bc50521

Please sign in to comment.