Skip to content

Enable compilation of examples for both WiFi and GSM enab.ed boards #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/ArduinoIoTCloud_LED_switch/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
If you prefer using a MKR GSM 1400 comment the lines above and uncommet the following.
PIN, APN, Login and Password are supplied by your Cellular Data provider.
*/
//#define SECRET_PIN ""
//#define SECRET_APN ""
//#define SECRET_LOGIN ""
//#define SECRET_PASS ""
#define SECRET_PIN ""
#define SECRET_APN ""
#define SECRET_LOGIN ""
#define SECRET_PASS ""
33 changes: 17 additions & 16 deletions examples/ArduinoIoTCloud_LED_switch/thingProperties.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#include <ArduinoIoTCloud.h>
/*
The following include line is used for WiFi enabled boards (MKR1000, MKR WiFi 1010)
*/
#include <WiFiConnectionManager.h>
/*
If you prefer using a MKR GSM 1400 comment the line above and uncommet the following.
*/
//#include <GSMConnectionManager.h>
#include <ConnectionManager.h>

#if defined(BOARD_HAS_WIFI)
#include <WiFiConnectionManager.h>
#elif defined(BOARD_HAS_GSM)
#include <GSMConnectionManager.h>
#else
#error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010 and MKR GSM 1400"
#endif


// Your THING_ID
#define THING_ID "ARDUINO_IOT_CLOUD_THING_ID"
Expand All @@ -22,11 +24,10 @@ void initProperties() {
ArduinoCloud.addProperty(potentiometer, READ, ON_CHANGE);
}

/*
The following include line is used for WiFi enabled boards (MKR1000, MKR WiFi 1010)
*/
ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS);
/*
If you prefer using a MKR GSM 1400 comment the line above and uncommet the following.
*/
//ConnectionManager *ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#if defined(BOARD_HAS_WIFI)
ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS);
#elif defined(BOARD_HAS_GSM)
ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager (SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#endif