mesh: add duty cycle control and support only transmit/receive in actve duty cycle

This commit is contained in:
qiyuexia
2020-04-30 21:40:38 +08:00
parent ad60568151
commit 4522ef8798
9 changed files with 266 additions and 58 deletions

View File

@@ -16,6 +16,7 @@
#define __ESP_MESH_INTERNAL_H__
#include "esp_err.h"
#include "esp_mesh.h"
#include "esp_wifi.h"
#include "esp_wifi_types.h"
#include "esp_private/wifi.h"
@@ -96,6 +97,19 @@ typedef struct {
uint8_t toDS; /**< toDS state */
} __attribute__((packed)) mesh_assoc_t;
/**
* @brief Mesh PS duties
*/
typedef struct {
uint8_t device;
uint8_t parent;
struct {
bool used;
uint8_t duty;
uint8_t mac[6];
} child[ESP_WIFI_MAX_CONN_NUM];
} esp_mesh_ps_duties_t;
/*******************************************************
* Function Definitions
*******************************************************/
@@ -263,6 +277,14 @@ esp_err_t esp_mesh_set_announce_interval(int short_ms, int long_ms);
*/
esp_err_t esp_mesh_get_announce_interval(int *short_ms, int *long_ms);
/**
* @brief Get the running duties of device, parent and children
*
* @return
* - ESP_OK
*/
esp_err_t esp_mesh_ps_get_duties(esp_mesh_ps_duties_t* ps_duties);
#ifdef __cplusplus
}
#endif