From 33ab117c6d6538240dd640918c4bcda59805ac12 Mon Sep 17 00:00:00 2001 From: StevenCellist Date: Tue, 22 Oct 2024 19:15:33 +0200 Subject: [PATCH] [LoRaWAN] Fix incorrect payload size values --- src/protocols/LoRaWAN/LoRaWAN.h | 2 +- src/protocols/LoRaWAN/LoRaWANBands.cpp | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/protocols/LoRaWAN/LoRaWAN.h b/src/protocols/LoRaWAN/LoRaWAN.h index cf27053e..3816486f 100644 --- a/src/protocols/LoRaWAN/LoRaWAN.h +++ b/src/protocols/LoRaWAN/LoRaWAN.h @@ -385,7 +385,7 @@ struct LoRaWANBand_t { /*! \brief Maximum allowed frequency (coded in 100 Hz steps) */ uint32_t freqMax; - /*! \brief Array of allowed maximum payload lengths for each data rate (global maximum) */ + /*! \brief Array of allowed maximum application payload lengths for each data rate (N-value) */ uint8_t payloadLenMax[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES]; /*! \brief Maximum allowed output power in this band in dBm */ diff --git a/src/protocols/LoRaWAN/LoRaWANBands.cpp b/src/protocols/LoRaWAN/LoRaWANBands.cpp index 3b33bec5..d29126aa 100644 --- a/src/protocols/LoRaWAN/LoRaWANBands.cpp +++ b/src/protocols/LoRaWAN/LoRaWANBands.cpp @@ -22,7 +22,7 @@ const LoRaWANBand_t EU868 = { .bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC, .freqMin = 8630000, .freqMax = 8700000, - .payloadLenMax = { 59, 59, 59, 123, 250, 250, 250, 250, 58, 123, 58, 123, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 51, 115, 242, 242, 242, 242, 50, 115, 50, 115, 0, 0, 0 }, .powerMax = 16, .powerNumSteps = 7, .dutyCycle = 36000, @@ -95,7 +95,7 @@ const LoRaWANBand_t US915 = { .bandType = RADIOLIB_LORAWAN_BAND_FIXED, .freqMin = 9020000, .freqMax = 9280000, - .payloadLenMax = { 19, 61, 133, 250, 250, 58, 133, 0, 61, 137, 250, 250, 250, 250, 0 }, + .payloadLenMax = { 11, 53, 125, 242, 242, 50, 125, 0, 53, 129, 242, 242, 242, 242, 0 }, .powerMax = 30, .powerNumSteps = 10, .dutyCycle = 0, @@ -189,7 +189,7 @@ const LoRaWANBand_t EU433 = { .bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC, .freqMin = 4330000, .freqMax = 4340000, - .payloadLenMax = { 59, 59, 59, 123, 250, 250, 250, 250, 0, 0, 0, 0, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 51, 115, 242, 242, 242, 242, 0, 0, 0, 0, 0, 0, 0 }, .powerMax = 12, .powerNumSteps = 5, .dutyCycle = 36000, @@ -262,7 +262,7 @@ const LoRaWANBand_t AU915 = { .bandType = RADIOLIB_LORAWAN_BAND_FIXED, .freqMin = 9150000, .freqMax = 9280000, - .payloadLenMax = { 59, 59, 59, 123, 250, 250, 250, 58, 61, 137, 250, 250, 250, 250, 0 }, + .payloadLenMax = { 51, 51, 51, 115, 242, 242, 242, 50, 53, 129, 242, 242, 242, 242, 0 }, .powerMax = 30, .powerNumSteps = 10, .dutyCycle = 0, @@ -356,7 +356,7 @@ const LoRaWANBand_t CN500 = { .bandType = RADIOLIB_LORAWAN_BAND_FIXED, .freqMin = 4700000, .freqMax = 5100000, - .payloadLenMax = { 59, 59, 59, 123, 250, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 51, 115, 242, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .powerMax = 19, .powerNumSteps = 7, .dutyCycle = 0, @@ -443,7 +443,7 @@ const LoRaWANBand_t AS923 = { .bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC, .freqMin = 9150000, .freqMax = 9280000, - .payloadLenMax = { 59, 59, 123, 123, 250, 250, 250, 250, 0, 0, 0, 0, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 115, 115, 242, 242, 242, 242, 0, 0, 0, 0, 0, 0, 0 }, .powerMax = 16, .powerNumSteps = 7, .dutyCycle = 36000, @@ -516,7 +516,7 @@ const LoRaWANBand_t AS923_2 = { .bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC, .freqMin = 9150000, .freqMax = 9280000, - .payloadLenMax = { 59, 59, 123, 123, 250, 250, 250, 250, 0, 0, 0, 0, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 115, 115, 242, 242, 242, 242, 0, 0, 0, 0, 0, 0, 0 }, .powerMax = 16, .powerNumSteps = 7, .dutyCycle = 36000, @@ -589,7 +589,7 @@ const LoRaWANBand_t AS923_3 = { .bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC, .freqMin = 9150000, .freqMax = 9280000, - .payloadLenMax = { 59, 59, 123, 123, 250, 250, 250, 250, 0, 0, 0, 0, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 115, 115, 242, 242, 242, 242, 0, 0, 0, 0, 0, 0, 0 }, .powerMax = 16, .powerNumSteps = 7, .dutyCycle = 36000, @@ -662,7 +662,7 @@ const LoRaWANBand_t AS923_4 = { .bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC, .freqMin = 9170000, .freqMax = 9200000, - .payloadLenMax = { 59, 59, 123, 123, 250, 250, 250, 250, 0, 0, 0, 0, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 115, 115, 242, 242, 242, 242, 0, 0, 0, 0, 0, 0, 0 }, .powerMax = 16, .powerNumSteps = 7, .dutyCycle = 36000, @@ -735,7 +735,7 @@ const LoRaWANBand_t KR920 = { .bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC, .freqMin = 9209000, .freqMax = 9233000, - .payloadLenMax = { 59, 59, 59, 123, 250, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 51, 115, 242, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .powerMax = 14, .powerNumSteps = 7, .dutyCycle = 0, @@ -808,7 +808,7 @@ const LoRaWANBand_t IN865 = { .bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC, .freqMin = 8650000, .freqMax = 8670000, - .payloadLenMax = { 59, 59, 59, 123, 250, 250, 0, 250, 0, 0, 0, 0, 0, 0, 0 }, + .payloadLenMax = { 51, 51, 51, 115, 242, 242, 0, 242, 0, 0, 0, 0, 0, 0, 0 }, .powerMax = 30, .powerNumSteps = 10, .dutyCycle = 0,