Skip to content

Commit 6a4193e

Browse files
committed
Simplifying getting started examples by extracting the arduino_secrets into separate file.
1 parent 61eaa58 commit 6a4193e

File tree

4 files changed

+31
-29
lines changed

4 files changed

+31
-29
lines changed

examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino

+1-19
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,7 @@
22
#include <ConnectionManager.h>
33
#include <GSMConnectionManager.h>
44

5-
#ifndef SECRET_PIN
6-
#define SECRET_PIN ""
7-
#pragma message "You need to define SECRET_PIN in tab/arduino_secrets.h"
8-
#endif
9-
10-
#ifndef SECRET_APN
11-
#define SECRET_APN ""
12-
#pragma message "You need to define SECRET_PIN in tab/arduino_secrets.h"
13-
#endif
14-
15-
#ifndef SECRET_USER_NAME
16-
#define SECRET_USER_NAME ""
17-
#pragma message "You need to define SECRET_USER_NAME in tab/arduino_secrets.h"
18-
#endif
19-
20-
#ifndef SECRET_PASSWORD
21-
#define SECRET_PASSWORD ""
22-
#pragma message "You need to define SECRET_PASSWORD in tab/arduino_secrets.h"
23-
#endif
5+
#include "arduino_secrets.h"
246

257
String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters
268
// handles connection to the network
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#ifndef SECRET_PIN
2+
#define SECRET_PIN ""
3+
#warning "You need to define SECRET_PIN in tab/arduino_secrets.h"
4+
#endif
5+
6+
#ifndef SECRET_APN
7+
#define SECRET_APN ""
8+
#warning "You need to define SECRET_PIN in tab/arduino_secrets.h"
9+
#endif
10+
11+
#ifndef SECRET_USER_NAME
12+
#define SECRET_USER_NAME ""
13+
#warning "You need to define SECRET_USER_NAME in tab/arduino_secrets.h"
14+
#endif
15+
16+
#ifndef SECRET_PASSWORD
17+
#define SECRET_PASSWORD ""
18+
#warning "You need to define SECRET_PASSWORD in tab/arduino_secrets.h"
19+
#endif

examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino

+2-10
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@
22
#include <ConnectionManager.h>
33
#include <WiFiConnectionManager.h>
44

5-
#ifndef SECRET_WIFI_NAME
6-
#define SECRET_WIFI_NAME ""
7-
#pragma message "You need to define SECRET_WIFI_NAME in tab/arduino_secrets.h"
8-
#endif
9-
10-
#ifndef SECRET_PASSWORD
11-
#define SECRET_PASSWORD ""
12-
#pragma message "You need to define SECRET_PASSWORD in tab/arduino_secrets.h"
13-
#endif
5+
#include "arduino_secrets.h"
146

157
String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters
168
// handles connection to the network
17-
ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD);
9+
ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS);
1810

1911
void setup() {
2012
setDebugMessageLevel(3); // used to set a level of granularity in information output [0...4]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef SECRET_SSID
2+
#define SECRET_SSID ""
3+
#warning "You need to define SECRET_SSID in tab/arduino_secrets.h"
4+
#endif
5+
6+
#ifndef SECRET_PASS
7+
#define SECRET_PASS ""
8+
#warning "You need to define SECRET_PASS in tab/arduino_secrets.h"
9+
#endif

0 commit comments

Comments
 (0)