Skip to content

Commit 13366e9

Browse files
authored
Merge pull request #212 from matthias-bs/arduino-lorawan-esp32-example
Changed cMyLoRaWAN to inherit from Arduino_LoRaWAN_network
2 parents 22abde6 + 69a418a commit 13366e9

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

examples/arduino_lorawan_esp32_example/arduino_lorawan_esp32_example.ino

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// arduino_lorawan_esp32_example.ino
33
//
44
// Example sketch showing how to periodically poll a sensor and send the data
5-
// to The Things Network.
5+
// to a LoRaWAN network.
66
//
77
// Based on simple_sensor_bme280.ino with the following modifications:
88
// - reading the sensor data is replaced by a stub
@@ -26,7 +26,7 @@
2626
// MCCI Arduino Development Kit ADK 0.2.2
2727
// MCCI LoRaWAN LMIC library 4.1.1
2828
// MCCI Arduino LoRaWAN Library 0.9.2
29-
// LoRa_Serialization 3.1.0
29+
// LoRa_Serialization 3.2.1
3030
//
3131
//
3232
// created: 07/2022
@@ -58,6 +58,8 @@
5858
// History:
5959
//
6060
// 20220729 Created
61+
// 20230307 Changed cMyLoRaWAN to inherit from Arduino_LoRaWAN_network
62+
// instead of Arduino_LoRaWAN_ttn
6163
//
6264
//
6365
// Notes:
@@ -74,8 +76,18 @@
7476
//
7577
///////////////////////////////////////////////////////////////////////////////
7678

79+
//--- Select LoRaWAN Network ---
80+
// The Things Network
7781
#define ARDUINO_LMIC_CFG_NETWORK_TTN 1
7882

83+
// Helium Network
84+
// see mcci-cathena/arduino-lorawan issue #185 "Add Helium EU868 support"
85+
// (https://github.com/mcci-catena/arduino-lorawan/issues/185)
86+
#define ARDUINO_LMIC_CFG_NETWORK_GENERIC 0
87+
88+
// (Add other networks here)
89+
90+
7991
#include <Arduino_LoRaWAN_network.h>
8092
#include <Arduino_LoRaWAN_EventLog.h>
8193
#include <arduino_lmic.h>
@@ -143,10 +155,10 @@ const uint8_t PAYLOAD_SIZE = 8;
143155
|
144156
\****************************************************************************/
145157

146-
class cMyLoRaWAN : public Arduino_LoRaWAN_ttn {
158+
class cMyLoRaWAN : public Arduino_LoRaWAN_network {
147159
public:
148160
cMyLoRaWAN() {};
149-
using Super = Arduino_LoRaWAN_ttn;
161+
using Super = Arduino_LoRaWAN_network;
150162
void setup();
151163

152164
protected:

0 commit comments

Comments
 (0)