Skip to content

Commit b422cd8

Browse files
committed
Import changes to support AU915_TTN
Based on origianl commit from Kenneth Kaijie Ng <[email protected]>
1 parent 10c3e8b commit b422cd8

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/MKRWAN.h

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@ const T& Max(const T& a, const T& b)
206206
#endif
207207

208208
#define LORA_NL "\n"
209-
static const char LORA_OK[] = "OK\r\n";
210-
static const char LORA_ERROR[] = "ERROR\r\n";
211-
static const char LORA_ERROR_PARAM[] = "PARAM_ERROR\r\n";
212-
static const char LORA_ERROR_BUSY[] = "+ERR_BUSY\r";
213-
static const char LORA_ERROR_OVERFLOW[] = "+ERR_PARAM_OVERFLOW\r";
214-
static const char LORA_ERROR_NO_NETWORK[] = "+ERR_NO_NETWORK\r";
215-
static const char LORA_ERROR_RX[] = "+ERR_RX\r";
216-
static const char LORA_ERROR_UNKNOWN[] = "+ERR_UNKNOWN\r";
209+
static const char LORA_OK[] = "+OK\r\n";
210+
static const char LORA_ERROR[] = "+ERROR\r\n";
211+
static const char LORA_ERROR_PARAM[] = "+PARAM_ERROR\r\n";
212+
static const char LORA_ERROR_BUSY[] = "+ERR_BUSY\r\n";
213+
static const char LORA_ERROR_OVERFLOW[] = "+ERR_PARAM_OVERFLOW\r\n";
214+
static const char LORA_ERROR_NO_NETWORK[] = "+ERR_NO_NETWORK\r\n";
215+
static const char LORA_ERROR_RX[] = "+ERR_RX\r\n";
216+
static const char LORA_ERROR_UNKNOWN[] = "+ERR_UNKNOWN\r\n";
217217

218218
static const char ARDUINO_FW_VERSION[] = "ARD-078 1.1.9";
219219
static const char ARDUINO_FW_IDENTIFIER[] = "ARD-078";
@@ -229,6 +229,7 @@ typedef enum {
229229
IN865 = 7,
230230
US915 = 8,
231231
RU864 = 9,
232+
AU915_TTN = 0x80,
232233
} _lora_band;
233234

234235
typedef enum {
@@ -247,6 +248,8 @@ typedef enum {
247248
DEV_EUI,
248249
DEV_ADDR,
249250
NWKS_KEY,
251+
FNWKS_KEY,
252+
SNWKS_KEY,
250253
APPS_KEY,
251254
NWK_ID,
252255
} _lora_property;
@@ -319,6 +322,9 @@ class LoRaModem : public Stream
319322
//set(NWK_ID, nwkId);
320323
set(DEV_ADDR, devAddr);
321324
set(NWKS_KEY, nwkSKey);
325+
// for LoRa 1.0.x devices, this MUST be the same as the NWKS_KEY
326+
set(FNWKS_KEY, nwkSKey);
327+
set(SNWKS_KEY, nwkSKey);
322328
set(APPS_KEY, appSKey);
323329
network_joined = join();
324330
return (getJoinStatus() == 1);
@@ -761,6 +767,12 @@ class LoRaModem : public Stream
761767
case NWKS_KEY:
762768
sendAT(GF("+NWKSKEY="), real_val);
763769
break;
770+
case FNWKS_KEY:
771+
sendAT(GF("+FNWKSKEY="), real_val);
772+
break;
773+
case SNWKS_KEY:
774+
sendAT(GF("+SNWKSKEY="), real_val);
775+
break;
764776
case NWK_ID:
765777
sendAT(GF("+NWKID="), real_val);
766778
break;

0 commit comments

Comments
 (0)