Skip to content

Commit 9f19c4c

Browse files
NicolasdejeanFokkeZB
authored andcommitted
Made freqPlan a define (#161)
* made freqPlan a define * replaced TTN_FP by REPLACE_ME * fix travis
1 parent 698296d commit 9f19c4c

File tree

11 files changed

+37
-21
lines changed

11 files changed

+37
-21
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ install:
1414
- arduino --install-library "DHT sensor library:1.3.0,Adafruit Unified Sensor:1.0.2"
1515
before_script:
1616
# Replace placeholders with actual frequency plan (on Mac OS folow -i by '')
17-
- find $PWD/examples -type f -name "*.ino" -exec sed -i 's/\(freqPlan = \)/\1TTN_FP_EU868;/g' {} +
17+
- find $PWD/examples -type f -name "*.ino" -exec sed -i 's/REPLACE_ME/TTN_FP_EU868/g' {} +
1818
script:
1919
- arduino --verify --board arduino:avr:leonardo $PWD/examples/ABP/ABP.ino
2020
- arduino --verify --board arduino:avr:leonardo $PWD/examples/DeviceInfo/DeviceInfo.ino

examples/ABP/ABP.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
const char *devAddr = "00000000";
55
const char *nwkSKey = "00000000000000000000000000000000";
66
const char *appSKey = "00000000000000000000000000000000";
7-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
87

98
#define loraSerial Serial1
109
#define debugSerial Serial
1110

11+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
12+
#define freqPlan REPLACE_ME
13+
1214
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
1315

1416
void setup() {

examples/DeviceInfo/DeviceInfo.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <TheThingsNetwork.h>
22

3-
// Set the frequency plan
4-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
5-
63
#define loraSerial Serial1
74
#define debugSerial Serial
85

6+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
7+
#define freqPlan REPLACE_ME
8+
99
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
1010

1111
void setup()

examples/Message/Receive/Receive.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#include <TheThingsNetwork.h>
22
#include <TheThingsMessage.h>
33

4-
// Set your AppEUI, AppKey and the frequency plan
4+
// Set your AppEUI and AppKey
55
const char *appEui = "0000000000000000";
66
const char *appKey = "00000000000000000000000000000000";
7-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
87

98
#define loraSerial Serial1
109
#define debugSerial Serial
1110

11+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
12+
#define freqPlan REPLACE_ME
13+
1214
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
1315

1416
sensordata_t sensorData = api_SensorData_init_default;

examples/Message/Send/Send.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#include <TheThingsNetwork.h>
22
#include <TheThingsMessage.h>
33

4-
// Set your AppEUI, AppKey and the frequency plan
4+
// Set your AppEUI and AppKey
55
const char *appEui = "0000000000000000";
66
const char *appKey = "00000000000000000000000000000000";
7-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
87

98
#define loraSerial Serial1
109
#define debugSerial Serial
1110

11+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
12+
#define freqPlan REPLACE_ME
13+
1214
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
1315

1416
sensordata_t data = api_SensorData_init_default;

examples/QuickStart/QuickStart.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#include <TheThingsNetwork.h>
22

3-
// Set your AppEUI, AppKey and the frequency plan
3+
// Set your AppEUI and AppKey
44
const char *appEui = "0000000000000000";
55
const char *appKey = "00000000000000000000000000000000";
6-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
76

87
#define loraSerial Serial1
98
#define debugSerial Serial
109

10+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
11+
#define freqPlan REPLACE_ME
12+
1113
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
1214

1315
void setup() {

examples/Receive/Receive.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#include <TheThingsNetwork.h>
22

3-
// Set your AppEUI, AppKey and the frequency plan
3+
// Set your AppEUI and AppKey
44
const char *appEui = "0000000000000000";
55
const char *appKey = "00000000000000000000000000000000";
6-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
76

87
#define loraSerial Serial1
98
#define debugSerial Serial
109

10+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
11+
#define freqPlan REPLACE_ME
12+
1113
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
1214

1315
void setup() {

examples/Send/Send.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#include <TheThingsNetwork.h>
22

3-
// Set your AppEUI, AppKey and the frequency plan
3+
// Set your AppEUI and AppKey
44
const char *appEui = "0000000000000000";
55
const char *appKey = "00000000000000000000000000000000";
6-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
76

87
#define loraSerial Serial1
98
#define debugSerial Serial
109

10+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
11+
#define freqPlan REPLACE_ME
12+
1113
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
1214

1315
void setup() {

examples/Sensors/DHT/DHT.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
// First install "DHT sensor library" via the Library Manager
44
#include <DHT.h>
55

6-
// Set your AppEUI, AppKey and the frequency plan
6+
// Set your AppEUI and AppKey
77
const char *appEui = "0000000000000000";
88
const char *appKey = "00000000000000000000000000000000";
9-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
109

1110
#define loraSerial Serial1
1211
#define debugSerial Serial
1312

13+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
14+
#define freqPlan REPLACE_ME
15+
1416
#define DHTPIN 2
1517

1618
//Choose your DHT sensor moddel

examples/Sensors/LightSensor/LightSensor.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
#include <TheThingsNetwork.h>
22

3-
// Set your AppEUI, AppKey and the frequency plan
3+
// Set your AppEUI and AppKey
44
const char *appEui = "0000000000000000";
55
const char *appKey = "00000000000000000000000000000000";
6-
const ttn_fp_t freqPlan = // Use either TTN_FP_EU868; or TTN_FP_US915; here
76

87
//define AnalogPin for sensor
98
#define LightPin A0
109

1110
#define loraSerial Serial1
1211
#define debugSerial Serial
1312

13+
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
14+
#define freqPlan REPLACE_ME
15+
1416
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
1517

1618
void setup() {

0 commit comments

Comments
 (0)