diff --git a/src/Arduino_CatM1ConnectionHandler.cpp b/src/Arduino_CatM1ConnectionHandler.cpp index 0b99716..4655373 100644 --- a/src/Arduino_CatM1ConnectionHandler.cpp +++ b/src/Arduino_CatM1ConnectionHandler.cpp @@ -19,9 +19,10 @@ INCLUDE ******************************************************************************/ -#include "Arduino_CatM1ConnectionHandler.h" +#include "Arduino_ConnectionHandlerDefinitions.h" #ifdef BOARD_HAS_CATM1_NBIOT /* Only compile if the board has CatM1 BN-IoT */ +#include "Arduino_CatM1ConnectionHandler.h" /****************************************************************************** CTOR/DTOR @@ -96,7 +97,7 @@ NetworkConnectionState CatM1ConnectionHandler::update_handleDisconnected() } else { - return NetworkConnectionState::CLOSED; + return NetworkConnectionState::CLOSED; } } diff --git a/src/Arduino_CatM1ConnectionHandler.h b/src/Arduino_CatM1ConnectionHandler.h index de5fd01..ec6b263 100644 --- a/src/Arduino_CatM1ConnectionHandler.h +++ b/src/Arduino_CatM1ConnectionHandler.h @@ -22,10 +22,11 @@ INCLUDE ******************************************************************************/ -#include "Arduino_ConnectionHandler.h" +#include "Arduino_ConnectionHandlerInterface.h" - -#ifdef BOARD_HAS_CATM1_NBIOT /* Only compile if the board has CatM1 BN-IoT */ +#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_EDGE_CONTROL) + #include +#endif /****************************************************************************** CLASS DECLARATION @@ -66,6 +67,4 @@ class CatM1ConnectionHandler : public ConnectionHandler GSMClient _gsm_client; }; -#endif /* #ifdef BOARD_HAS_CATM1_NBIOT */ - #endif /* #ifndef ARDUINO_CATM1_CONNECTION_HANDLER_H_ */ diff --git a/src/Arduino_CellularConnectionHandler.cpp b/src/Arduino_CellularConnectionHandler.cpp index 7e543b0..ff7111c 100644 --- a/src/Arduino_CellularConnectionHandler.cpp +++ b/src/Arduino_CellularConnectionHandler.cpp @@ -13,9 +13,10 @@ INCLUDE ******************************************************************************/ -#include "Arduino_CellularConnectionHandler.h" +#include "Arduino_ConnectionHandlerDefinitions.h" #ifdef BOARD_HAS_CELLULAR /* Only compile if the board has Cellular */ +#include "Arduino_CellularConnectionHandler.h" /****************************************************************************** CTOR/DTOR diff --git a/src/Arduino_CellularConnectionHandler.h b/src/Arduino_CellularConnectionHandler.h index 0c4d5f8..8515fa9 100644 --- a/src/Arduino_CellularConnectionHandler.h +++ b/src/Arduino_CellularConnectionHandler.h @@ -18,12 +18,15 @@ #include "Arduino_ConnectionHandler.h" -#ifdef BOARD_HAS_CELLULAR /* Only compile if the board has Cellular */ /****************************************************************************** CLASS DECLARATION ******************************************************************************/ +#if defined(ARDUINO_PORTENTA_C33) || defined(ARDUINO_PORTENTA_H7_M7) +#include +#endif + class CellularConnectionHandler : public ConnectionHandler { public: @@ -56,6 +59,4 @@ class CellularConnectionHandler : public ConnectionHandler TinyGsmClient _gsm_client = _cellular.getNetworkClient(); }; -#endif /* #ifdef BOARD_HAS_CELLULAR */ - #endif /* #ifndef ARDUINO_CELLULAR_CONNECTION_HANDLER_H_ */ diff --git a/src/Arduino_ConnectionHandlerDefinitions.h b/src/Arduino_ConnectionHandlerDefinitions.h index 74212d3..3fdde16 100644 --- a/src/Arduino_ConnectionHandlerDefinitions.h +++ b/src/Arduino_ConnectionHandlerDefinitions.h @@ -162,7 +162,8 @@ enum class NetworkAdapter { NB, GSM, LORA, - CATM1 + CATM1, + CELL }; /****************************************************************************** diff --git a/src/Arduino_EthernetConnectionHandler.cpp b/src/Arduino_EthernetConnectionHandler.cpp index 0fa2e25..5225450 100644 --- a/src/Arduino_EthernetConnectionHandler.cpp +++ b/src/Arduino_EthernetConnectionHandler.cpp @@ -16,9 +16,10 @@ INCLUDE ******************************************************************************/ -#include "Arduino_EthernetConnectionHandler.h" +#include "Arduino_ConnectionHandlerDefinitions.h" #ifdef BOARD_HAS_ETHERNET /* Only compile if the board has ethernet */ +#include "Arduino_EthernetConnectionHandler.h" /****************************************************************************** CTOR/DTOR diff --git a/src/Arduino_EthernetConnectionHandler.h b/src/Arduino_EthernetConnectionHandler.h index cc22bfe..29dde2f 100644 --- a/src/Arduino_EthernetConnectionHandler.h +++ b/src/Arduino_EthernetConnectionHandler.h @@ -19,9 +19,18 @@ INCLUDE ******************************************************************************/ -#include "Arduino_ConnectionHandler.h" - -#ifdef BOARD_HAS_ETHERNET /* Only compile if the board has ethernet */ +#include "Arduino_ConnectionHandlerInterface.h" + +#if defined(ARDUINO_PORTENTA_H7_M7) + #include + #include +#elif defined(ARDUINO_PORTENTA_C33) + #include + #include +#elif defined(ARDUINO_OPTA) + #include + #include +#endif /****************************************************************************** CLASS DECLARATION @@ -64,6 +73,4 @@ class EthernetConnectionHandler : public ConnectionHandler }; -#endif /* #ifdef BOARD_HAS_ETHERNET */ - #endif /* ARDUINO_ETHERNET_CONNECTION_HANDLER_H_ */ diff --git a/src/Arduino_GSMConnectionHandler.cpp b/src/Arduino_GSMConnectionHandler.cpp index e57a720..684abde 100644 --- a/src/Arduino_GSMConnectionHandler.cpp +++ b/src/Arduino_GSMConnectionHandler.cpp @@ -19,9 +19,10 @@ INCLUDE ******************************************************************************/ -#include "Arduino_GSMConnectionHandler.h" +#include "Arduino_ConnectionHandlerDefinitions.h" #ifdef BOARD_HAS_GSM /* Only compile if this is a board with GSM */ +#include "Arduino_GSMConnectionHandler.h" /****************************************************************************** CONSTANTS diff --git a/src/Arduino_GSMConnectionHandler.h b/src/Arduino_GSMConnectionHandler.h index 714ed8c..c2d2b05 100644 --- a/src/Arduino_GSMConnectionHandler.h +++ b/src/Arduino_GSMConnectionHandler.h @@ -22,10 +22,11 @@ INCLUDE ******************************************************************************/ -#include "Arduino_ConnectionHandler.h" +#include "Arduino_ConnectionHandlerInterface.h" - -#ifdef BOARD_HAS_GSM /* Only compile if this is a board with GSM */ +#if defined(ARDUINO_SAMD_MKRGSM1400) + #include +#endif /****************************************************************************** CLASS DECLARATION @@ -65,6 +66,4 @@ class GSMConnectionHandler : public ConnectionHandler GSMClient _gsm_client; }; -#endif /* #ifdef BOARD_HAS_GSM */ - #endif /* #ifndef GSM_CONNECTION_MANAGER_H_ */ diff --git a/src/Arduino_LoRaConnectionHandler.cpp b/src/Arduino_LoRaConnectionHandler.cpp index cf1deaf..2f94910 100644 --- a/src/Arduino_LoRaConnectionHandler.cpp +++ b/src/Arduino_LoRaConnectionHandler.cpp @@ -19,9 +19,10 @@ INCLUDE ******************************************************************************/ -#include "Arduino_LoRaConnectionHandler.h" +#include "Arduino_ConnectionHandlerDefinitions.h" #if defined(BOARD_HAS_LORA) /* Only compile if the board has LoRa */ +#include "Arduino_LoRaConnectionHandler.h" /****************************************************************************** TYPEDEF diff --git a/src/Arduino_LoRaConnectionHandler.h b/src/Arduino_LoRaConnectionHandler.h index aa769ab..fb0f560 100644 --- a/src/Arduino_LoRaConnectionHandler.h +++ b/src/Arduino_LoRaConnectionHandler.h @@ -22,7 +22,11 @@ INCLUDE ******************************************************************************/ -#include "Arduino_ConnectionHandler.h" +#include "Arduino_ConnectionHandlerInterface.h" + +#if defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) + #include +#endif #ifdef BOARD_HAS_LORA /* Only compile if the board has LoRa */ diff --git a/src/Arduino_NBConnectionHandler.cpp b/src/Arduino_NBConnectionHandler.cpp index 344e104..a06fb79 100644 --- a/src/Arduino_NBConnectionHandler.cpp +++ b/src/Arduino_NBConnectionHandler.cpp @@ -19,9 +19,10 @@ INCLUDE ******************************************************************************/ -#include "Arduino_NBConnectionHandler.h" +#include "Arduino_ConnectionHandlerDefinitions.h" #ifdef BOARD_HAS_NB /* Only compile if this is a board with NB */ +#include "Arduino_NBConnectionHandler.h" /****************************************************************************** CONSTANTS diff --git a/src/Arduino_NBConnectionHandler.h b/src/Arduino_NBConnectionHandler.h index 53d2174..0a7ec8a 100644 --- a/src/Arduino_NBConnectionHandler.h +++ b/src/Arduino_NBConnectionHandler.h @@ -22,9 +22,11 @@ INCLUDE ******************************************************************************/ -#include "Arduino_ConnectionHandler.h" +#include "Arduino_ConnectionHandlerInterface.h" -#ifdef BOARD_HAS_NB /* Only compile if this is a board with NB */ +#ifdef ARDUINO_SAMD_MKRNB1500 + #include +#endif /****************************************************************************** CLASS DECLARATION @@ -68,6 +70,4 @@ class NBConnectionHandler : public ConnectionHandler NBClient _nb_client; }; -#endif /* #ifdef BOARD_HAS_NB */ - #endif /* #ifndef NB_CONNECTION_MANAGER_H_ */ diff --git a/src/Arduino_WiFiConnectionHandler.cpp b/src/Arduino_WiFiConnectionHandler.cpp index 902b53f..34ed664 100644 --- a/src/Arduino_WiFiConnectionHandler.cpp +++ b/src/Arduino_WiFiConnectionHandler.cpp @@ -19,9 +19,10 @@ INCLUDE ******************************************************************************/ -#include "Arduino_WiFiConnectionHandler.h" +#include "Arduino_ConnectionHandlerDefinitions.h" #ifdef BOARD_HAS_WIFI /* Only compile if the board has WiFi */ +#include "Arduino_WiFiConnectionHandler.h" /****************************************************************************** CONSTANTS @@ -143,7 +144,7 @@ NetworkConnectionState WiFiConnectionHandler::update_handleConnected() Debug.print(DBG_INFO, F("Attempting reconnection")); #endif } - + return NetworkConnectionState::DISCONNECTED; } return NetworkConnectionState::CONNECTED; diff --git a/src/Arduino_WiFiConnectionHandler.h b/src/Arduino_WiFiConnectionHandler.h index bf16fa0..e7621e5 100644 --- a/src/Arduino_WiFiConnectionHandler.h +++ b/src/Arduino_WiFiConnectionHandler.h @@ -22,9 +22,31 @@ INCLUDE ******************************************************************************/ -#include "Arduino_ConnectionHandler.h" - -#ifdef BOARD_HAS_WIFI /* Only compile if the board has WiFi */ +#include "Arduino_ConnectionHandlerInterface.h" + +#ifdef ARDUINO_SAMD_MKR1000 + #include + #include +#elif defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || \ + defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined (ARDUINO_NANO_RP2040_CONNECT) + #include + #include +#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M7) || \ + defined(ARDUINO_NICLA_VISION) || defined(ARDUINO_OPTA) || defined(ARDUINO_GIGA) + #include + #include +#elif defined(ARDUINO_PORTENTA_C33) + #include + #include +#elif defined(ARDUINO_ARCH_ESP8266) + #include + #include +#elif defined(ARDUINO_ARCH_ESP32) + #include + #include +#elif defined(ARDUINO_UNOR4_WIFI) + #include +#endif /****************************************************************************** CLASS DECLARATION @@ -59,6 +81,4 @@ class WiFiConnectionHandler : public ConnectionHandler WiFiClient _wifi_client; }; -#endif /* #ifdef BOARD_HAS_WIFI */ - #endif /* ARDUINO_WIFI_CONNECTION_HANDLER_H_ */