mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-03 00:21:44 +01:00
esp_wifi: wifi support new event mechanism
1. WiFi support new event mechanism 2. Update examples to use new event mechanism
This commit is contained in:
@@ -281,7 +281,7 @@ typedef struct {
|
||||
* @brief Parent connected information
|
||||
*/
|
||||
typedef struct {
|
||||
system_event_sta_connected_t connected; /**< parent information, same as Wi-Fi event SYSTEM_EVENT_STA_CONNECTED does */
|
||||
wifi_event_sta_connected_t connected; /**< parent information, same as Wi-Fi event SYSTEM_EVENT_STA_CONNECTED does */
|
||||
uint8_t self_layer; /**< layer */
|
||||
} mesh_event_connected_t;
|
||||
|
||||
@@ -324,11 +324,6 @@ typedef struct {
|
||||
uint8_t router_bssid[6]; /**< router BSSID */
|
||||
} mesh_event_find_network_t;
|
||||
|
||||
/**
|
||||
* @brief IP settings from LwIP stack
|
||||
*/
|
||||
typedef system_event_sta_got_ip_t mesh_event_root_got_ip_t;
|
||||
|
||||
/**
|
||||
* @brief Root address
|
||||
*/
|
||||
@@ -337,17 +332,17 @@ typedef mesh_addr_t mesh_event_root_address_t;
|
||||
/**
|
||||
* @brief Parent disconnected information
|
||||
*/
|
||||
typedef system_event_sta_disconnected_t mesh_event_disconnected_t;
|
||||
typedef wifi_event_sta_disconnected_t mesh_event_disconnected_t;
|
||||
|
||||
/**
|
||||
* @brief Child connected information
|
||||
*/
|
||||
typedef system_event_ap_staconnected_t mesh_event_child_connected_t;
|
||||
typedef wifi_event_ap_staconnected_t mesh_event_child_connected_t;
|
||||
|
||||
/**
|
||||
* @brief Child disconnected information
|
||||
*/
|
||||
typedef system_event_ap_stadisconnected_t mesh_event_child_disconnected_t;
|
||||
typedef wifi_event_ap_stadisconnected_t mesh_event_child_disconnected_t;
|
||||
|
||||
/**
|
||||
* @brief Root switch request information
|
||||
@@ -398,7 +393,7 @@ typedef struct {
|
||||
/**
|
||||
* @brief New router information
|
||||
*/
|
||||
typedef system_event_sta_connected_t mesh_event_router_switch_t;
|
||||
typedef wifi_event_sta_connected_t mesh_event_router_switch_t;
|
||||
|
||||
/**
|
||||
* @brief Mesh event information
|
||||
@@ -417,7 +412,7 @@ typedef union {
|
||||
packets out. If not, devices had better to wait until this state changes to be
|
||||
MESH_TODS_REACHABLE. */
|
||||
mesh_event_vote_started_t vote_started; /**< vote started */
|
||||
mesh_event_root_got_ip_t got_ip; /**< root obtains IP address */
|
||||
//mesh_event_root_got_ip_t got_ip; /**< root obtains IP address */
|
||||
mesh_event_root_address_t root_addr; /**< root address */
|
||||
mesh_event_root_switch_req_t switch_req; /**< root switch request */
|
||||
mesh_event_root_conflict_t root_conflict; /**< other powerful root */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
|
||||
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
|
||||
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -190,7 +190,7 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
|
||||
#endif
|
||||
|
||||
#define WIFI_INIT_CONFIG_DEFAULT() { \
|
||||
.event_handler = &esp_event_send, \
|
||||
.event_handler = &esp_event_send_internal, \
|
||||
.osi_funcs = &g_wifi_osi_funcs, \
|
||||
.wpa_crypto_funcs = g_wifi_default_wpa_crypto_funcs, \
|
||||
.static_rx_buf_num = CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM,\
|
||||
|
||||
@@ -509,8 +509,9 @@ typedef enum {
|
||||
WIFI_EVENT_AP_STOP, /**< ESP32 soft-AP stop */
|
||||
WIFI_EVENT_AP_STACONNECTED, /**< a station connected to ESP32 soft-AP */
|
||||
WIFI_EVENT_AP_STADISCONNECTED, /**< a station disconnected from ESP32 soft-AP */
|
||||
|
||||
WIFI_EVENT_AP_PROBEREQRECVED, /**< Receive probe request packet in soft-AP interface */
|
||||
|
||||
WIFI_EVENT_MAX, /**< Invalid WiFi event ID */
|
||||
} wifi_event_t;
|
||||
|
||||
/** @cond **/
|
||||
|
||||
Reference in New Issue
Block a user