From 2d34a93dc4c44a324c27e0ca291770dbd1a191c1 Mon Sep 17 00:00:00 2001 From: qiyuexia Date: Wed, 31 Oct 2018 21:11:57 +0800 Subject: [PATCH] mesh: update libs 1. fix ap_loss that occurs when the parent turns off the mesh function and becomes a normal WiFi with a different SSID. 2. add an event MESH_EVENT_NETWORK_STATE that contains information about whether there is a root in the current network. 3. modify the mechanism of mesh IE update. 4. fix a problem in the process of re-voting to select the root, the device that does not meet the conditions of being a root votes for itself. 5. fix an issue that occurs in esp_mesh_recv_toDS() when stopping the mesh. 6. when the user specifies a parent for the device, the device will set the authmode and password of its AP mode to the same value as the specified parent. 7. add two disconnected reason codes MESH_REASON_EMPTY_PASSWORD and MESH_REASON_PARENT_UNENCRYPTED. --- components/esp32/include/esp_mesh.h | 28 +++++++++++++++++++++------- components/esp32/lib | 2 +- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/components/esp32/include/esp_mesh.h b/components/esp32/include/esp_mesh.h index 803b55329..365b9e6f4 100644 --- a/components/esp32/include/esp_mesh.h +++ b/components/esp32/include/esp_mesh.h @@ -185,6 +185,7 @@ typedef enum { Fixed Root Setting of each device is variable as that setting changes of the root. */ MESH_EVENT_SCAN_DONE, /**< if self-organized networking is disabled, user can call esp_wifi_scan_start() to trigger this event, and add the corresponding scan done handler in this event. */ + MESH_EVENT_NETWORK_STATE, /**< network state, such as whether current mesh network has a root. */ MESH_EVENT_MAX, } mesh_event_id_t; @@ -229,13 +230,18 @@ typedef enum { * @brief Mesh disconnect reason code */ typedef enum { - MESH_REASON_CYCLIC = 100, /**< cyclic is detected */ - MESH_REASON_PARENT_IDLE, /**< parent is idle */ - MESH_REASON_LEAF, /**< the connected device is changed to a leaf */ - MESH_REASON_DIFF_ID, /**< in different mesh ID */ - MESH_REASON_ROOTS, /**< root conflict is detected */ - MESH_REASON_PARENT_STOPPED, /**< parent has stopped the mesh */ - MESH_REASON_SCAN_FAIL, /**< scan fail */ + MESH_REASON_CYCLIC = 100, /**< cyclic is detected */ + MESH_REASON_PARENT_IDLE, /**< parent is idle */ + MESH_REASON_LEAF, /**< the connected device is changed to a leaf */ + MESH_REASON_DIFF_ID, /**< in different mesh ID */ + MESH_REASON_ROOTS, /**< root conflict is detected */ + MESH_REASON_PARENT_STOPPED, /**< parent has stopped the mesh */ + MESH_REASON_SCAN_FAIL, /**< scan fail */ + MESH_REASON_IE_UNKNOWN, /**< unknown IE */ + MESH_REASON_WAIVE_ROOT, /**< waive root */ + MESH_REASON_PARENT_WORSE, /**< parent with very poor RSSI */ + MESH_REASON_EMPTY_PASSWORD, /**< use an empty password to connect to an encrypted parent */ + MESH_REASON_PARENT_UNENCRYPTED, /**< connect to an unencrypted parent/router */ } mesh_disconnect_reason_t; /******************************************************* @@ -367,6 +373,13 @@ typedef struct { uint8_t number; /**< the number of APs scanned */ } mesh_event_scan_done_t; +/** + * @brief Network state information + */ +typedef struct { + bool is_rootless; /**< whether current mesh network has a root */ +} mesh_event_network_state_t; + /** * @brief Mesh event information */ @@ -390,6 +403,7 @@ typedef union { mesh_event_root_conflict_t root_conflict; /**< other powerful root */ mesh_event_root_fixed_t root_fixed; /**< fixed root */ mesh_event_scan_done_t scan_done; /**< scan done */ + mesh_event_network_state_t network_state; /**< network state, such as whether current mesh network has a root. */ } mesh_event_info_t; /** diff --git a/components/esp32/lib b/components/esp32/lib index ee0d0b152..e8e4affd6 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit ee0d0b152f4101ec42ef458f176773b9b7d791e5 +Subproject commit e8e4affd6a96bb5333e6a04ec93da43b4a5d7156