ieee802154: add sleep state

This commit is contained in:
xiaqilin
2023-06-01 14:31:03 +08:00
parent 4f537d3b98
commit b4d951fa6a
19 changed files with 64 additions and 167 deletions

View File

@@ -18,14 +18,6 @@ examples/openthread/ot_cli:
temporary: true
reason: only test on esp32h2
examples/openthread/ot_power_save:
enable:
- if: IDF_TARGET == "esp32c6"
disable_test:
- if: IDF_TARGET in ["esp32h2", "esp32c6"]
temporary: true
reason: No support # TO-DO: TZ-134
examples/openthread/ot_rcp:
enable:
- if: IDF_TARGET in ["esp32h2", "esp32c6"]
@@ -33,3 +25,11 @@ examples/openthread/ot_rcp:
- if: IDF_TARGET == "esp32h2"
temporary: true
reason: only test on esp32c6
examples/openthread/ot_sleepy_device:
enable:
- if: IDF_TARGET == "esp32c6"
disable_test:
- if: IDF_TARGET in ["esp32h2", "esp32c6"]
temporary: true
reason: No support # TO-DO: TZ-134

View File

@@ -12,4 +12,4 @@ In this folder, it contains following OpenThread examples:
* [ot_br](ot_br) is an [OpenThread Border Router](https://openthread.io/guides/border-router) example. It runs on a Wi-Fi SoC such as ESP32, ESP32-C3 and ESP32-S3. It needs an 802.15.4 SoC like ESP32-H2 running [ot_rcp](ot_rcp) example to provide 802.15.4 radio.
* [ot_power_save](ot_power_save) is an OpenThread Power save example, it supports 802.15.4 radio light sleep. It runs on an 802.15.4 SoC like ESP32-C6.
* [ot_sleepy_device](ot_sleepy_device) is an OpenThread sleepy device example, it supports 802.15.4 radio light sleep. It runs on an 802.15.4 SoC like ESP32-C6.

View File

@@ -1,2 +0,0 @@
idf_component_register(SRCS "esp_ot_power_save.c"
INCLUDE_DIRS ".")

View File

@@ -3,4 +3,4 @@
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ot_power_save)
project(ot_sleepy_device)

View File

@@ -1,9 +1,9 @@
| Supported Targets | ESP32-C6 |
| ----------------- | -------- |
# OpenThread Power Save Example
# OpenThread Sleepy Device Example
The example demonstrates the OpenThread Power Save based on light sleep, which reduces power consumption by turning off RF, PHY, BB, and IEEE802154 MAC during the sleep state.
The example demonstrates the Thread Sleepy End Device (SED), the device will enter [Light Sleep mode](https://docs.espressif.com/projects/esp-idf/en/latest/esp32h2/api-reference/system/sleep_modes.html#sleep-modes) during idle state.
## How to use example
### Hardware Required

View File

@@ -0,0 +1,2 @@
idf_component_register(SRCS "esp_ot_sleepy_device.c"
INCLUDE_DIRS ".")

View File

@@ -22,7 +22,7 @@
#include "esp_log.h"
#include "esp_openthread.h"
#include "esp_openthread_netif_glue.h"
#include "esp_ot_power_save_config.h"
#include "esp_ot_sleepy_device_config.h"
#include "esp_vfs_eventfd.h"
#include "driver/uart.h"
#include "nvs_flash.h"
@@ -34,7 +34,7 @@
#endif
#if !SOC_IEEE802154_SUPPORTED
#error "Power save is only supported for the SoCs which have IEEE 802.15.4 module"
#error "Openthread sleepy device is only supported for the SoCs which have IEEE 802.15.4 module"
#endif
#define TAG "ot_esp_power_save"