From 45c376bde6370175796c0434dabb6e65091ec2f3 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sat, 12 Aug 2023 19:58:00 +0200 Subject: [PATCH] [LoRaWAN] Fixed variable range warning --- src/protocols/LoRaWAN/LoRaWAN.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/protocols/LoRaWAN/LoRaWAN.cpp b/src/protocols/LoRaWAN/LoRaWAN.cpp index 83fb49e3..b31abbb2 100644 --- a/src/protocols/LoRaWAN/LoRaWAN.cpp +++ b/src/protocols/LoRaWAN/LoRaWAN.cpp @@ -325,7 +325,9 @@ int16_t LoRaWANNode::uplink(const char* str, uint8_t port) { int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port) { // check destination port - RADIOLIB_CHECK_RANGE(port, 0x00, 0xDF, RADIOLIB_ERR_INVALID_PORT); + if(port > 0xDF) { + return(RADIOLIB_ERR_INVALID_PORT); + } // check if there is a MAC command to piggyback uint8_t foptsLen = 0;