Skip to content

Commit

Permalink
added error when compiling unsupported connection handler
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Aug 20, 2024
1 parent 62ad2b8 commit bc9691b
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/CatM1ConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include <GSM.h>
#endif

#ifndef BOARD_HAS_CATM1_NBIOT
#error "Board doesn't support CATM1_NBIOT"
#endif

/******************************************************************************
CLASS DECLARATION
******************************************************************************/
Expand Down
4 changes: 4 additions & 0 deletions src/CellularConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include <Arduino_Cellular.h>
#endif

#ifndef BOARD_HAS_CELLULAR
#error "Board doesn't support CELLULAR"
#endif

class CellularConnectionHandler : public ConnectionHandler
{
public:
Expand Down
4 changes: 4 additions & 0 deletions src/EthernetConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include <PortentaEthernet.h>
#endif

#ifndef BOARD_HAS_ETHERNET
#error "Board doesn't support ETHERNET"
#endif

/******************************************************************************
CLASS DECLARATION
******************************************************************************/
Expand Down
4 changes: 4 additions & 0 deletions src/GSMConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include <MKRGSM.h>
#endif

#ifndef BOARD_HAS_GSM
#error "Board doesn't support GSM"
#endif

/******************************************************************************
CLASS DECLARATION
******************************************************************************/
Expand Down
7 changes: 4 additions & 3 deletions src/LoRaConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
#include <MKRWAN.h>
#endif

#ifdef BOARD_HAS_LORA /* Only compile if the board has LoRa */
#ifndef BOARD_HAS_LORA
#error "Board doesn't support LORA"
#endif


/******************************************************************************
CLASS DECLARATION
Expand Down Expand Up @@ -78,6 +81,4 @@ class LoRaConnectionHandler : public ConnectionHandler
LoRaModem _modem;
};

#endif /* #ifdef BOARD_HAS_LORA */

#endif /* ARDUINO_LORA_CONNECTION_HANDLER_H_ */
4 changes: 4 additions & 0 deletions src/NBConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include <MKRNB.h>
#endif

#ifndef BOARD_HAS_NB
#error "Board doesn't support NB"
#endif

/******************************************************************************
CLASS DECLARATION
******************************************************************************/
Expand Down
4 changes: 4 additions & 0 deletions src/WiFiConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#include <WiFiS3.h>
#endif

#ifndef BOARD_HAS_WIFI
#error "Board doesn't support WIFI"
#endif

/******************************************************************************
CLASS DECLARATION
******************************************************************************/
Expand Down

0 comments on commit bc9691b

Please sign in to comment.