Skip to content

Commit bc9691b

Browse files
added error when compiling unsupported connection handler
1 parent 62ad2b8 commit bc9691b

7 files changed

+28
-3
lines changed

Diff for: src/CatM1ConnectionHandler.h

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include <GSM.h>
2929
#endif
3030

31+
#ifndef BOARD_HAS_CATM1_NBIOT
32+
#error "Board doesn't support CATM1_NBIOT"
33+
#endif
34+
3135
/******************************************************************************
3236
CLASS DECLARATION
3337
******************************************************************************/

Diff for: src/CellularConnectionHandler.h

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#include <Arduino_Cellular.h>
2828
#endif
2929

30+
#ifndef BOARD_HAS_CELLULAR
31+
#error "Board doesn't support CELLULAR"
32+
#endif
33+
3034
class CellularConnectionHandler : public ConnectionHandler
3135
{
3236
public:

Diff for: src/EthernetConnectionHandler.h

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#include <PortentaEthernet.h>
3333
#endif
3434

35+
#ifndef BOARD_HAS_ETHERNET
36+
#error "Board doesn't support ETHERNET"
37+
#endif
38+
3539
/******************************************************************************
3640
CLASS DECLARATION
3741
******************************************************************************/

Diff for: src/GSMConnectionHandler.h

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include <MKRGSM.h>
2929
#endif
3030

31+
#ifndef BOARD_HAS_GSM
32+
#error "Board doesn't support GSM"
33+
#endif
34+
3135
/******************************************************************************
3236
CLASS DECLARATION
3337
******************************************************************************/

Diff for: src/LoRaConnectionHandler.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
#include <MKRWAN.h>
2929
#endif
3030

31-
#ifdef BOARD_HAS_LORA /* Only compile if the board has LoRa */
31+
#ifndef BOARD_HAS_LORA
32+
#error "Board doesn't support LORA"
33+
#endif
34+
3235

3336
/******************************************************************************
3437
CLASS DECLARATION
@@ -78,6 +81,4 @@ class LoRaConnectionHandler : public ConnectionHandler
7881
LoRaModem _modem;
7982
};
8083

81-
#endif /* #ifdef BOARD_HAS_LORA */
82-
8384
#endif /* ARDUINO_LORA_CONNECTION_HANDLER_H_ */

Diff for: src/NBConnectionHandler.h

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include <MKRNB.h>
2929
#endif
3030

31+
#ifndef BOARD_HAS_NB
32+
#error "Board doesn't support NB"
33+
#endif
34+
3135
/******************************************************************************
3236
CLASS DECLARATION
3337
******************************************************************************/

Diff for: src/WiFiConnectionHandler.h

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
#include <WiFiS3.h>
4949
#endif
5050

51+
#ifndef BOARD_HAS_WIFI
52+
#error "Board doesn't support WIFI"
53+
#endif
54+
5155
/******************************************************************************
5256
CLASS DECLARATION
5357
******************************************************************************/

0 commit comments

Comments
 (0)