Skip to content

Commit

Permalink
fix(wifi): Fix requirements and guards for hosted Wi-Fi
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Nov 6, 2024
1 parent 9f3010f commit 1670a48
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 27 deletions.
5 changes: 2 additions & 3 deletions libraries/ESP_NOW/examples/ESP_NOW_Broadcast_Master/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}
5 changes: 2 additions & 3 deletions libraries/ESP_NOW/examples/ESP_NOW_Broadcast_Slave/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}
5 changes: 2 additions & 3 deletions libraries/ESP_NOW/examples/ESP_NOW_Network/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}
5 changes: 2 additions & 3 deletions libraries/ESP_NOW/examples/ESP_NOW_Serial/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}
7 changes: 7 additions & 0 deletions libraries/ESP_NOW/src/ESP32_NOW.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
#warning "ESP-NOW is only supported in SoCs with native Wi-Fi support"
#else

#include "ESP32_NOW.h"
#include <string.h>
#include "esp_system.h"
Expand Down Expand Up @@ -406,3 +411,5 @@ size_t ESP_NOW_Peer::send(const uint8_t *data, int len) {
ESP_NOW_Peer::operator bool() const {
return added;
}

#endif
9 changes: 9 additions & 0 deletions libraries/ESP_NOW/src/ESP32_NOW.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#pragma once

#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
#warning "ESP-NOW is only supported in SoCs with native Wi-Fi support"
#else

#include "esp_wifi_types.h"
#include "Print.h"
#include "esp_now.h"
#include "esp32-hal-log.h"
#include "esp_mac.h"



class ESP_NOW_Peer; //forward declaration for friend function

class ESP_NOW_Class : public Print {
Expand Down Expand Up @@ -77,3 +84,5 @@ class ESP_NOW_Peer {
};

extern ESP_NOW_Class ESP_NOW;

#endif
7 changes: 7 additions & 0 deletions libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
#warning "ESP-NOW is only supported in SoCs with native Wi-Fi support"
#else

#include "ESP32_NOW_Serial.h"
#include <string.h>
#include "esp_now.h"
Expand Down Expand Up @@ -277,3 +282,5 @@ void ESP_NOW_Serial_Class::onSent(bool success) {
}
}
}

#endif
7 changes: 7 additions & 0 deletions libraries/ESP_NOW/src/ESP32_NOW_Serial.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#pragma once

#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
#warning "ESP-NOW is only supported in SoCs with native Wi-Fi support"
#else

#include "esp_wifi_types.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Expand Down Expand Up @@ -48,3 +53,5 @@ class ESP_NOW_Serial_Class : public Stream, public ESP_NOW_Peer {
void onReceive(const uint8_t *data, size_t len, bool broadcast);
void onSent(bool success);
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
/*|TESTED BOARDS: Devkit v1 DOIT, Devkitc v4 |*/
/*|CORE: June 2018 |*/
/*|----------------------------------------------------------|*/

#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
#error "WPA-Enterprise is only supported in SoCs with native Wi-Fi support"
#endif

#include <WiFi.h>
#include <HTTPClient.h>
#if __has_include("esp_eap_client.h")
Expand Down
5 changes: 2 additions & 3 deletions libraries/HTTPClient/examples/HTTPClientEnterprise/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
// Note: this example is outdated and may not work!
// For more examples see https://github.com/martinius96/ESP32-eduroam

#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
#error "WPA-Enterprise is only supported in SoCs with native Wi-Fi support"
#endif

#include <WiFi.h>
#include <NetworkClientSecure.h>
#if __has_include("esp_eap_client.h")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}
5 changes: 5 additions & 0 deletions libraries/WiFi/examples/WPS/WPS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Author:
Pranav Cherukupalli <cherukupallip@gmail.com>
*/

#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
#error "WPS is only supported in SoCs with native Wi-Fi support"
#endif

#include "WiFi.h"
#include "esp_wps.h"
/*
Expand Down
5 changes: 2 additions & 3 deletions libraries/WiFi/examples/WPS/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}
5 changes: 5 additions & 0 deletions libraries/WiFi/examples/WiFiSmartConfig/WiFiSmartConfig.ino
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "sdkconfig.h"
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
#error "SmartConfig is only supported in SoCs with native Wi-Fi support"
#endif

#include "WiFi.h"

void setup() {
Expand Down
5 changes: 2 additions & 3 deletions libraries/WiFi/examples/WiFiSmartConfig/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}
5 changes: 2 additions & 3 deletions tests/validation/wifi/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"hardware": false,
"qemu": false
},
"requires_any": [
"CONFIG_SOC_WIFI_SUPPORTED=y",
"CONFIG_ESP_WIFI_REMOTE_ENABLED=y"
"requires": [
"CONFIG_SOC_WIFI_SUPPORTED=y"
]
}

0 comments on commit 1670a48

Please sign in to comment.