Skip to content

Commit

Permalink
added getNewSSLClient method
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Mar 13, 2024
1 parent 03c4e2c commit f0c6f8c
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Arduino_ConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class ConnectionHandler {
virtual unsigned long getTime() = 0;
virtual Client &getClient() = 0;
virtual Client *getNewClient() = 0;
virtual Client *getNewSSLClient() = 0;
virtual UDP &getUDP() = 0;
#endif

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

Client* EthernetConnectionHandler::getNewSSLClient() {
#if defined(BOARD_STM32H7)
return new EthernetSSLClient();
#elif defined(ARDUINO_PORTENTA_C33)
return new EthernetSSLClient();
#else
return nullptr;
#endif
}

#endif /* #ifdef BOARD_HAS_ETHERNET */
1 change: 1 addition & 0 deletions src/Arduino_EthernetConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ 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();
virtual UDP & getUDP() override { return _eth_udp; }


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

Client* GSMConnectionHandler::getNewSSLClient() {
#ifdef ARDUINO_SAMD_MKRGSM1400
return GSMSSLClient();
#else
return nullptr;
#endif
}

#endif /* #ifdef BOARD_HAS_GSM */
1 change: 1 addition & 0 deletions src/Arduino_GSMConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ 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();
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 */
1 change: 1 addition & 0 deletions src/Arduino_NBConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ 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();
virtual UDP & getUDP() override { return _nb_udp; };


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

Client* WiFiConnectionHandler::getNewSSLClient() {
return new WiFiSSLClient();;
}

#endif /* #ifdef BOARD_HAS_WIFI */
1 change: 1 addition & 0 deletions src/Arduino_WiFiConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ 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();
virtual UDP & getUDP() override { return _wifi_udp; }


Expand Down

0 comments on commit f0c6f8c

Please sign in to comment.