Commit cc3629e4 authored by Eric Duminil's avatar Eric Duminil
Browse files

Trying to load session

parent dfc57250
...@@ -59,7 +59,13 @@ namespace lorawan { ...@@ -59,7 +59,13 @@ namespace lorawan {
// Reset the MAC state. Session and pending data transfers will be discarded. // Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset(); LMIC_reset();
// Join, but don't send anything yet. // Join, but don't send anything yet.
LMIC_startJoining(); if (config::lora_session_saved) {
LMIC_setSession(config::lora_netid, config::lora_devaddr, (unsigned char*) config::lorawan_nwk_key,
(unsigned char*) config::lorawan_art_key);
connected = true; // Well, hopefully.
} else {
LMIC_startJoining();
}
sensor_console::defineIntCommand("lora", setLoRaInterval, F("300 (Sets LoRaWAN sending interval, in s)")); sensor_console::defineIntCommand("lora", setLoRaInterval, F("300 (Sets LoRaWAN sending interval, in s)"));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment