From 4ccc28f18b0d14978bcae6101586bb327bd720f6 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 11 May 2025 17:43:08 +0200 Subject: [PATCH] [LoRaWAN] Fix Arduino sendReceive not setting downlink string --- src/protocols/LoRaWAN/LoRaWAN.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/protocols/LoRaWAN/LoRaWAN.cpp b/src/protocols/LoRaWAN/LoRaWAN.cpp index 6b6a48f9..1445fab9 100644 --- a/src/protocols/LoRaWAN/LoRaWAN.cpp +++ b/src/protocols/LoRaWAN/LoRaWAN.cpp @@ -28,7 +28,7 @@ int16_t LoRaWANNode::sendReceive(const String& strUp, uint8_t fPort, String& str state = this->sendReceive(reinterpret_cast(dataUp), strlen(dataUp), fPort, dataDown, &lenDown, isConfirmed, eventUp, eventDown); - if(state == RADIOLIB_ERR_NONE) { + if(state > RADIOLIB_ERR_NONE) { // add null terminator dataDown[lenDown] = '\0'; @@ -157,8 +157,8 @@ int16_t LoRaWANNode::sendReceive(const uint8_t* dataUp, size_t lenUp, uint8_t fP } // end of transmission & reception - // note: if an error occured, it may still be the case that a transmission occured - // therefore, we act as if a transmission occured before throwing the actual error + // note: if an error occurred, it may still be the case that a transmission occurred + // therefore, we act as if a transmission occurred before throwing the actual error // this feels to be the best way to comply to spec // increase frame counter by one for the next uplink