Skip to content

Commit df1aea3

Browse files
committed
Extend example to be compilable for Arduino MKRGSM 1400 as well as Arduino MKR NB 1500
1 parent 0ae849c commit df1aea3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/ConnectionHandlerDemo/ConnectionHandlerDemo.ino

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "arduino_secrets.h"
22

3-
#include <Arduino_WiFiConnectionHandler.h>
3+
#include <Arduino_ConnectionHandler.h>
44

55
/* SECRET_ fields are in arduino_secrets.h included above
66
if using a WiFi board (Arduino MKR1000, MKR WiFi 1010, Nano 33 IoT, UNO
@@ -22,7 +22,13 @@
2222
NBConnectionHandler conMan(SECRET_PIN);
2323
*/
2424

25+
#if defined(BOARD_HAS_WIFI)
2526
WiFiConnectionHandler conMan(SECRET_SSID, SECRET_PASS);
27+
#elif defined(BOARD_HAS_GSM)
28+
GSMConnectionHandler conMan(SECRET_APN, SECRET_PIN, SECRET_GSM_USER, SECRET_GSM_PASS);
29+
#elif defined(BOARD_HAS_NB)
30+
NBConnectionHandler conMan(SECRET_PIN);
31+
#endif
2632

2733
void setup() {
2834
Serial.begin(9600);

0 commit comments

Comments
 (0)