Skip to content

Added new client methods #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Arduino_CatM1ConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ NetworkConnectionState CatM1ConnectionHandler::update_handleDisconnected()
}
}

Client* CatM1ConnectionHandler::getNewSSLClient() {
return new GSMSSLClient();
}

#endif /* #ifdef BOARD_HAS_CATM1_NBIOT */
2 changes: 2 additions & 0 deletions src/Arduino_CatM1ConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class CatM1ConnectionHandler : public ConnectionHandler


virtual unsigned long getTime() override;
virtual Client *getNewClient() override { return new GSMClient(); };
virtual Client *getNewSSLClient() override;
virtual Client & getClient() override { return _gsm_client; };
virtual UDP & getUDP() override { return _gsm_udp; };

Expand Down
14 changes: 13 additions & 1 deletion src/Arduino_ConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#include <Ethernet.h>
#include <PortentaEthernet.h>
#include <GSM.h>
#include "EthernetSSLClient.h"
#include <WiFiSSLClient.h>

#define BOARD_HAS_WIFI
#define BOARD_HAS_ETHERNET
Expand All @@ -73,6 +75,8 @@
#include <WiFiUdp.h>
#include <EthernetC33.h>
#include <EthernetUdp.h>
#include "EthernetSSLClient.h"
#include <WiFiSSLClient.h>

#define BOARD_HAS_WIFI
#define BOARD_HAS_ETHERNET
Expand All @@ -85,6 +89,7 @@
#if defined(ARDUINO_NICLA_VISION)
#include <WiFi.h>
#include <WiFiUdp.h>
#include <WiFiSSLClient.h>

#define BOARD_HAS_WIFI
#define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
Expand All @@ -97,6 +102,8 @@
#include <WiFiUdp.h>
#include <Ethernet.h>
#include <PortentaEthernet.h>
#include "EthernetSSLClient.h"
#include <WiFiSSLClient.h>

#define BOARD_HAS_WIFI
#define BOARD_HAS_ETHERNET
Expand Down Expand Up @@ -139,6 +146,7 @@
#if defined(ARDUINO_ARCH_ESP8266)
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <WiFiClientSecure.h>

#define BOARD_HAS_WIFI
#define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
Expand All @@ -150,7 +158,8 @@
#if defined(ARDUINO_ARCH_ESP32)
#include <WiFi.h>
#include <WiFiUdp.h>

#include <WiFiClientSecure.h>

#define BOARD_HAS_WIFI
#define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
#define NETWORK_IDLE_STATUS WL_IDLE_STATUS
Expand All @@ -160,6 +169,7 @@

#if defined(ARDUINO_UNOR4_WIFI)
#include <WiFiS3.h>
#include <WiFiSSLClient.h>

#define BOARD_HAS_WIFI
#define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
Expand Down Expand Up @@ -240,6 +250,8 @@ class ConnectionHandler {
#if defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB) || defined(BOARD_HAS_ETHERNET) || defined(BOARD_HAS_CATM1_NBIOT)
virtual unsigned long getTime() = 0;
virtual Client &getClient() = 0;
virtual Client *getNewClient() = 0;
virtual Client *getNewSSLClient() = 0;
virtual UDP &getUDP() = 0;
#endif

Expand Down
4 changes: 4 additions & 0 deletions src/Arduino_EthernetConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,8 @@ NetworkConnectionState EthernetConnectionHandler::update_handleDisconnected()
}
}

Client* EthernetConnectionHandler::getNewSSLClient() {
return new EthernetSSLClient();
}

#endif /* #ifdef BOARD_HAS_ETHERNET */
2 changes: 2 additions & 0 deletions src/Arduino_EthernetConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class EthernetConnectionHandler : public ConnectionHandler

virtual unsigned long getTime() override { return 0; }
virtual Client & getClient() override{ return _eth_client; }
virtual Client *getNewClient() override { return new EthernetClient(); }
virtual Client *getNewSSLClient() override;
virtual UDP & getUDP() override { return _eth_udp; }


Expand Down
4 changes: 4 additions & 0 deletions src/Arduino_GSMConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,8 @@ NetworkConnectionState GSMConnectionHandler::update_handleDisconnected()
}
}

Client* GSMConnectionHandler::getNewSSLClient() {
return new GSMSSLClient();
}

#endif /* #ifdef BOARD_HAS_GSM */
2 changes: 2 additions & 0 deletions src/Arduino_GSMConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class GSMConnectionHandler : public ConnectionHandler

virtual unsigned long getTime() override;
virtual Client & getClient() override { return _gsm_client; };
virtual Client *getNewClient() override { return new GSMClient(); }
virtual Client *getNewSSLClient() override;
virtual UDP & getUDP() override { return _gsm_udp; };


Expand Down
4 changes: 4 additions & 0 deletions src/Arduino_NBConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,8 @@ NetworkConnectionState NBConnectionHandler::update_handleDisconnected()
}
}

Client* NBConnectionHandler::getNewSSLClient() {
return new NBSSLClient();
}

#endif /* #ifdef BOARD_HAS_NB */
2 changes: 2 additions & 0 deletions src/Arduino_NBConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class NBConnectionHandler : public ConnectionHandler

virtual unsigned long getTime() override;
virtual Client & getClient() override { return _nb_client; };
virtual Client *getNewClient() override { return new NBClient(); }
virtual Client *getNewSSLClient() override;
virtual UDP & getUDP() override { return _nb_udp; };


Expand Down
11 changes: 10 additions & 1 deletion src/Arduino_WiFiConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
******************************************************************************/

#include "Arduino_WiFiConnectionHandler.h"

#ifdef BOARD_HAS_WIFI /* Only compile if the board has WiFi */

/******************************************************************************
Expand Down Expand Up @@ -170,4 +169,14 @@ NetworkConnectionState WiFiConnectionHandler::update_handleDisconnected()
}
}

Client* WiFiConnectionHandler::getNewSSLClient() {
#ifdef ARDUINO_ARCH_ESP32
return new WiFiClientSecure();
#elif defined(ARDUINO_ARCH_ESP8266)
return new WiFiClientSecure();
#else
return new WiFiSSLClient();
#endif
}

#endif /* #ifdef BOARD_HAS_WIFI */
2 changes: 2 additions & 0 deletions src/Arduino_WiFiConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class WiFiConnectionHandler : public ConnectionHandler

virtual unsigned long getTime() override;
virtual Client & getClient() override { return _wifi_client; }
virtual Client *getNewClient() override { return new WiFiClient(); }
virtual Client *getNewSSLClient() override;
virtual UDP & getUDP() override { return _wifi_udp; }


Expand Down
Loading