fix)wifi): Add GTK rekeying interval field in softap example

This commit is contained in:
tarun.kumar
2025-04-13 20:38:59 +05:30
committed by Jack
parent 60ab2598c5
commit 253ca4267a
3 changed files with 22 additions and 1 deletions

View File

@ -23,4 +23,18 @@ menu "Example Configuration"
default 4 default 4
help help
Max number of the STA connects to AP. Max number of the STA connects to AP.
config ESP_GTK_REKEYING_ENABLE
bool "Enable GTK Rekeying"
default y
help
Flag to enable GTK rekeying.
config ESP_GTK_REKEY_INTERVAL
int "GTK rekey interval"
depends on ESP_GTK_REKEYING_ENABLE
range 60 65535
default 600
help
GTK rekeying interval in seconds.
endmenu endmenu

View File

@ -28,6 +28,12 @@
#define EXAMPLE_ESP_WIFI_CHANNEL CONFIG_ESP_WIFI_CHANNEL #define EXAMPLE_ESP_WIFI_CHANNEL CONFIG_ESP_WIFI_CHANNEL
#define EXAMPLE_MAX_STA_CONN CONFIG_ESP_MAX_STA_CONN #define EXAMPLE_MAX_STA_CONN CONFIG_ESP_MAX_STA_CONN
#if CONFIG_ESP_GTK_REKEYING_ENABLE
#define EXAMPLE_GTK_REKEY_INTERVAL CONFIG_ESP_GTK_REKEY_INTERVAL
#else
#define EXAMPLE_GTK_REKEY_INTERVAL 0
#endif
static const char *TAG = "wifi softAP"; static const char *TAG = "wifi softAP";
static void wifi_event_handler(void* arg, esp_event_base_t event_base, static void wifi_event_handler(void* arg, esp_event_base_t event_base,
@ -81,6 +87,7 @@ void wifi_init_softap(void)
.protected_keep_alive = 1, .protected_keep_alive = 1,
}, },
#endif #endif
.gtk_rekey_interval = EXAMPLE_GTK_REKEY_INTERVAL,
}, },
}; };
if (strlen(EXAMPLE_ESP_WIFI_PASS) == 0) { if (strlen(EXAMPLE_ESP_WIFI_PASS) == 0) {