Repository navigation
Use WIFI_IF_STA / WIFI_IF_AP for esp_wifi_get_protocol / esp_wifi_get… - #96
Conversation
…_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.
|
Thank you for the fix: FYI: EDIT: seems platformio resume support for arduino-esp32 starting IDF 5.5.5 with release 8.0, I will add update support when necessary |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
The WIFI_IF_STA / WIFI_IF_AP fix for ESP-IDF 4.4 is merged upstream, so pin ESP3DLib to that merge instead of the fork.
Title: Use WIFI_IF_STA / WIFI_IF_AP for esp_wifi_get_protocol / esp_wifi_get_config
ESP3DLib doesn't compile with arduino-esp32 2.x (ESP-IDF 4.4), for example PlatformIO espressif32@6.1.0:
src/command.cpp:1265: error: cannot convert 'esp_interface_t' to 'wifi_interface_t'
src/command.cpp:1313: error: cannot convert 'esp_interface_t' to 'wifi_interface_t'
In ESP-IDF 4.x, esp_wifi_get_protocol() and esp_wifi_get_config() take a wifi_interface_t, so ESP_IF_WIFI_STA / ESP_IF_WIFI_AP (esp_interface_t) no longer convert. This PR uses WIFI_IF_STA / WIFI_IF_AP instead. Those names exist in every core version tested:
arduino-esp32 1.0.4 and 1.0.6 (ESP-IDF 3.x) define them as aliases of ESP_IF_WIFI_STA / ESP_IF_WIFI_AP, so nothing changes there.
arduino-esp32 2.0.7 (ESP-IDF 4.4) defines them as the wifi_interface_t enum.
Tested with Marlin bugfix-2.1.x on an MKS TinyBee:
builds with espressif32@~3.5.0 and @6.1.0;
on 6.1.0, [ESP420] reports the access point (SSID, mode), which goes through the patched esp_wifi_get_config() line.
Station mode, which uses the patched esp_wifi_get_protocol() line, wasn't tested.