Skip to content

Commit 1670a48

Browse files
committed
fix(wifi): Fix requirements and guards for hosted Wi-Fi
1 parent 9f3010f commit 1670a48

File tree

17 files changed

+69
-27
lines changed

17 files changed

+69
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"requires_any": [
3-
"CONFIG_SOC_WIFI_SUPPORTED=y",
4-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y"
54
]
65
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"requires_any": [
3-
"CONFIG_SOC_WIFI_SUPPORTED=y",
4-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y"
54
]
65
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"requires_any": [
3-
"CONFIG_SOC_WIFI_SUPPORTED=y",
4-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y"
54
]
65
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"requires_any": [
3-
"CONFIG_SOC_WIFI_SUPPORTED=y",
4-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y"
54
]
65
}

libraries/ESP_NOW/src/ESP32_NOW.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#include "sdkconfig.h"
2+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
3+
#warning "ESP-NOW is only supported in SoCs with native Wi-Fi support"
4+
#else
5+
16
#include "ESP32_NOW.h"
27
#include <string.h>
38
#include "esp_system.h"
@@ -406,3 +411,5 @@ size_t ESP_NOW_Peer::send(const uint8_t *data, int len) {
406411
ESP_NOW_Peer::operator bool() const {
407412
return added;
408413
}
414+
415+
#endif

libraries/ESP_NOW/src/ESP32_NOW.h

+9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
#pragma once
22

3+
#include "sdkconfig.h"
4+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
5+
#warning "ESP-NOW is only supported in SoCs with native Wi-Fi support"
6+
#else
7+
38
#include "esp_wifi_types.h"
49
#include "Print.h"
510
#include "esp_now.h"
611
#include "esp32-hal-log.h"
712
#include "esp_mac.h"
813

14+
15+
916
class ESP_NOW_Peer; //forward declaration for friend function
1017

1118
class ESP_NOW_Class : public Print {
@@ -77,3 +84,5 @@ class ESP_NOW_Peer {
7784
};
7885

7986
extern ESP_NOW_Class ESP_NOW;
87+
88+
#endif

libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#include "sdkconfig.h"
2+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
3+
#warning "ESP-NOW is only supported in SoCs with native Wi-Fi support"
4+
#else
5+
16
#include "ESP32_NOW_Serial.h"
27
#include <string.h>
38
#include "esp_now.h"
@@ -277,3 +282,5 @@ void ESP_NOW_Serial_Class::onSent(bool success) {
277282
}
278283
}
279284
}
285+
286+
#endif

libraries/ESP_NOW/src/ESP32_NOW_Serial.h

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#pragma once
22

3+
#include "sdkconfig.h"
4+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
5+
#warning "ESP-NOW is only supported in SoCs with native Wi-Fi support"
6+
#else
7+
38
#include "esp_wifi_types.h"
49
#include "freertos/FreeRTOS.h"
510
#include "freertos/task.h"
@@ -48,3 +53,5 @@ class ESP_NOW_Serial_Class : public Stream, public ESP_NOW_Peer {
4853
void onReceive(const uint8_t *data, size_t len, bool broadcast);
4954
void onSent(bool success);
5055
};
56+
57+
#endif

libraries/HTTPClient/examples/HTTPClientEnterprise/HTTPClientEnterprise.ino

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
/*|TESTED BOARDS: Devkit v1 DOIT, Devkitc v4 |*/
44
/*|CORE: June 2018 |*/
55
/*|----------------------------------------------------------|*/
6+
7+
#include "sdkconfig.h"
8+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
9+
#error "WPA-Enterprise is only supported in SoCs with native Wi-Fi support"
10+
#endif
11+
612
#include <WiFi.h>
713
#include <HTTPClient.h>
814
#if __has_include("esp_eap_client.h")
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"requires_any": [
3-
"CONFIG_SOC_WIFI_SUPPORTED=y",
4-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y"
54
]
65
}

libraries/NetworkClientSecure/examples/WiFiClientSecureEnterprise/WiFiClientSecureEnterprise.ino

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
// Note: this example is outdated and may not work!
1414
// For more examples see https://github.com/martinius96/ESP32-eduroam
1515

16+
#include "sdkconfig.h"
17+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
18+
#error "WPA-Enterprise is only supported in SoCs with native Wi-Fi support"
19+
#endif
20+
1621
#include <WiFi.h>
1722
#include <NetworkClientSecure.h>
1823
#if __has_include("esp_eap_client.h")
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"requires_any": [
3-
"CONFIG_SOC_WIFI_SUPPORTED=y",
4-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y"
54
]
65
}

libraries/WiFi/examples/WPS/WPS.ino

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ Author:
1414
Pranav Cherukupalli <[email protected]>
1515
*/
1616

17+
#include "sdkconfig.h"
18+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
19+
#error "WPS is only supported in SoCs with native Wi-Fi support"
20+
#endif
21+
1722
#include "WiFi.h"
1823
#include "esp_wps.h"
1924
/*

libraries/WiFi/examples/WPS/ci.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"requires_any": [
3-
"CONFIG_SOC_WIFI_SUPPORTED=y",
4-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y"
54
]
65
}

libraries/WiFi/examples/WiFiSmartConfig/WiFiSmartConfig.ino

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#include "sdkconfig.h"
2+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
3+
#error "SmartConfig is only supported in SoCs with native Wi-Fi support"
4+
#endif
5+
16
#include "WiFi.h"
27

38
void setup() {
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"requires_any": [
3-
"CONFIG_SOC_WIFI_SUPPORTED=y",
4-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
2+
"requires": [
3+
"CONFIG_SOC_WIFI_SUPPORTED=y"
54
]
65
}

tests/validation/wifi/ci.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"hardware": false,
2222
"qemu": false
2323
},
24-
"requires_any": [
25-
"CONFIG_SOC_WIFI_SUPPORTED=y",
26-
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
24+
"requires": [
25+
"CONFIG_SOC_WIFI_SUPPORTED=y"
2726
]
2827
}

0 commit comments

Comments
 (0)