Skip to content

Commit b458d86

Browse files
Merge pull request #202 from ESP32Async/no-wifi
2 parents 96f2228 + fea14b9 commit b458d86

File tree

41 files changed

+57
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+57
-52
lines changed

examples/AsyncResponseStream/AsyncResponseStream.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static AsyncWebServer server(80);
2020
void setup() {
2121
Serial.begin(115200);
2222

23-
#ifndef CONFIG_IDF_TARGET_ESP32H2
23+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
2424
WiFi.mode(WIFI_AP);
2525
WiFi.softAP("esp-captive");
2626
#endif

examples/AsyncTunnel/AsyncTunnel.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent);
7070
void setup() {
7171
Serial.begin(115200);
7272

73-
#ifndef CONFIG_IDF_TARGET_ESP32H2
73+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
7474
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
7575
while (WiFi.status() != WL_CONNECTED) {
7676
delay(500);

examples/Auth/Auth.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static AsyncAuthorizationMiddleware authz([](AsyncWebServerRequest *request) {
5252
void setup() {
5353
Serial.begin(115200);
5454

55-
#ifndef CONFIG_IDF_TARGET_ESP32H2
55+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
5656
WiFi.mode(WIFI_AP);
5757
WiFi.softAP("esp-captive");
5858
#endif

examples/CORS/CORS.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static AsyncCorsMiddleware cors;
2525
void setup() {
2626
Serial.begin(115200);
2727

28-
#ifndef CONFIG_IDF_TARGET_ESP32H2
28+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
2929
WiFi.mode(WIFI_AP);
3030
WiFi.softAP("esp-captive");
3131
#endif

examples/CaptivePortal/CaptivePortal.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public:
2828
response->print("<!DOCTYPE html><html><head><title>Captive Portal</title></head><body>");
2929
response->print("<p>This is our captive portal front page.</p>");
3030
response->printf("<p>You were trying to reach: http://%s%s</p>", request->host().c_str(), request->url().c_str());
31-
#ifndef CONFIG_IDF_TARGET_ESP32H2
31+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
3232
response->printf("<p>Try opening <a href='http://%s'>this link</a> instead</p>", WiFi.softAPIP().toString().c_str());
3333
#endif
3434
response->print("</body></html>");
@@ -41,7 +41,7 @@ void setup() {
4141
Serial.println();
4242
Serial.println("Configuring access point...");
4343

44-
#ifndef CONFIG_IDF_TARGET_ESP32H2
44+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
4545
if (!WiFi.softAP("esp-captive")) {
4646
Serial.println("Soft AP creation failed.");
4747
while (1);

examples/CatchAllHandler/CatchAllHandler.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent);
8686
void setup() {
8787
Serial.begin(115200);
8888

89-
#ifndef CONFIG_IDF_TARGET_ESP32H2
89+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
9090
WiFi.mode(WIFI_AP);
9191
WiFi.softAP("esp-captive");
9292
#endif

examples/ChunkResponse/ChunkResponse.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent);
8686
void setup() {
8787
Serial.begin(115200);
8888

89-
#ifndef CONFIG_IDF_TARGET_ESP32H2
89+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
9090
WiFi.mode(WIFI_AP);
9191
WiFi.softAP("esp-captive");
9292
#endif

examples/ChunkRetryResponse/ChunkRetryResponse.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int key = -1;
9696
void setup() {
9797
Serial.begin(115200);
9898

99-
#ifndef CONFIG_IDF_TARGET_ESP32H2
99+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
100100
WiFi.mode(WIFI_AP);
101101
WiFi.softAP("esp-captive");
102102
#endif

examples/EndBegin/EndBegin.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static AsyncWebServer server(80);
2424
void setup() {
2525
Serial.begin(115200);
2626

27-
#ifndef CONFIG_IDF_TARGET_ESP32H2
27+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
2828
WiFi.mode(WIFI_AP);
2929
WiFi.softAP("esp-captive");
3030
#endif

examples/Filters/Filters.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public:
3232
response->print("<!DOCTYPE html><html><head><title>Captive Portal</title></head><body>");
3333
response->print("<p>This is out captive portal front page.</p>");
3434
response->printf("<p>You were trying to reach: http://%s%s</p>", request->host().c_str(), request->url().c_str());
35-
#ifndef CONFIG_IDF_TARGET_ESP32H2
35+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
3636
response->printf("<p>Try opening <a href='http://%s'>this link</a> instead</p>", WiFi.softAPIP().toString().c_str());
3737
#endif
3838
response->print("</body></html>");
@@ -51,17 +51,17 @@ void setup() {
5151
"/", HTTP_GET,
5252
[](AsyncWebServerRequest *request) {
5353
Serial.println("Captive portal request...");
54-
#ifndef CONFIG_IDF_TARGET_ESP32H2
54+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
5555
Serial.println("WiFi.localIP(): " + WiFi.localIP().toString());
5656
#endif
5757
Serial.println("request->client()->localIP(): " + request->client()->localIP().toString());
5858
#if ESP_IDF_VERSION_MAJOR >= 5
59-
#ifndef CONFIG_IDF_TARGET_ESP32H2
59+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
6060
Serial.println("WiFi.type(): " + String((int)WiFi.localIP().type()));
6161
#endif
6262
Serial.println("request->client()->type(): " + String((int)request->client()->localIP().type()));
6363
#endif
64-
#ifndef CONFIG_IDF_TARGET_ESP32H2
64+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
6565
Serial.println(WiFi.localIP() == request->client()->localIP() ? "should be: ON_STA_FILTER" : "should be: ON_AP_FILTER");
6666
Serial.println(WiFi.localIP() == request->client()->localIP());
6767
Serial.println(WiFi.localIP().toString() == request->client()->localIP().toString());
@@ -77,17 +77,17 @@ void setup() {
7777
"/", HTTP_GET,
7878
[](AsyncWebServerRequest *request) {
7979
Serial.println("Website request...");
80-
#ifndef CONFIG_IDF_TARGET_ESP32H2
80+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
8181
Serial.println("WiFi.localIP(): " + WiFi.localIP().toString());
8282
#endif
8383
Serial.println("request->client()->localIP(): " + request->client()->localIP().toString());
8484
#if ESP_IDF_VERSION_MAJOR >= 5
85-
#ifndef CONFIG_IDF_TARGET_ESP32H2
85+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
8686
Serial.println("WiFi.type(): " + String((int)WiFi.localIP().type()));
8787
#endif
8888
Serial.println("request->client()->type(): " + String((int)request->client()->localIP().type()));
8989
#endif
90-
#ifndef CONFIG_IDF_TARGET_ESP32H2
90+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
9191
Serial.println(WiFi.localIP() == request->client()->localIP() ? "should be: ON_STA_FILTER" : "should be: ON_AP_FILTER");
9292
Serial.println(WiFi.localIP() == request->client()->localIP());
9393
Serial.println(WiFi.localIP().toString() == request->client()->localIP().toString());
@@ -113,7 +113,7 @@ void setup() {
113113
// dnsServer.stop();
114114
// WiFi.softAPdisconnect();
115115

116-
#ifndef CONFIG_IDF_TARGET_ESP32H2
116+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
117117
WiFi.persistent(false);
118118
WiFi.begin("IoT");
119119
while (WiFi.status() != WL_CONNECTED) {

0 commit comments

Comments
 (0)