diff --git a/examples/AsyncResponseStream/AsyncResponseStream.ino b/examples/AsyncResponseStream/AsyncResponseStream.ino index f3106501d..660e36e25 100644 --- a/examples/AsyncResponseStream/AsyncResponseStream.ino +++ b/examples/AsyncResponseStream/AsyncResponseStream.ino @@ -20,7 +20,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/AsyncTunnel/AsyncTunnel.ino b/examples/AsyncTunnel/AsyncTunnel.ino index 29a7fe7c0..4269c595c 100644 --- a/examples/AsyncTunnel/AsyncTunnel.ino +++ b/examples/AsyncTunnel/AsyncTunnel.ino @@ -70,7 +70,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.begin(WIFI_SSID, WIFI_PASSWORD); while (WiFi.status() != WL_CONNECTED) { delay(500); diff --git a/examples/Auth/Auth.ino b/examples/Auth/Auth.ino index 2c3002781..9a08663b1 100644 --- a/examples/Auth/Auth.ino +++ b/examples/Auth/Auth.ino @@ -58,7 +58,7 @@ static AsyncAuthorizationMiddleware authz([](AsyncWebServerRequest *request) { void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/CORS/CORS.ino b/examples/CORS/CORS.ino index b355b120f..32df2df80 100644 --- a/examples/CORS/CORS.ino +++ b/examples/CORS/CORS.ino @@ -25,7 +25,7 @@ static AsyncCorsMiddleware cors; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/CaptivePortal/CaptivePortal.ino b/examples/CaptivePortal/CaptivePortal.ino index a94158be9..c35eec59f 100644 --- a/examples/CaptivePortal/CaptivePortal.ino +++ b/examples/CaptivePortal/CaptivePortal.ino @@ -28,7 +28,7 @@ public: response->print("
This is our captive portal front page.
"); response->printf("You were trying to reach: http://%s%s
", request->host().c_str(), request->url().c_str()); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED response->printf("Try opening this link instead
", WiFi.softAPIP().toString().c_str()); #endif response->print(""); @@ -41,7 +41,7 @@ void setup() { Serial.println(); Serial.println("Configuring access point..."); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED if (!WiFi.softAP("esp-captive")) { Serial.println("Soft AP creation failed."); while (1); diff --git a/examples/CatchAllHandler/CatchAllHandler.ino b/examples/CatchAllHandler/CatchAllHandler.ino index 56bc30a52..2b2f702f4 100644 --- a/examples/CatchAllHandler/CatchAllHandler.ino +++ b/examples/CatchAllHandler/CatchAllHandler.ino @@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ChunkResponse/ChunkResponse.ino b/examples/ChunkResponse/ChunkResponse.ino index 5899ce829..462a0bc25 100644 --- a/examples/ChunkResponse/ChunkResponse.ino +++ b/examples/ChunkResponse/ChunkResponse.ino @@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ChunkRetryResponse/ChunkRetryResponse.ino b/examples/ChunkRetryResponse/ChunkRetryResponse.ino index d2a9ced17..6f92494b8 100644 --- a/examples/ChunkRetryResponse/ChunkRetryResponse.ino +++ b/examples/ChunkRetryResponse/ChunkRetryResponse.ino @@ -90,7 +90,7 @@ static int key = -1; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/EndBegin/EndBegin.ino b/examples/EndBegin/EndBegin.ino index 710eb179e..77bdd825c 100644 --- a/examples/EndBegin/EndBegin.ino +++ b/examples/EndBegin/EndBegin.ino @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Filters/Filters.ino b/examples/Filters/Filters.ino index 805193e3d..ea4bb4094 100644 --- a/examples/Filters/Filters.ino +++ b/examples/Filters/Filters.ino @@ -32,7 +32,7 @@ public: response->print("This is out captive portal front page.
"); response->printf("You were trying to reach: http://%s%s
", request->host().c_str(), request->url().c_str()); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED response->printf("Try opening this link instead
", WiFi.softAPIP().toString().c_str()); #endif response->print(""); @@ -51,17 +51,17 @@ void setup() { "/", HTTP_GET, [](AsyncWebServerRequest *request) { Serial.println("Captive portal request..."); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED Serial.println("WiFi.localIP(): " + WiFi.localIP().toString()); #endif Serial.println("request->client()->localIP(): " + request->client()->localIP().toString()); #if ESP_IDF_VERSION_MAJOR >= 5 -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED Serial.println("WiFi.type(): " + String((int)WiFi.localIP().type())); #endif Serial.println("request->client()->type(): " + String((int)request->client()->localIP().type())); #endif -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED Serial.println(WiFi.localIP() == request->client()->localIP() ? "should be: ON_STA_FILTER" : "should be: ON_AP_FILTER"); Serial.println(WiFi.localIP() == request->client()->localIP()); Serial.println(WiFi.localIP().toString() == request->client()->localIP().toString()); @@ -77,17 +77,17 @@ void setup() { "/", HTTP_GET, [](AsyncWebServerRequest *request) { Serial.println("Website request..."); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED Serial.println("WiFi.localIP(): " + WiFi.localIP().toString()); #endif Serial.println("request->client()->localIP(): " + request->client()->localIP().toString()); #if ESP_IDF_VERSION_MAJOR >= 5 -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED Serial.println("WiFi.type(): " + String((int)WiFi.localIP().type())); #endif Serial.println("request->client()->type(): " + String((int)request->client()->localIP().type())); #endif -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED Serial.println(WiFi.localIP() == request->client()->localIP() ? "should be: ON_STA_FILTER" : "should be: ON_AP_FILTER"); Serial.println(WiFi.localIP() == request->client()->localIP()); Serial.println(WiFi.localIP().toString() == request->client()->localIP().toString()); @@ -113,7 +113,7 @@ void setup() { // dnsServer.stop(); // WiFi.softAPdisconnect(); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.persistent(false); WiFi.begin("IoT"); while (WiFi.status() != WL_CONNECTED) { diff --git a/examples/FlashResponse/FlashResponse.ino b/examples/FlashResponse/FlashResponse.ino index 15a3b7551..e746b12b9 100644 --- a/examples/FlashResponse/FlashResponse.ino +++ b/examples/FlashResponse/FlashResponse.ino @@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/HeaderManipulation/HeaderManipulation.ino b/examples/HeaderManipulation/HeaderManipulation.ino index fdfdd31bf..bbd2634ee 100644 --- a/examples/HeaderManipulation/HeaderManipulation.ino +++ b/examples/HeaderManipulation/HeaderManipulation.ino @@ -33,7 +33,7 @@ AsyncHeaderFreeMiddleware headerFree; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Headers/Headers.ino b/examples/Headers/Headers.ino index f2657689e..2eee3603f 100644 --- a/examples/Headers/Headers.ino +++ b/examples/Headers/Headers.ino @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Json/Json.ino b/examples/Json/Json.ino index a4a1b826d..c5a485f38 100644 --- a/examples/Json/Json.ino +++ b/examples/Json/Json.ino @@ -28,7 +28,7 @@ static AsyncCallbackJsonWebHandler *handler = new AsyncCallbackJsonWebHandler("/ void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/LargeResponse/LargeResponse.ino b/examples/LargeResponse/LargeResponse.ino index ea60165d0..8aca7e898 100644 --- a/examples/LargeResponse/LargeResponse.ino +++ b/examples/LargeResponse/LargeResponse.ino @@ -126,7 +126,7 @@ private: void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Logging/Logging.ino b/examples/Logging/Logging.ino index 1c4b1bfb9..26c96e96a 100644 --- a/examples/Logging/Logging.ino +++ b/examples/Logging/Logging.ino @@ -25,7 +25,7 @@ static AsyncLoggingMiddleware requestLogger; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/MessagePack/MessagePack.ino b/examples/MessagePack/MessagePack.ino index 9161f3321..b787d4533 100644 --- a/examples/MessagePack/MessagePack.ino +++ b/examples/MessagePack/MessagePack.ino @@ -28,7 +28,7 @@ static AsyncCallbackJsonWebHandler *handler = new AsyncCallbackJsonWebHandler("/ void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Middleware/Middleware.ino b/examples/Middleware/Middleware.ino index 12a53114c..53a1c65e9 100644 --- a/examples/Middleware/Middleware.ino +++ b/examples/Middleware/Middleware.ino @@ -34,7 +34,7 @@ public: void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Params/Params.ino b/examples/Params/Params.ino index e755643bb..38ade584a 100644 --- a/examples/Params/Params.ino +++ b/examples/Params/Params.ino @@ -74,7 +74,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/PartitionDownloader/PartitionDownloader.ino b/examples/PartitionDownloader/PartitionDownloader.ino index a732f42d4..82d38081d 100644 --- a/examples/PartitionDownloader/PartitionDownloader.ino +++ b/examples/PartitionDownloader/PartitionDownloader.ino @@ -34,7 +34,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/PerfTests/PerfTests.ino b/examples/PerfTests/PerfTests.ino index 397c6e6b6..186c3d2a4 100644 --- a/examples/PerfTests/PerfTests.ino +++ b/examples/PerfTests/PerfTests.ino @@ -91,7 +91,7 @@ static volatile size_t requests = 0; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/RateLimit/RateLimit.ino b/examples/RateLimit/RateLimit.ino index 7cd58a677..af1ce2dbc 100644 --- a/examples/RateLimit/RateLimit.ino +++ b/examples/RateLimit/RateLimit.ino @@ -25,7 +25,7 @@ static AsyncRateLimitMiddleware rateLimit; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Redirect/Redirect.ino b/examples/Redirect/Redirect.ino index bb431ee62..6c766bed8 100644 --- a/examples/Redirect/Redirect.ino +++ b/examples/Redirect/Redirect.ino @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/RequestContinuation/RequestContinuation.ino b/examples/RequestContinuation/RequestContinuation.ino index e10076298..68b894bb4 100644 --- a/examples/RequestContinuation/RequestContinuation.ino +++ b/examples/RequestContinuation/RequestContinuation.ino @@ -34,7 +34,7 @@ static AsyncWebServerRequestPtr gpioRequest; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/RequestContinuationComplete/RequestContinuationComplete.ino b/examples/RequestContinuationComplete/RequestContinuationComplete.ino index 8976eed97..481cc6e30 100644 --- a/examples/RequestContinuationComplete/RequestContinuationComplete.ino +++ b/examples/RequestContinuationComplete/RequestContinuationComplete.ino @@ -94,7 +94,7 @@ static bool processLongRunningOperation(LongRunningOperation *op) { void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ResumableDownload/ResumableDownload.ino b/examples/ResumableDownload/ResumableDownload.ino index 14c38e73a..ed4662b83 100644 --- a/examples/ResumableDownload/ResumableDownload.ino +++ b/examples/ResumableDownload/ResumableDownload.ino @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Rewrite/Rewrite.ino b/examples/Rewrite/Rewrite.ino index 5c37580e4..664c0e73d 100644 --- a/examples/Rewrite/Rewrite.ino +++ b/examples/Rewrite/Rewrite.ino @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ServerSentEvents/ServerSentEvents.ino b/examples/ServerSentEvents/ServerSentEvents.ino index 70ab4c7d0..71cd7f1bd 100644 --- a/examples/ServerSentEvents/ServerSentEvents.ino +++ b/examples/ServerSentEvents/ServerSentEvents.ino @@ -58,7 +58,7 @@ static AsyncEventSource events("/events"); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ServerSentEvents_PR156/ServerSentEvents_PR156.ino b/examples/ServerSentEvents_PR156/ServerSentEvents_PR156.ino index 4c40e0a2c..ec2de7664 100644 --- a/examples/ServerSentEvents_PR156/ServerSentEvents_PR156.ino +++ b/examples/ServerSentEvents_PR156/ServerSentEvents_PR156.ino @@ -64,7 +64,7 @@ static constexpr uint32_t timeoutClose = 15000; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ServerState/ServerState.ino b/examples/ServerState/ServerState.ino index 254af8799..8c3dc490b 100644 --- a/examples/ServerState/ServerState.ino +++ b/examples/ServerState/ServerState.ino @@ -25,7 +25,7 @@ static AsyncWebServer server2(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/SkipServerMiddleware/SkipServerMiddleware.ino b/examples/SkipServerMiddleware/SkipServerMiddleware.ino index f08a1b32a..6a04fbd24 100644 --- a/examples/SkipServerMiddleware/SkipServerMiddleware.ino +++ b/examples/SkipServerMiddleware/SkipServerMiddleware.ino @@ -27,7 +27,7 @@ static AsyncLoggingMiddleware logging; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/SlowChunkResponse/SlowChunkResponse.ino b/examples/SlowChunkResponse/SlowChunkResponse.ino index 046a208a1..b99e2e606 100644 --- a/examples/SlowChunkResponse/SlowChunkResponse.ino +++ b/examples/SlowChunkResponse/SlowChunkResponse.ino @@ -89,7 +89,7 @@ static size_t charactersIndex = 0; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/StaticFile/StaticFile.ino b/examples/StaticFile/StaticFile.ino index da2db8aa9..8150907cd 100644 --- a/examples/StaticFile/StaticFile.ino +++ b/examples/StaticFile/StaticFile.ino @@ -111,7 +111,7 @@ static const size_t index2_html_gz_len = sizeof(index2_html_gz); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Templates/Templates.ino b/examples/Templates/Templates.ino index b5acd89a9..97f3e24f7 100644 --- a/examples/Templates/Templates.ino +++ b/examples/Templates/Templates.ino @@ -49,7 +49,7 @@ static void setUptimeInMinutes(unsigned t) { void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/URIMatcher/URIMatcher.ino b/examples/URIMatcher/URIMatcher.ino index 3850f0919..385ee8c3b 100644 --- a/examples/URIMatcher/URIMatcher.ino +++ b/examples/URIMatcher/URIMatcher.ino @@ -44,7 +44,7 @@ void setup() { Serial.println(); Serial.println("=== AsyncURIMatcher Example ==="); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); Serial.print("AP IP address: "); diff --git a/examples/URIMatcherTest/URIMatcherTest.ino b/examples/URIMatcherTest/URIMatcherTest.ino index 88ebe2236..ad717e477 100644 --- a/examples/URIMatcherTest/URIMatcherTest.ino +++ b/examples/URIMatcherTest/URIMatcherTest.ino @@ -26,7 +26,7 @@ AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Upload/Upload.ino b/examples/Upload/Upload.ino index d5eb3ade5..d993fb6d6 100644 --- a/examples/Upload/Upload.ino +++ b/examples/Upload/Upload.ino @@ -31,7 +31,7 @@ void setup() { LittleFS.begin(); } -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/UploadFlash/UploadFlash.ino b/examples/UploadFlash/UploadFlash.ino index c3f949e20..43eb7307d 100644 --- a/examples/UploadFlash/UploadFlash.ino +++ b/examples/UploadFlash/UploadFlash.ino @@ -36,7 +36,7 @@ void setup() { LittleFS.begin(); } -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/WebSocket/WebSocket.ino b/examples/WebSocket/WebSocket.ino index ac35a89b7..794c68a20 100644 --- a/examples/WebSocket/WebSocket.ino +++ b/examples/WebSocket/WebSocket.ino @@ -25,7 +25,7 @@ static AsyncWebSocket ws("/ws"); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/WebSocketEasy/WebSocketEasy.ino b/examples/WebSocketEasy/WebSocketEasy.ino index e30ee4b12..94c5e8eda 100644 --- a/examples/WebSocketEasy/WebSocketEasy.ino +++ b/examples/WebSocketEasy/WebSocketEasy.ino @@ -71,7 +71,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/src/ESPAsyncWebServer.h b/src/ESPAsyncWebServer.h index 91f289fa4..7f2ef66c6 100644 --- a/src/ESPAsyncWebServer.h +++ b/src/ESPAsyncWebServer.h @@ -62,6 +62,12 @@ #define ASYNCWEBSERVER_USE_CHUNK_INFLIGHT 1 #endif +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED || defined(ESP8266) +#define ASYNCWEBSERVER_WIFI_SUPPORTED 1 +#else +#define ASYNCWEBSERVER_WIFI_SUPPORTED 0 +#endif + class AsyncWebServer; class AsyncWebServerRequest; class AsyncWebServerResponse; diff --git a/src/WebServer.cpp b/src/WebServer.cpp index 724d2482d..db0372c66 100644 --- a/src/WebServer.cpp +++ b/src/WebServer.cpp @@ -18,7 +18,7 @@ using namespace asyncsrv; bool ON_STA_FILTER(AsyncWebServerRequest *request) { -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED return WiFi.localIP() == request->client()->localIP(); #else return false; @@ -26,7 +26,7 @@ bool ON_STA_FILTER(AsyncWebServerRequest *request) { } bool ON_AP_FILTER(AsyncWebServerRequest *request) { -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI || CONFIG_ESP32_WIFI_ENABLED +#if ASYNCWEBSERVER_WIFI_SUPPORTED return WiFi.localIP() != request->client()->localIP(); #else return false;