From 132aae944f1ac6a4bdf1d887025a65ab9cb7be29 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 14 Jan 2024 18:25:04 +0100 Subject: [PATCH] [LoRaWAN] Fix Module* not needed without persistent storage --- src/protocols/LoRaWAN/LoRaWAN.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/protocols/LoRaWAN/LoRaWAN.cpp b/src/protocols/LoRaWAN/LoRaWAN.cpp index f02677b7..54c36b19 100644 --- a/src/protocols/LoRaWAN/LoRaWAN.cpp +++ b/src/protocols/LoRaWAN/LoRaWAN.cpp @@ -661,9 +661,10 @@ int16_t LoRaWANNode::beginOTAA(uint64_t joinEUI, uint64_t devEUI, uint8_t* nwkKe } int16_t LoRaWANNode::beginABP(uint32_t addr, uint8_t* nwkSKey, uint8_t* appSKey, uint8_t* fNwkSIntKey, uint8_t* sNwkSIntKey, bool force) { - Module* mod = this->phyLayer->getMod(); - #if !defined(RADIOLIB_EEPROM_UNSUPPORTED) + // only needed for persistent storage + Module* mod = this->phyLayer->getMod(); + // check if we actually need to restart from a clean session uint16_t checkSum = 0; checkSum ^= LoRaWANNode::checkSum16(reinterpret_cast(&addr), 4);