From aa46a0c8b3f4943a6ab8ff90a22f19c25d912e8e Mon Sep 17 00:00:00 2001 From: StevenCellist Date: Tue, 2 Apr 2024 22:25:50 +0200 Subject: [PATCH] [LoRaWAN] Hide broken CSMA --- .../LoRaWAN_Reference/LoRaWAN_Reference.ino | 6 +----- src/protocols/LoRaWAN/LoRaWAN.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino b/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino index ad49a261c..608fb82f9 100644 --- a/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino +++ b/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino @@ -60,13 +60,9 @@ void setup() { // Disable the ADR algorithm (on by default which is preferable) node.setADR(false); - // Set a fixed datarate & make it persistent (not normal) + // Set a fixed datarate node.setDatarate(4); - // Enable CSMA which tries to minimize packet loss by searching - // for a free channel before actually sending an uplink - node.setCSMA(6, 2, true); - // Manages uplink intervals to the TTN Fair Use Policy node.setDutyCycle(true, 1250); diff --git a/src/protocols/LoRaWAN/LoRaWAN.h b/src/protocols/LoRaWAN/LoRaWAN.h index 37e1c0435..d2f05e9b9 100644 --- a/src/protocols/LoRaWAN/LoRaWAN.h +++ b/src/protocols/LoRaWAN/LoRaWAN.h @@ -808,14 +808,6 @@ class LoRaWANNode { */ int16_t setTxPower(int8_t txPower); - /*! - \brief Configures CSMA for LoRaWAN as per TR-13, LoRa Alliance. - \param backoffMax Num of BO slots to be decremented after DIFS phase. 0 to disable BO. - \param difsSlots Num of CADs to estimate a clear CH. - \param enableCSMA enable/disable CSMA for LoRaWAN. - */ - void setCSMA(uint8_t backoffMax, uint8_t difsSlots, bool enableCSMA = false); - /*! \brief Returns the quality of connectivity after requesting a LinkCheck MAC command. Returns 'true' if a network response was successfully parsed. @@ -1017,6 +1009,14 @@ class LoRaWANNode { // get the payload length for a specific MAC command uint8_t getMacPayloadLength(uint8_t cid); + /*! + \brief Configures CSMA for LoRaWAN as per TR-13, LoRa Alliance. + \param backoffMax Num of BO slots to be decremented after DIFS phase. 0 to disable BO. + \param difsSlots Num of CADs to estimate a clear CH. + \param enableCSMA enable/disable CSMA for LoRaWAN. + */ + void setCSMA(uint8_t backoffMax, uint8_t difsSlots, bool enableCSMA = false); + // Performs CSMA as per LoRa Alliance Technical Recommendation 13 (TR-013). void performCSMA();