Skip to content

Commit

Permalink
feat(net): Switch to typedefs for WiFiClient, WiFiServer, WiFiUdp and…
Browse files Browse the repository at this point in the history
… WiFiClientSecure (#9909)

* feat(net): Deprecate old WiFi APIs

Deprecates WiFiClient, WiFiServer, WiFiUdp and WiFiClientSecure

* fix(net): add defines to WiFi.h

Defines are added to not cause deprecation warnings. Will be removed in the future

* fix(net): Use typedefs instead to help with forward declarations

Defines do not allow forward declarations
  • Loading branch information
me-no-dev committed Jun 24, 2024
1 parent 1f2ba1f commit ad1de0b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ config ARDUINO_SELECTIVE_ESPmDNS
config ARDUINO_SELECTIVE_HTTPClient
bool "Enable HTTPClient"
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network
select ARDUINO_SELECTIVE_WiFiClientSecure
select ARDUINO_SELECTIVE_NetworkClientSecure
default y

config ARDUINO_SELECTIVE_NetBIOS
Expand All @@ -375,7 +375,7 @@ config ARDUINO_SELECTIVE_WiFi
default y

config ARDUINO_SELECTIVE_NetworkClientSecure
bool "Enable WiFiClientSecure"
bool "Enable NetworkClientSecure"
depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network
default y

Expand Down
2 changes: 1 addition & 1 deletion libraries/NetworkClientSecure/src/WiFiClientSecure.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once
#include "NetworkClientSecure.h"
#define WiFiClientSecure NetworkClientSecure
typedef NetworkClientSecure WiFiClientSecure;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <uri/UriRegex.h>
#include <SD.h>
Expand Down
2 changes: 1 addition & 1 deletion libraries/WiFi/src/WiFiClient.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once
#include "NetworkClient.h"
#define WiFiClient NetworkClient
typedef NetworkClient WiFiClient;
2 changes: 1 addition & 1 deletion libraries/WiFi/src/WiFiServer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once
#include "NetworkServer.h"
#define WiFiServer NetworkServer
typedef NetworkServer WiFiServer;
2 changes: 1 addition & 1 deletion libraries/WiFi/src/WiFiUdp.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once
#include "NetworkUdp.h"
#define WiFiUDP NetworkUDP
typedef NetworkUDP WiFiUDP;

0 comments on commit ad1de0b

Please sign in to comment.