mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
fix(wifi/mesh): update the mesh ip_internal_network example
This commit is contained in:
@ -64,6 +64,12 @@ menu "Example Configuration"
|
|||||||
help
|
help
|
||||||
The number of non-mesh stations allowed to connect in.
|
The number of non-mesh stations allowed to connect in.
|
||||||
|
|
||||||
|
config MESH_IE_ENCRYPTED
|
||||||
|
bool "Mesh IE encrypted"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
The mesh IE is encrypted by default.
|
||||||
|
|
||||||
config MESH_MAX_LAYER
|
config MESH_MAX_LAYER
|
||||||
int "Mesh Max Layer"
|
int "Mesh Max Layer"
|
||||||
range 1 25
|
range 1 25
|
||||||
|
@ -405,7 +405,12 @@ void app_main(void)
|
|||||||
ESP_ERROR_CHECK(esp_mesh_set_max_layer(CONFIG_MESH_MAX_LAYER));
|
ESP_ERROR_CHECK(esp_mesh_set_max_layer(CONFIG_MESH_MAX_LAYER));
|
||||||
ESP_ERROR_CHECK(esp_mesh_set_vote_percentage(1));
|
ESP_ERROR_CHECK(esp_mesh_set_vote_percentage(1));
|
||||||
ESP_ERROR_CHECK(esp_mesh_set_ap_assoc_expire(10));
|
ESP_ERROR_CHECK(esp_mesh_set_ap_assoc_expire(10));
|
||||||
|
/* set blocking time of esp_mesh_send() to 30s, to prevent the esp_mesh_send() from permanently for some reason */
|
||||||
|
ESP_ERROR_CHECK(esp_mesh_send_block_time(30000));
|
||||||
mesh_cfg_t cfg = MESH_INIT_CONFIG_DEFAULT();
|
mesh_cfg_t cfg = MESH_INIT_CONFIG_DEFAULT();
|
||||||
|
#if !MESH_IE_ENCRYPTED
|
||||||
|
cfg.crypto_funcs = NULL;
|
||||||
|
#endif
|
||||||
/* mesh ID */
|
/* mesh ID */
|
||||||
memcpy((uint8_t *) &cfg.mesh_id, MESH_ID, 6);
|
memcpy((uint8_t *) &cfg.mesh_id, MESH_ID, 6);
|
||||||
/* router */
|
/* router */
|
||||||
|
Reference in New Issue
Block a user