From 9195dbabdaf20791d2097ce89e576e577d908932 Mon Sep 17 00:00:00 2001 From: StevenCellist <47155822+StevenCellist@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:39:28 +0200 Subject: [PATCH] [LoRaWAN] Fix downlink user-MAC commands piling up --- src/protocols/LoRaWAN/LoRaWAN.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/protocols/LoRaWAN/LoRaWAN.cpp b/src/protocols/LoRaWAN/LoRaWAN.cpp index e0a750a3..90325ecf 100644 --- a/src/protocols/LoRaWAN/LoRaWAN.cpp +++ b/src/protocols/LoRaWAN/LoRaWAN.cpp @@ -1497,6 +1497,9 @@ int16_t LoRaWANNode::downlink(uint8_t* data, size_t* len, LoRaWANEvent_t* event) event->fPort = fPort; } + // clear the previous MAC commands, if any + memset(&(this->commandsDown), 0, sizeof(LoRaWANMacCommandQueue_t)); + // process FOpts (if there are any) if(fOptsLen > 0) { // there are some Fopts, decrypt them