diff --git a/lib/default/WiFiHelper/src/WiFiHelper.h b/lib/default/WiFiHelper/src/WiFiHelper.h index 6abcf583a..6f4e1997f 100644 --- a/lib/default/WiFiHelper/src/WiFiHelper.h +++ b/lib/default/WiFiHelper/src/WiFiHelper.h @@ -59,7 +59,11 @@ typedef enum WiFiPhyMode class WiFiHelper { public: #ifdef ESP32 +#if __has_include("esp_eap_client.h") && __has_include("chip-debug-report.h") // check for Tasmota framework + static wl_status_t begin(const char* wpa2_ssid, wpa2_auth_method_t method, const char* wpa2_identity=NULL, const char* wpa2_username=NULL, const char *wpa2_password=NULL, const char* ca_pem=NULL, const char* client_crt=NULL, const char* client_key=NULL, int ttls_phase2_type=-1, int32_t channel=0, const uint8_t* bssid=0, bool connect=true); +#else static wl_status_t begin(const char* wpa2_ssid, wpa2_auth_method_t method, const char* wpa2_identity=NULL, const char* wpa2_username=NULL, const char *wpa2_password=NULL, const char* ca_pem=NULL, const char* client_crt=NULL, const char* client_key=NULL, int32_t channel=0, const uint8_t* bssid=0, bool connect=true); +#endif #endif static wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true); static wl_status_t begin(char* ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true); @@ -94,4 +98,4 @@ public: -#endif // WIFIHELPER_H \ No newline at end of file +#endif // WIFIHELPER_H diff --git a/lib/default/WiFiHelper/src/WiFiHelper_ESP32.cpp b/lib/default/WiFiHelper/src/WiFiHelper_ESP32.cpp index 000840e81..cb9463041 100644 --- a/lib/default/WiFiHelper/src/WiFiHelper_ESP32.cpp +++ b/lib/default/WiFiHelper/src/WiFiHelper_ESP32.cpp @@ -34,12 +34,21 @@ ip_addr_t dns_save6[DNS_MAX_SERVERS] = {}; // IPv6 DNS servers #include "tasmota_options.h" #include "lwip/dns.h" +#if __has_include("esp_eap_client.h") && __has_include("chip-debug-report.h") // check for Tasmota framework +wl_status_t WiFiHelper::begin(const char *wpa2_ssid, wpa2_auth_method_t method, const char *wpa2_identity, const char *wpa2_username, const char *wpa2_password, const char *ca_pem, const char *client_crt, const char *client_key, int ttls_phase2_type, int32_t channel, const uint8_t *bssid, bool connect) { + WiFiHelper::scrubDNS(); + wl_status_t ret = WiFi.begin(wpa2_ssid, method, wpa2_identity, wpa2_username, wpa2_password, ca_pem, client_crt, client_key, ttls_phase2_type, channel, bssid, connect); + WiFiHelper::scrubDNS(); + return ret; +} +#else wl_status_t WiFiHelper::begin(const char* wpa2_ssid, wpa2_auth_method_t method, const char* wpa2_identity, const char* wpa2_username, const char *wpa2_password, const char* ca_pem, const char* client_crt, const char* client_key, int32_t channel, const uint8_t* bssid, bool connect) { WiFiHelper::scrubDNS(); wl_status_t ret = WiFi.begin(wpa2_ssid, method, wpa2_identity, wpa2_username, wpa2_password, ca_pem, client_crt, client_key, channel, bssid, connect); WiFiHelper::scrubDNS(); return ret; } +#endif wl_status_t WiFiHelper::begin(const char* ssid, const char *passphrase, int32_t channel, const uint8_t* bssid, bool connect) { WiFiHelper::scrubDNS(); diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp index 540d37420..afbe3602e 100755 --- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp +++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp @@ -47,7 +47,9 @@ #include "c_types.h" #endif -#include +#if __has_include("core_version.h") // ESP32 Stage has no core_version.h file. Disable include via PlatformIO Option +#include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_7_1) +#endif // ESP32_STAGE #undef DEBUG_TLS #ifdef DEBUG_TLS diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h index 0ca24ec00..2c675d154 100755 --- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h +++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef ESP32_STAGE // ESP32 Stage has no core_version.h file. Disable include via PlatformIO Option +#if __has_include("core_version.h") // ESP32 Stage has no core_version.h file. Disable include via PlatformIO Option #include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_7_1) #endif // ESP32_STAGE diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 1ec2500aa..94b611e1a 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -18,7 +18,7 @@ */ // Location specific includes -#ifndef ESP32_STAGE // ESP32 Stage has no core_version.h file. Disable include via PlatformIO Option +#if __has_include("core_version.h") // ESP32 Stage has no core_version.h file. Disable include via PlatformIO Option #include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_7_1) #endif // ESP32_STAGE #include "include/tasmota_compat.h"