From 33bc3d4770d5ec8b7712e25205ae42c387bed985 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 20 Oct 2026 15:29:26 +1300 Subject: [PATCH] Use WIFI_IF_STA / WIFI_IF_AP for esp_wifi_get_protocol / esp_wifi_get_config ESP-IDF 4.x (arduino-esp32 2.x) changed these functions to take a wifi_interface_t, so ESP_IF_WIFI_STA / ESP_IF_WIFI_AP (esp_interface_t) no longer compile. WIFI_IF_STA / WIFI_IF_AP exist in both IDF 3.3 (as defines of ESP_IF_WIFI_*) and IDF 4.4 (as the enum), so this builds on arduino-esp32 1.0.x and 2.x. --- src/command.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index c945f51..7078fc3 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -1262,7 +1262,7 @@ bool COMMAND::execute_internal_command (int cmd, String cmd_params, level_authen espresponse->print ("%"); espresponse->print ("\n"); uint8_t PhyMode; - esp_wifi_get_protocol (ESP_IF_WIFI_STA, &PhyMode); + esp_wifi_get_protocol (WIFI_IF_STA, &PhyMode); espresponse->print ("Phy Mode: "); if (PhyMode == (WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N)) { espresponse->print ("11n"); @@ -1310,7 +1310,7 @@ bool COMMAND::execute_internal_command (int cmd, String cmd_params, level_authen espresponse->print (")"); espresponse->print ("\n"); wifi_config_t conf; - esp_wifi_get_config (ESP_IF_WIFI_AP, &conf); + esp_wifi_get_config (WIFI_IF_AP, &conf); espresponse->print ("SSID: "); espresponse->print ((const char*) conf.ap.ssid); espresponse->print ("\n");