Skip to content

Commit

Permalink
[LoRaWAN] Hide broken CSMA
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenCellist committed Apr 2, 2024
1 parent a4ad32e commit aa46a0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
6 changes: 1 addition & 5 deletions examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
16 changes: 8 additions & 8 deletions src/protocols/LoRaWAN/LoRaWAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit aa46a0c

Please sign in to comment.