diff --git a/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino b/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino index ad49a261..608fb82f 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 37e1c043..d2f05e9b 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();